From 0e6fdffeec97e4edaf40590c2a98913e7916e2dd Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Fri, 13 Sep 2024 18:42:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20S3=20=E5=A4=87=E4=BB=BD=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E6=94=AF=E6=8C=81=20Path=20Style=20(#6489)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs #4553 --- backend/utils/cloud_storage/client/s3.go | 6 +++++- frontend/src/lang/modules/en.ts | 1 + frontend/src/lang/modules/tw.ts | 1 + frontend/src/lang/modules/zh.ts | 1 + .../src/views/setting/backup-account/cos/index.vue | 2 +- .../src/views/setting/backup-account/kodo/index.vue | 2 +- .../views/setting/backup-account/minio/index.vue | 2 +- .../src/views/setting/backup-account/oss/index.vue | 2 +- .../src/views/setting/backup-account/s3/index.vue | 13 +++++++++++-- 9 files changed, 23 insertions(+), 7 deletions(-) diff --git a/backend/utils/cloud_storage/client/s3.go b/backend/utils/cloud_storage/client/s3.go index 9fc7ebadd..bcdb00b47 100644 --- a/backend/utils/cloud_storage/client/s3.go +++ b/backend/utils/cloud_storage/client/s3.go @@ -27,12 +27,16 @@ func NewS3Client(vars map[string]interface{}) (*s3Client, error) { if len(scType) == 0 { scType = "Standard" } + mode := loadParamFromVars("mode", vars) + if len(mode) == 0 { + mode = "virtual hosted" + } sess, err := session.NewSession(&aws.Config{ Credentials: credentials.NewStaticCredentials(accessKey, secretKey, ""), Endpoint: aws.String(endpoint), Region: aws.String(region), DisableSSL: aws.Bool(true), - S3ForcePathStyle: aws.Bool(false), + S3ForcePathStyle: aws.Bool(mode == "path"), }) if err != nil { return nil, err diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 15d940f52..3215cd9f7 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -1410,6 +1410,7 @@ const message = { LOCAL: 'Server Disks', OSS: 'Ali OSS', S3: 'Amazon S3', + mode: 'Mode', MINIO: 'MINIO', SFTP: 'SFTP', WebDAV: 'WebDAV', diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index 4ba5e2113..588f17ffb 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -1323,6 +1323,7 @@ const message = { LOCAL: '服務器磁盤', OSS: '阿裏雲 OSS', S3: '亞馬遜 S3 雲存儲', + mode: '模式', MINIO: 'MINIO', SFTP: 'SFTP', WebDAV: 'WebDAV', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index d0c54518d..fa32d2805 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1327,6 +1327,7 @@ const message = { LOCAL: '服务器磁盘', OSS: '阿里云 OSS', S3: '亚马逊 S3 云存储', + mode: '模式', MINIO: 'MINIO', SFTP: 'SFTP', WebDAV: 'WebDAV', diff --git a/frontend/src/views/setting/backup-account/cos/index.vue b/frontend/src/views/setting/backup-account/cos/index.vue index e5c4ce2ba..cefec5356 100644 --- a/frontend/src/views/setting/backup-account/cos/index.vue +++ b/frontend/src/views/setting/backup-account/cos/index.vue @@ -47,7 +47,7 @@