支持迁移对象存储到 OSS
This commit is contained in:
@@ -24,6 +24,7 @@ type Config struct {
|
||||
BootstrapAdminPassword string
|
||||
BootstrapAdminNickname string
|
||||
Storage StorageConfig
|
||||
StorageMirror StorageConfig
|
||||
SMS SMSConfig
|
||||
Realname RealnameConfig
|
||||
Log LogConfig
|
||||
@@ -35,6 +36,8 @@ type StorageConfig struct {
|
||||
Bucket string
|
||||
AccessKeyID string
|
||||
SecretAccessKey string
|
||||
Region string
|
||||
BucketLookup string
|
||||
}
|
||||
|
||||
type SMSConfig struct {
|
||||
@@ -91,6 +94,17 @@ func Load() Config {
|
||||
Bucket: getEnv("STORAGE_BUCKET", "hfb-sys"),
|
||||
AccessKeyID: getEnv("STORAGE_ACCESS_KEY_ID", "minioadmin"),
|
||||
SecretAccessKey: getEnv("STORAGE_SECRET_ACCESS_KEY", "minioadmin"),
|
||||
Region: getEnv("STORAGE_REGION", ""),
|
||||
BucketLookup: getEnv("STORAGE_BUCKET_LOOKUP", "auto"),
|
||||
},
|
||||
// StorageMirror 仅在对象存储迁移期间使用。镜像端配置完整时,新上传文件会同步写入两个存储端。
|
||||
StorageMirror: StorageConfig{
|
||||
Endpoint: getEnv("STORAGE_MIRROR_ENDPOINT", ""),
|
||||
Bucket: getEnv("STORAGE_MIRROR_BUCKET", ""),
|
||||
AccessKeyID: getEnv("STORAGE_MIRROR_ACCESS_KEY_ID", ""),
|
||||
SecretAccessKey: getEnv("STORAGE_MIRROR_SECRET_ACCESS_KEY", ""),
|
||||
Region: getEnv("STORAGE_MIRROR_REGION", ""),
|
||||
BucketLookup: getEnv("STORAGE_MIRROR_BUCKET_LOOKUP", "auto"),
|
||||
},
|
||||
SMS: SMSConfig{
|
||||
Provider: getEnv("SMS_PROVIDER", "mock"),
|
||||
|
||||
Reference in New Issue
Block a user