feat(media): add MinIO storage switch and HTTPS OSS endpoint
This commit is contained in:
+5
-4
@@ -281,17 +281,17 @@ func resolveMediaHandlerConfig(config *mediaConfig) (string, string, error) {
|
||||
conf = string(params)
|
||||
}
|
||||
}
|
||||
if handler == "oss" {
|
||||
ossConf, err := ensureOSSUsesSysConfig(conf)
|
||||
if handler == "oss" || handler == "minio" {
|
||||
storageConf, err := ensureObjectStorageUsesSysConfig(conf, handler)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
return handler, ossConf, nil
|
||||
return handler, storageConf, nil
|
||||
}
|
||||
return handler, conf, nil
|
||||
}
|
||||
|
||||
func ensureOSSUsesSysConfig(conf string) (string, error) {
|
||||
func ensureObjectStorageUsesSysConfig(conf, provider string) (string, error) {
|
||||
params := map[string]any{}
|
||||
if strings.TrimSpace(conf) != "" {
|
||||
if err := json.Unmarshal([]byte(conf), ¶ms); err != nil {
|
||||
@@ -299,6 +299,7 @@ func ensureOSSUsesSysConfig(conf string) (string, error) {
|
||||
}
|
||||
}
|
||||
params["use_sys_config"] = true
|
||||
params["provider"] = provider
|
||||
encoded, err := json.Marshal(params)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
||||
Reference in New Issue
Block a user