refactor: unify credential env constants and deploy env usage (#2821)

Co-authored-by: Henry Guo <marshawcoco@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: loverustfs <hello@rustfs.com>
Co-authored-by: 安正超 <anzhengchao@gmail.com>
This commit is contained in:
houseme
2026-05-06 12:30:29 +08:00
committed by GitHub
parent 090d60e00a
commit 3dd0692917
11 changed files with 153 additions and 57 deletions
+4 -9
View File
@@ -16,18 +16,13 @@ Group=rustfs
# working directory
WorkingDirectory=/opt/rustfs
# environment variable configuration and main program (Option 1: Directly specify arguments)
Environment=RUSTFS_ACCESS_KEY=rustfsadmin
Environment=RUSTFS_SECRET_KEY=rustfsadmin
ExecStart=/usr/local/bin/rustfs \
--address 0.0.0.0:9000 \
--volumes /data/rustfs/vol1,/data/rustfs/vol2 \
--console-enable
# environment variable configuration and main program (single active ExecStart).
# Credentials are loaded from /etc/default/rustfs below. Replace the sample values before deployment.
# environment variable configuration (Option 2: Use environment variables)
# rustfs example file see: `../config/rustfs.env`
EnvironmentFile=-/etc/default/rustfs
ExecStart=/usr/local/bin/rustfs $RUSTFS_VOLUMES $RUSTFS_OPTS
EnvironmentFile=/etc/default/rustfs
ExecStart=/usr/local/bin/rustfs $RUSTFS_VOLUMES
# service log configuration
LogsDirectory=rustfs
+14 -14
View File
@@ -1,23 +1,23 @@
# RustFS administrator username
RUSTFS_ROOT_USER=rustfsadmin
# RustFS administrator password
RUSTFS_ROOT_PASSWORD=rustfsadmin
# RustFS administrator access key. Replace before deployment; do not use public defaults.
RUSTFS_ACCESS_KEY=REPLACE_WITH_UNIQUE_ACCESS_KEY
# RustFS administrator secret key. Replace before deployment; do not use public defaults.
RUSTFS_SECRET_KEY=REPLACE_WITH_UNIQUE_SECRET_KEY
# RustFS data volume storage paths.
# Data volume configuration example path: deploy/data/rustfs.env
# RustFS data volume storage paths, supports multiple volumes from vol1 to vol4
RUSTFS_VOLUMES="./deploy/deploy/vol{1...4}"
# RustFS service startup parameters, specifying listen address and port
RUSTFS_OPTS="--address :9000"
RUSTFS_VOLUMES="./deploy/data/vol{1...4}"
# RustFS service listen address and port
RUSTFS_ADDRESS=":9000"
RUSTFS_ADDRESS=0.0.0.0:9000
# Enable RustFS console functionality
RUSTFS_CONSOLE_ENABLE=true
# RustFS service domain configuration
RUSTFS_SERVER_DOMAINS=127.0.0.1:9000
# RustFS license content
RUSTFS_LICENSE="license content"
# RustFS console listen address and port
RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9001
# Optional service domain configuration for virtual-hosted-style requests (comma-separated).
# RUSTFS_SERVER_DOMAINS=s3.example.com
# Optional RustFS license content
# RUSTFS_LICENSE=REPLACE_WITH_LICENSE_CONTENT
# Observability configuration endpoint: RUSTFS_OBS_ENDPOINT
RUSTFS_OBS_ENDPOINT=http://localhost:4318
# TLS certificates directory path: deploy/certs
# Optional TLS certificates directory path: deploy/certs
RUSTFS_TLS_PATH=/etc/default/tls