minio .env access adjustment
This commit is contained in:
parent
b06b8645cf
commit
e689f34212
|
|
@ -491,10 +491,36 @@ func (c *Config) loadEnv() error {
|
|||
c.MinIO.Enabled = true
|
||||
}
|
||||
c.MinIO.Endpoint = os.Getenv("MINIO_ENDPOINT")
|
||||
// New env var names (preferred)
|
||||
// - MINIO_ROOT_USER
|
||||
// - MINIO_ROOT_PASSWORD
|
||||
// - MINIO_BUCKET_NAME
|
||||
//
|
||||
// Backward compatible fallbacks:
|
||||
// - MINIO_ACCESS_KEY / MINIO_SECRET_KEY / MINIO_BUCKET
|
||||
rootUser := os.Getenv("MINIO_ROOT_USER")
|
||||
rootPass := os.Getenv("MINIO_ROOT_PASSWORD")
|
||||
bucketName := os.Getenv("MINIO_BUCKET_NAME")
|
||||
|
||||
if rootUser != "" {
|
||||
c.MinIO.AccessKey = rootUser
|
||||
} else {
|
||||
c.MinIO.AccessKey = os.Getenv("MINIO_ACCESS_KEY")
|
||||
}
|
||||
|
||||
if rootPass != "" {
|
||||
c.MinIO.SecretKey = rootPass
|
||||
} else {
|
||||
c.MinIO.SecretKey = os.Getenv("MINIO_SECRET_KEY")
|
||||
}
|
||||
|
||||
if bucketName != "" {
|
||||
c.MinIO.Bucket = bucketName
|
||||
} else {
|
||||
c.MinIO.Bucket = os.Getenv("MINIO_BUCKET")
|
||||
if c.MinIO.Bucket == "" {
|
||||
}
|
||||
|
||||
if strings.TrimSpace(c.MinIO.Bucket) == "" {
|
||||
c.MinIO.Bucket = "yimaru"
|
||||
}
|
||||
minioUseSSL := os.Getenv("MINIO_USE_SSL")
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user