Skip to content

Commit bd56ed6

Browse files
committed
docs: switch example credentials to fill-in placeholders
Adopt a hybrid convention: replace runnable example values with shell-safe placeholders <your-access-key> / <your-secret-key> (quoted inside shell/SDK snippets, bare inside heredoc/compose), so users must substitute their own values, and add openssl rand generation hints and security callouts. Access keys are now placeholders too.
1 parent 19710f3 commit bd56ed6

11 files changed

Lines changed: 49 additions & 46 deletions

File tree

docs/developer/sdk/java.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public class RustfsS3Example {
6767
.region(Region.US_EAST_1) // 可写死,RustFS 不校验 region
6868
.credentialsProvider(
6969
StaticCredentialsProvider.create(
70-
AwsBasicCredentials.create("rustfsadmin", "change-your-password")
70+
AwsBasicCredentials.create("<your-access-key>", "<your-secret-key>")
7171
)
7272
)
7373
.forcePathStyle(true) // 关键配置!RustFS 需启用 Path-Style
@@ -171,7 +171,7 @@ S3Presigner presigner = S3Presigner.builder()
171171
.region(Region.US_EAST_1)
172172
.credentialsProvider(
173173
StaticCredentialsProvider.create(
174-
AwsBasicCredentials.create("rustfsadmin", "change-your-password")
174+
AwsBasicCredentials.create("<your-access-key>", "<your-secret-key>")
175175
)
176176
)
177177
.build();

docs/developer/sdk/javascript.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ npm install @aws-sdk/client-s3 @aws-sdk/s3-request-presigner
2727

2828
```
2929
Endpoint: http://192.168.1.100:9000
30-
Access Key: rustfsadmin
31-
Secret Key: change-your-password
30+
Access Key: <your-access-key>
31+
Secret Key: <your-secret-key>
3232
```
3333

3434
---
@@ -43,8 +43,8 @@ const s3 = new S3Client({
4343
endpoint: "http://192.168.1.100:9000", // RustFS endpoint
4444
region: "us-east-1", // 可随意填写
4545
credentials: {
46-
accessKeyId: "rustfsadmin",
47-
secretAccessKey: "change-your-password",
46+
accessKeyId: "<your-access-key>",
47+
secretAccessKey: "<your-secret-key>",
4848
},
4949
forcePathStyle: true, // 必须启用 Path-style 以兼容 RustFS
5050
requestHandler: new NodeHttpHandler({

docs/developer/sdk/python.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ RustFS 是一款兼容 Amazon S3 协议的对象存储服务,支持通过 Pyth
3131

3232
```
3333
Endpoint: http://192.168.1.100:9000
34-
AccessKey: rustfsadmin
35-
SecretKey: change-your-password
34+
AccessKey: <your-access-key>
35+
SecretKey: <your-secret-key>
3636
```
3737

3838
### 2.2 安装 Boto3
@@ -58,8 +58,8 @@ from botocore.client import Config
5858
s3 = boto3.client(
5959
's3',
6060
endpoint_url='http://192.168.1.100:9000',
61-
aws_access_key_id='rustfsadmin',
62-
aws_secret_access_key='change-your-password',
61+
aws_access_key_id='<your-access-key>',
62+
aws_secret_access_key='<your-secret-key>',
6363
config=Config(signature_version='s3v4'),
6464
region_name='us-east-1'
6565
)

docs/installation/checklists/security-checklists.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ description: "RustFS 安全检查清单(面向企业部署者),RustFS 是
3232
## 3. 环境变量与凭证保护
3333

3434
- **更改默认凭证**
35-
RustFS 初始化时如使用示例账号(如用户名 `rustfsadmin`),必须在部署后将密码更改为随机复杂密码
35+
切勿在生产环境保留示例占位符(`<your-access-key>` / `<your-secret-key>`)。初始化后应立即设置唯一的 access key 和强随机 secret(可用如 `openssl rand -base64 24` 生成)
3636

3737
- **安全存储凭证**
3838
不要将明文密码硬编码在脚本、镜像或日志中。使用环境变量或 Kubernetes Secret 管理密码。

docs/installation/cloud-native/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ RustFS 提供了官方和 [Helm Chart](https://github.com/rustfs/rustfs/tree/mai
1515
| `replicaCount` | 集群的节点数量 | `4`(目前 16 节点正在测试中) |
1616
| `image.repository` | 镜像仓库 | `rustfs/rustfs` |
1717
| `image.tag` | 镜像 tag | `latest` |
18-
| `secret.rustfs.access_key` | RustFS access key | `rustfsadmin` |
19-
| `secret.rustfs.secret_key` | RustFS secret key | `change-your-password` |
18+
| `secret.rustfs.access_key` | RustFS access key | `<your-access-key>` |
19+
| `secret.rustfs.secret_key` | RustFS secret key | `<your-secret-key>` |
2020
| `storageclass.name` | StorageClass 的名称 | `local-path` |
2121
| `storageclass.size` | PVC 大小 | `256Mi`**一定根据自身需求设置好大小**|
2222
| `requests.cpu` | 请求的 CPU 大小 | `100m`**一定根据自身需求设置好大小**|
@@ -60,7 +60,7 @@ NAME CLASS HOSTS ADDRESS PORTS AGE
6060
rustfs nginx your.rustfs.com 10.43.237.152 80, 443 29m
6161
```
6262

63-
使用 `https://your.rustfs.com` 并用上面配置的用户名和密码(本文示例为 `rustfsadmin` / `change-your-password`)登陆安装好的 RustFS 实例。请务必将密码替换为你自己的强密码
63+
使用 `https://your.rustfs.com` 并用上面配置的用户名和密码(`<your-access-key>` / `<your-secret-key>` 占位符)登陆安装好的 RustFS 实例。请用如 `openssl rand -base64 24` 生成强密码,切勿把占位符原样带到生产环境
6464

6565

6666
## 卸载

docs/installation/docker/index.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@ docker run -d \
7070
-p 9000:9000 \
7171
-p 9001:9001 \
7272
-v /mnt/rustfs/data:/data \
73-
-e RUSTFS_ACCESS_KEY=rustfsadmin \
74-
-e RUSTFS_SECRET_KEY=change-your-password \
73+
-e RUSTFS_ACCESS_KEY="<your-access-key>" \
74+
-e RUSTFS_SECRET_KEY="<your-secret-key>" \
7575
-e RUSTFS_CONSOLE_ENABLE=true \
7676
-e RUSTFS_SERVER_DOMAINS=example.com \
7777
rustfs/rustfs:latest \
7878
--address :9000 \
7979
--console-enable \
8080
--server-domains example.com \
81-
--access-key rustfsadmin \
82-
--secret-key change-your-password \
81+
--access-key "<your-access-key>" \
82+
--secret-key "<your-secret-key>" \
8383
/data
8484
```
8585

@@ -89,17 +89,17 @@ docker run -d \
8989
```bash
9090
-e RUSTFS_ADDRESS=:9000 \
9191
-e RUSTFS_SERVER_DOMAINS=example.com \
92-
-e RUSTFS_ACCESS_KEY=rustfsadmin \
93-
-e RUSTFS_SECRET_KEY=change-your-password \
92+
-e RUSTFS_ACCESS_KEY="<your-access-key>" \
93+
-e RUSTFS_SECRET_KEY="<your-secret-key>" \
9494
-e RUSTFS_CONSOLE_ENABLE=true \
9595
```
9696

9797
2. **命令行参数方式**:
9898
```
9999
--address :9000 \
100100
--server-domains example.com \
101-
--access-key rustfsadmin \
102-
--secret-key change-your-password \
101+
--access-key "<your-access-key>" \
102+
--secret-key "<your-secret-key>" \
103103
--console-enable \
104104
```
105105

@@ -136,11 +136,11 @@ docker run -d \
136136
-p 9000:9000 \
137137
-p 9001:9001 \
138138
-v /mnt/data:/data \
139-
-e RUSTFS_ACCESS_KEY=rustfsadmin \
140-
-e RUSTFS_SECRET_KEY=change-your-password \
139+
-e RUSTFS_ACCESS_KEY="<your-access-key>" \
140+
-e RUSTFS_SECRET_KEY="<your-secret-key>" \
141141
rustfs/rustfs:latest \
142-
--access-key rustfsadmin \
143-
--secret-key change-your-password \
142+
--access-key "<your-access-key>" \
143+
--secret-key "<your-secret-key>" \
144144
/data
145145
```
146146

@@ -207,7 +207,7 @@ CONTAINER ID IMAGE COMMAND
207207
e07121ecdd39 rustfs/rustfs:latest "/entrypoint.sh rust…" 2 seconds ago Up 1 second (health: starting) 0.0.0.0:9000-9001->9000-9001/tcp, :::9000-9001->9000-9001/tcp rustfs-server
208208
```
209209

210-
不管是单独启动 `rustfs-server` 还是和可观测性的服务一起启动,对于 RustFS 实例的访问都是通过 `http://localhost:9000`,并使用上面配置的 access key 和 secret key 登录(本文示例为用户名 `rustfsadmin`、密码 `change-your-password`)。请务必将密码替换为你自己的强密码
210+
不管是单独启动 `rustfs-server` 还是和可观测性的服务一起启动,对于 RustFS 实例的访问都是通过 `http://localhost:9000`,并使用上面配置的 access key 和 secret key 登录(`<your-access-key>` / `<your-secret-key>` 占位符)。请用如 `openssl rand -base64 24` 生成强密码,切勿把占位符原样带到生产环境
211211

212212
### 部署示例
213213

@@ -249,8 +249,8 @@ services:
249249
- RUSTFS_CORS_ALLOWED_ORIGINS=*
250250
- RUSTFS_CONSOLE_CORS_ALLOWED_ORIGINS=*
251251
# 访问密钥(生产环境请修改为强密码)
252-
- RUSTFS_ACCESS_KEY=rustfsadmin
253-
- RUSTFS_SECRET_KEY=change-your-password
252+
- RUSTFS_ACCESS_KEY=<your-access-key>
253+
- RUSTFS_SECRET_KEY=<your-secret-key>
254254
# 日志级别
255255
- RUSTFS_OBS_LOGGER_LEVEL=info
256256

@@ -435,12 +435,12 @@ nginx -t && nginx -s reload
435435
```
436436
https://console.example.com
437437
```
438-
使用账号密码登录(本文示例为用户名 `rustfsadmin`、密码 `change-your-password`
438+
使用账号密码登录(`<your-access-key>` / `<your-secret-key>` 占位符,请替换为你自己的值
439439

440440
2. **测试 S3 API**
441441
```bash
442442
# 使用 mc 客户端
443-
mc alias set myrustfs https://s3.example.com rustfsadmin change-your-password
443+
mc alias set myrustfs https://s3.example.com "<your-access-key>" "<your-secret-key>"
444444
mc mb myrustfs/test-bucket
445445
mc ls myrustfs
446446
```
@@ -481,7 +481,7 @@ nginx -t && nginx -s reload
481481
使用 `mc` 或其他 S3 客户端:
482482

483483
```bash
484-
mc alias set rustfs http://localhost:9000 rustfsadmin change-your-password
484+
mc alias set rustfs http://localhost:9000 "<your-access-key>" "<your-secret-key>"
485485
mc mb rustfs/mybucket
486486
mc ls rustfs
487487
```

docs/installation/linux/multiple-node-multiple-disk.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,9 @@ mv rustfs /usr/local/bin/
249249
```bash
250250
# 多机多盘模式
251251
sudo tee /etc/default/rustfs <<EOF
252-
RUSTFS_ACCESS_KEY=rustfsadmin
253-
RUSTFS_SECRET_KEY=change-your-password
252+
# 请替换下面的占位符;可用如 openssl rand -base64 24 生成强密码
253+
RUSTFS_ACCESS_KEY=<your-access-key>
254+
RUSTFS_SECRET_KEY=<your-secret-key>
254255
RUSTFS_VOLUMES="http://node{1...4}:9000/data/rustfs{0...3}"
255256
RUSTFS_ADDRESS=":9000"
256257
RUSTFS_CONSOLE_ENABLE=true

docs/installation/linux/single-node-multiple-disk.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,9 @@ mv rustfs /usr/local/bin/
225225
```bash
226226
# 单机多盘模式
227227
sudo tee /etc/default/rustfs <<EOF
228-
RUSTFS_ACCESS_KEY=rustfsadmin
229-
RUSTFS_SECRET_KEY=change-your-password
228+
# 请替换下面的占位符;可用如 openssl rand -base64 24 生成强密码
229+
RUSTFS_ACCESS_KEY=<your-access-key>
230+
RUSTFS_SECRET_KEY=<your-secret-key>
230231
RUSTFS_VOLUMES="/data/rustfs{0...3}"
231232
RUSTFS_ADDRESS=":9000"
232233
RUSTFS_CONSOLE_ENABLE=true

docs/installation/linux/single-node-single-disk.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,9 @@ mv rustfs /usr/local/bin/
220220
```bash
221221
# 单机单盘模式
222222
sudo tee /etc/default/rustfs <<EOF
223-
RUSTFS_ACCESS_KEY=rustfsadmin
224-
RUSTFS_SECRET_KEY=change-your-password
223+
# 请替换下面的占位符;可用如 openssl rand -base64 24 生成强密码
224+
RUSTFS_ACCESS_KEY=<your-access-key>
225+
RUSTFS_SECRET_KEY=<your-secret-key>
225226
RUSTFS_VOLUMES="/data/rustfs0"
226227
RUSTFS_ADDRESS=":9000"
227228
RUSTFS_CONSOLE_ENABLE=true

docs/integration/milvus.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ Milvus 官方提供 [`docker-compose.yml`](https://github.com/milvus-io/milvus/b
3838
- RUSTFS_EXTERNAL_ADDRESS=:9000
3939
- RUSTFS_CORS_ALLOWED_ORIGINS=*
4040
- RUSTFS_CONSOLE_CORS_ALLOWED_ORIGINS=*
41-
- RUSTFS_ACCESS_KEY=rustfsadmin
42-
- RUSTFS_SECRET_KEY=change-your-password
41+
- RUSTFS_ACCESS_KEY=<your-access-key>
42+
- RUSTFS_SECRET_KEY=<your-secret-key>
4343
ports:
4444
- "9000:9000" # S3 API port
4545
- "9001:9001" # Console port
@@ -95,8 +95,8 @@ minio 的信息(包括地址、access_key、access_secret 等)都写在 [`mi
9595
rustfs:
9696
address: localhost:9000
9797
port: 9000
98-
accessKeyID: rustfsadmin
99-
secretAccessKey: change-your-password
98+
accessKeyID: <your-access-key>
99+
secretAccessKey: <your-secret-key>
100100
useSSL: false
101101
bucketName: "rustfs-bucket"
102102
```

0 commit comments

Comments
 (0)