Skip to content

Commit d16c9ef

Browse files
committed
Updated docs.
1 parent 03af884 commit d16c9ef

File tree

1 file changed

+80
-6
lines changed

1 file changed

+80
-6
lines changed

docs/configuration.md

Lines changed: 80 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: "How to configure Rusts"
66
Rustus is highly configurable. You can adjust it with CLI or you can use environment variables.
77

88
!!! info
9-
Information about hooks you can find on [Hooks page](../hooks).
9+
Information about hooks you can find on [Hooks page](hooks.md).
1010

1111

1212
## Configuring server
@@ -95,8 +95,9 @@ your local file system.
9595

9696
Availabe storages:
9797

98-
* `file-storage`
99-
* `hybrid-s3`
98+
* [file-storage](#file-storage)
99+
* [hybrid-s3](#hybrid-s3-storage)
100+
* [s3](#s3-storage)
100101

101102
### File storage
102103

@@ -228,6 +229,79 @@ Required parameter are only `--s3-url` and `--s3-bucket`.
228229
rustus
229230
```
230231

232+
### S3 Storage
233+
234+
This storage uploads files directly to S3 without creating temporary files on filesystem.
235+
This might be a better solution for you if you use S3 as underlying object storage,
236+
but it has a disadvantage.
237+
238+
!!! warning "Be aware"
239+
240+
This storage can only upload chunks that are greater than `5MB` each,
241+
except for the last one. Therefore, for all your TUS client libraries,
242+
you should set the chunk size to at least `5,000,000` bytes
243+
244+
If you want to allow users to upload smaller chunks, consider using [hybrid-s3](#hybrid-s3-storage).
245+
246+
247+
Parameters:
248+
249+
* `--s3-url` - s3 endpoint URL;
250+
* `--s3-bucket` - name of a bucket to use;
251+
* `--s3-region` - AWS region to use;
252+
* `--s3-access-key` - S3 access key;
253+
* `--s3-access-key-path` - S3 access key path;
254+
* `--s3-secret-key` - S3 secret key;
255+
* `--s3-secret-key-path` - S3 secret key path;
256+
* `--s3-security-token` - s3 secrity token;
257+
* `--s3-session-token` - S3 session token;
258+
* `--s3-profile` - Name of the section from `~/.aws/credentials` file;
259+
* `--s3-headers` - JSON object with additional header to every S3 request (Useful for setting ACLs);
260+
* `--s3-force-path-style` - use path style URL. It appends bucket name at the end of the URL;
261+
* `--dir-structure` - pattern of a directory structure on s3;
262+
263+
Required parameter are only `--s3-url` and `--s3-bucket`.
264+
265+
=== "CLI"
266+
267+
``` bash
268+
rustus --storage "s3" \
269+
--s3-url "https://localhost:9000" \
270+
--s3-bucket "bucket" \
271+
--s3-region "eu-central1" \
272+
--s3-access-key "fJljHcXo07rqIOzh" \
273+
--s3-access-key-path "/run/agenix/S3_ACCESS_KEY" \
274+
--s3-secret-key "6BJfBUL18nLiGmF5zKW0NKrdxQVxNYWB" \
275+
--s3-secret-key-path "/run/agenix/S3_SECRET_KEY" \
276+
--s3-profile "my_profile" \
277+
--s3-security-token "token" \
278+
--s3-session-token "token" \
279+
--s3-force-path-style \
280+
--s3-headers '{"x-amz-acl": "public-read"}' \
281+
--dir-structure "{year}/{month}/{day}"
282+
```
283+
284+
=== "ENV"
285+
286+
``` bash
287+
export RUSTUS_STORAGE="s3"
288+
export RUSTUS_S3_URL="https://localhost:9000"
289+
export RUSTUS_S3_BUCKET="bucket"
290+
export RUSTUS_S3_REGION="eu-central1"
291+
export RUSTUS_S3_ACCESS_KEY="fJljHcXo07rqIOzh"
292+
export RUSTUS_S3_ACCESS_KEY_PATH="/run/agenix/S3_ACCESS_KEY"
293+
export RUSTUS_S3_SECRET_KEY="6BJfBUL18nLiGmF5zKW0NKrdxQVxNYWB"
294+
export RUSTUS_S3_SECRET_KEY_PATH="/run/agenix/S3_SECCRET_KEY"
295+
export RUSTUS_S3_SECURITY_TOKEN="token"
296+
export RUSTUS_S3_SESSION_TOKEN="token"
297+
export RUSTUS_S3_PROFILE="my_profile"
298+
export RUSTUS_S3_HEADERS='{"x-amz-acl": "public-read"}'
299+
export RUSTUS_S3_FORCE_PATH_STYLE="true"
300+
export RUSTUS_DIR_STRUCTURE="{year}/{month}/{day}"
301+
302+
rustus
303+
```
304+
231305
## Configuring info storage
232306

233307
Info storages are used to store information
@@ -238,9 +312,8 @@ about it requested from storage to get actual path of an upload.
238312

239313
Available info storages:
240314

241-
* `file-info-storage` - stores information in files on disk;
242-
* `redis-info-storage` - information is stored in Redis;
243-
* `db-info-storage` - information is stored in database;
315+
* [file-info-storage](#file-info-storage) - stores information in files on disk;
316+
* [redis-info-storage](#redis-info-storage) - information is stored in Redis;
244317

245318
### File info storage
246319

@@ -279,6 +352,7 @@ Redis db is a good way to store information.
279352
Since rustus need to have latest information and it writes a lot.
280353

281354
Configuration parameters:
355+
282356
* `--info-db-dsn` - connection string for your Redis database.
283357
It's required if `redis-info-storage` is chosen.
284358
* `--redis-info-expiration` - number of seconds when key will expire.

0 commit comments

Comments
 (0)