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.
This commit is contained in:
kealuya 2026-01-25 18:23:14 +08:00 committed by GitHub
parent ba8b599059
commit c69615b3b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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");
}