mirror of
https://github.com/rustfs/rustfs.git
synced 2026-05-06 22:28:16 +08:00
test(credentials): avoid printing default secret (#2820)
Signed-off-by: houseme <housemecn@gmail.com> Co-authored-by: houseme <housemecn@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:
@@ -66,7 +66,7 @@ mod tests {
|
|||||||
|
|
||||||
// In production environment, access key and secret key should be different
|
// In production environment, access key and secret key should be different
|
||||||
// These are default values, so being the same is acceptable, but should be warned in documentation
|
// These are default values, so being the same is acceptable, but should be warned in documentation
|
||||||
println!("Warning: Default access key and secret key are the same. Change them in production!");
|
assert_eq!(DEFAULT_ACCESS_KEY, DEFAULT_SECRET_KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -74,10 +74,8 @@ mod tests {
|
|||||||
// Test security best practices
|
// Test security best practices
|
||||||
|
|
||||||
// These are default values, should be changed in production environments
|
// These are default values, should be changed in production environments
|
||||||
println!("Security Warning: Default credentials detected!");
|
assert_eq!(DEFAULT_ACCESS_KEY, "rustfsadmin");
|
||||||
println!("Access Key: {DEFAULT_ACCESS_KEY}");
|
assert_eq!(DEFAULT_SECRET_KEY, "rustfsadmin");
|
||||||
println!("Secret Key: {DEFAULT_SECRET_KEY}");
|
|
||||||
println!("These should be changed in production environments!");
|
|
||||||
|
|
||||||
// Verify that key lengths meet minimum security requirements
|
// Verify that key lengths meet minimum security requirements
|
||||||
assert!(DEFAULT_ACCESS_KEY.len() >= 8, "Access key should be at least 8 characters");
|
assert!(DEFAULT_ACCESS_KEY.len() >= 8, "Access key should be at least 8 characters");
|
||||||
|
|||||||
@@ -16,8 +16,12 @@ Group=rustfs
|
|||||||
# working directory
|
# working directory
|
||||||
WorkingDirectory=/opt/rustfs
|
WorkingDirectory=/opt/rustfs
|
||||||
|
|
||||||
# environment variable configuration and main program (single active ExecStart).
|
# environment variable configuration and main program (Option 1: Directly specify arguments)
|
||||||
# Credentials are loaded from /etc/default/rustfs below. Replace the sample values before deployment.
|
# Credentials are loaded from /etc/default/rustfs below. Replace the sample values before deployment.
|
||||||
|
ExecStart=/usr/local/bin/rustfs \
|
||||||
|
--address 0.0.0.0:9000 \
|
||||||
|
--volumes /data/rustfs/vol1,/data/rustfs/vol2 \
|
||||||
|
--console-enable
|
||||||
|
|
||||||
# environment variable configuration (Option 2: Use environment variables)
|
# environment variable configuration (Option 2: Use environment variables)
|
||||||
# rustfs example file see: `../config/rustfs.env`
|
# rustfs example file see: `../config/rustfs.env`
|
||||||
|
|||||||
Reference in New Issue
Block a user