From c69615b3b645116c3e8cc4346741298d7b09545d Mon Sep 17 00:00:00 2001 From: kealuya Date: Sun, 25 Jan 2026 18:23:14 +0800 Subject: [PATCH] Description: (#393) Added support for virtual-host style access for Huawei Cloud OBS. This is achieved by introducing the AWS_S3_BUCKET_LOOKUP environment variable and adding the s3.bucket-lookup=dns option to the parameters. Changes: Set AWS_S3_BUCKET_LOOKUP environment variable. Included s3.bucket-lookup=dns in the S3 configuration options to ensure compatibility with Huawei OBS DNS-based bucket addressing. --- app/server/utils/restic.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/server/utils/restic.ts b/app/server/utils/restic.ts index 30366f20..88bbd6ae 100644 --- a/app/server/utils/restic.ts +++ b/app/server/utils/restic.ts @@ -133,6 +133,11 @@ export const buildEnv = async (config: RepositoryConfig, organizationId: string) case "s3": env.AWS_ACCESS_KEY_ID = await cryptoUtils.resolveSecret(config.accessKeyId); env.AWS_SECRET_ACCESS_KEY = await cryptoUtils.resolveSecret(config.secretAccessKey); + + // Huawei OBS requires virtual-hosted style access + if (config.endpoint.includes("myhuaweicloud")) { + env.AWS_S3_BUCKET_LOOKUP = "dns"; + } break; case "r2": env.AWS_ACCESS_KEY_ID = await cryptoUtils.resolveSecret(config.accessKeyId); @@ -955,6 +960,10 @@ export const addCommonArgs = ( args.push("-o", `sftp.args=${env._SFTP_SSH_ARGS}`); } + if (env.AWS_S3_BUCKET_LOOKUP === "dns") { + args.push("-o", "s3.bucket-lookup=dns"); + } + if (env._INSECURE_TLS === "true") { args.push("--insecure-tls"); }