Update parameters
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"aws",
|
||||
"deployer"
|
||||
],
|
||||
"author": "tianjincai <tianjincai@hotmail.com>",
|
||||
"author": "Yunxiao Xu <xuyunxiao2001@gmail.com>",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "tianjincai",
|
||||
@@ -18,10 +18,10 @@
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/JackTJC/hexo-deployer-s3-plus.git"
|
||||
"url": "git+https://git.yunxiao.xyz/YunxiaoXu/hexo-deployer-s3-plus.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/JackTJC/hexo-deployer-s3-plus/issues"
|
||||
"url": "https://git.yunxiao.xyz/YunxiaoXu/hexo-deployer-s3-plus/issues"
|
||||
},
|
||||
"license": {
|
||||
"type": "MIT"
|
||||
|
||||
Reference in New Issue
Block a user