Skip to content

Commit 2b45feb

Browse files
committed
fix: Mettre à jour la documentation pour le montage S3FS avec de nouvelles variables d'environnement
1 parent 804192b commit 2b45feb

1 file changed

Lines changed: 39 additions & 12 deletions

File tree

sftp/README.md

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,32 +107,59 @@ ssh-keygen -t rsa -b 4096 -f ssh_host_rsa_key < /dev/null
107107

108108
**NOTE:** Using `mount` requires that your container runs with the `CAP_SYS_ADMIN` capability turned on. [See this answer for more information](https://github.com/yieldstudio/sftp/issues/60#issuecomment-332909232).
109109

110+
111+
110112
## S3FS Mounting
111113

112-
You can mount an S3 bucket using s3fs. You need to provide your AWS credentials and the bucket name as environment variables. You also need to install s3fs in the container. You can do this by creating a custom Dockerfile that extends the yieldstudio/sftp image.
114+
You can mount an S3 bucket using s3fs with the following environment variables:
115+
116+
- `S3FS_ENABLED`: enable S3FS mounting (`true` or `1`)
117+
- `AWS_BUCKET`: S3 bucket name
118+
- `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`: AWS credentials
119+
- `S3FS_CREDENTIALS`: alternative, format `access_key:secret_key`
120+
- `AWS_ENDPOINT`: S3 endpoint URL (default: https://s3.amazonaws.com)
121+
- `AWS_DEFAULT_REGION`: AWS region (default: us-east-1)
122+
- `S3FS_ARGS`: additional s3fs options (e.g. `allow_other,use_path_request_style,nocopyapi`)
123+
- `S3FS_PARALLEL_COUNT`: number of parallel threads (default: 15)
124+
- `S3FS_MULTIPART_SIZE`: multipart size (default: 128)
125+
- `S3FS_DEBUG`: enable debug mode (`true` or `1`)
126+
- `S3FS_ROOTDIR`: root directory for s3fs (default: /opt/s3fs)
127+
- `S3FS_MOUNT`: mount point in the container (default: /opt/s3fs/bucket)
128+
- `S3FS_AUTHFILE`: path to the authentication file (default: /opt/s3fs/passwd-s3fs)
129+
- `AWS_USE_PATH_STYLE_ENDPOINT`, `S3FS_ALLOW_OTHER`, `S3FS_NO_COPY_API`: boolean options for mounting
130+
131+
Example:
113132

114133
```
115134
docker run \
116-
-e ENABLE_S3FS=true \
117-
-e AWS_S3_BUCKET=<your-bucket-name> \
118-
-e AWS_S3_ACCESS_KEY_ID=<your-access-key-id> \
119-
-e AWS_S3_SECRET_ACCESS_KEY=<your-secret-access-key> \
135+
-e S3FS_ENABLED=true \
136+
-e AWS_BUCKET=<your-bucket-name> \
137+
-e AWS_ACCESS_KEY_ID=<your-access-key-id> \
138+
-e AWS_SECRET_ACCESS_KEY=<your-secret-access-key> \
139+
-e S3FS_ALLOW_OTHER=true \
140+
-e S3FS_NO_COPY_API=true \
141+
-e S3FS_PARALLEL_COUNT=15 \
142+
-e S3FS_MULTIPART_SIZE=128 \
120143
-p 2222:22 -d yieldstudio/sftp \
121144
foo::1001
122145
```
123146

124147
### Scaleway S3
125148

126-
If you are using Scaleway S3, you need to provide the endpoint as well.
149+
For Scaleway S3, add the custom endpoint:
127150

128151
```
129152
docker run \
130-
-e ENABLE_S3FS=true \
131-
-e AWS_S3_BUCKET=<your-bucket-name> \
132-
-e AWS_S3_ACCESS_KEY_ID=<your-access-key-id> \
133-
-e AWS_S3_SECRET_ACCESS_KEY=<your-secret-access-key> \
134-
-e AWS_S3_URL="https://s3.<region>.scw.cloud" \
135-
-e S3FS_ARGS="allow_other,use_path_request_style,nocopyapi,parallel_count=15,multipart_size=128" \
153+
-e S3FS_ENABLED=true \
154+
-e AWS_BUCKET=<your-bucket-name> \
155+
-e AWS_ACCESS_KEY_ID=<your-access-key-id> \
156+
-e AWS_SECRET_ACCESS_KEY=<your-secret-access-key> \
157+
-e AWS_ENDPOINT="https://s3.<region>.scw.cloud" \
158+
-e AWS_USE_PATH_STYLE_ENDPOINT=true \
159+
-e S3FS_ALLOW_OTHER=true \
160+
-e S3FS_NO_COPY_API=true \
161+
-e S3FS_PARALLEL_COUNT=15 \
162+
-e S3FS_MULTIPART_SIZE=128 \
136163
-e SFTP_USERS="foo::1001" \
137164
-p 2222:22 -d yieldstudio/sftp
138165
```

0 commit comments

Comments
 (0)