You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Storage.md
+46-1Lines changed: 46 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Storage Types
2
2
3
-
Ocean Node supports four storage backends for assets (e.g. algorithm or data files). Each type is identified by a `type` field on the file object and has its own shape and validation rules.
3
+
Ocean Node supports five storage backends for assets (e.g. algorithm or data files). Each type is identified by a `type` field on the file object and has its own shape and validation rules.
4
4
5
5
## Supported types
6
6
@@ -10,6 +10,7 @@ Ocean Node supports four storage backends for assets (e.g. algorithm or data fil
10
10
|**IPFS**|`ipfs`| File identified by IPFS CID |
11
11
|**Arweave**|`arweave`| File identified by Arweave transaction ID |
12
12
|**S3**|`s3`| File in S3-compatible storage (AWS, Ceph, MinIO, etc.) |
13
+
|**FTP**|`ftp`| File served via FTP or FTPS |
13
14
14
15
All file objects can optionally include encryption metadata: `encryptedBy` and `encryptMethod` (e.g. `AES`, `ECIES`).
15
16
@@ -163,11 +164,55 @@ Files are stored in S3-compatible object storage. The node uses the AWS SDK and
163
164
164
165
---
165
166
167
+
## FTP storage
168
+
169
+
Files are fetched or uploaded via FTP or FTPS. The node uses a single `url` field containing the full FTP(S) URL (including optional credentials). Functionality mirrors URL storage: stream download, file metadata (size; content-type is `application/octet-stream`), and upload via STOR.
|`url`| Yes | Full FTP or FTPS URL. Supports `ftp://` and `ftps://`. May include credentials as `ftp://user:password@host:port/path`. Default port is 21 for FTP and 990 for FTPS. |
193
+
194
+
### Validation
195
+
196
+
-`url` must be present.
197
+
- URL must use protocol `ftp://` or `ftps://`.
198
+
- If the node config defines `unsafeURLs` (list of regex patterns), any URL matching a pattern is rejected.
199
+
200
+
### Node configuration
201
+
202
+
- Optional: `unsafeURLs` – array of regex strings; URLs matching any of them are considered unsafe and rejected (same as URL storage).
203
+
204
+
### Upload
205
+
206
+
FTPStorage supports `upload(filename, stream)`. If the file object’s `url` ends with `/`, the filename is appended to form the remote path; otherwise the URL is used as the full target path. Uses FTP STOR command.
207
+
208
+
---
209
+
166
210
## Summary
167
211
168
212
-**URL**: flexible HTTP(S) endpoints; optional custom headers and `unsafeURLs` filtering.
169
213
-**IPFS**: CID-based; requires `ipfsGateway` in config.
170
214
-**Arweave**: transaction-ID-based; requires `arweaveGateway` in config.
171
215
-**S3**: S3-compatible object storage (AWS, Ceph, MinIO, etc.); credentials and endpoint in the file object; `region` optional (defaults to `us-east-1`).
216
+
-**FTP**: FTP/FTPS URLs; stream download, metadata (size), and upload via STOR; optional `unsafeURLs` filtering.
172
217
173
218
The storage implementation lives under `src/components/storage/`. The node selects the backend from the file object’s `type` (case-insensitive) and validates the shape and config before fetching or streaming the file.
0 commit comments