Update parameters

This commit is contained in:
Yunxiao Xu
2025-09-11 16:07:03 -07:00
parent c843a58ca8
commit ed1027e5c9
2 changed files with 18 additions and 6 deletions

View File

@@ -20,6 +20,7 @@ module.exports = async function(args) {
aws_cli_profile,
headers,
delete_removed,
force_path_style,
endpoint,
access_key_id,
secret_access_key,
@@ -27,7 +28,7 @@ module.exports = async function(args) {
aws_secret
} = args;
if (!bucket || !endpoint) {
if (!bucket) {
log.error('Bucket and Endpoint must be configured in _config.yml');
log.info(chalk.bold('--- Generic S3-Compatible Service Example (like Teby, MinIO, Cloudflare R2) ---'));
log.info(' deploy:');
@@ -40,6 +41,7 @@ module.exports = async function(args) {
log.info(' [prefix]: <prefix>');
log.info(' [concurrency]: 20');
log.info(' [delete_removed]: true');
log.info(' [force_path_style]: true');
log.info('');
log.info(chalk.bold('--- AWS S3 Example ---'));
log.info(' deploy:');
@@ -53,10 +55,20 @@ module.exports = async function(args) {
return;
}
const filledRegion = region || 'us-east-1';
const filledEndpoint = endpoint || `https://s3.${filledRegion}.amazonaws.com`;
if (!region) {
log.warn('No region specified. Using default region: us-east-1');
}
if (!endpoint) {
log.warn(`No endpoint specified. Using default AWS S3 endpoint: ${filledEndpoint}`);
}
// --- 2. 创建 S3 客户端 ---
const s3Config = {
region: region || 'us-east-1',
endpoint: endpoint,
region: filledRegion,
endpoint: filledEndpoint,
forcePathStyle: force_path_style !== false, // 默认为 true
};
const keyId = access_key_id || aws_key;