Support for not specifying an S3 object ACL.

pull/201/head
Richard Rowlands 2023-04-03 16:49:08 -06:00
rodzic eb2ea1bbab
commit c2c56e8500
2 zmienionych plików z 10 dodań i 5 usunięć

Wyświetl plik

@ -52,7 +52,7 @@ Options:
--s3_force_path_style Whether to force path style URLs for S3 objects. (default: false)
--s3_secret_key <secret> S3 secret key, required if --s3_endpoint is set. (default: none)
--s3_signature_version <version> S3 signature version. (default: 4)
--s3_acl <canned-acl> S3 object acl. (default: public-read)
--s3_acl <canned-acl> S3 object acl. Can specify "none" to skip. (default: public-read)
--s3_upload_everything Upload all task results to S3. (default: upload only all.zip archive)
--s3_ignore_ssl Whether to ignore SSL errors while connecting to S3. (default: false)
--max_concurrency <number> Place a cap on the max-concurrency option to use for each task. (default: no limit)

Wyświetl plik

@ -118,12 +118,17 @@ module.exports = {
const filename = path.basename(file.dest);
progress[filename] = 0;
s3.upload({
let uploadCfg = {
Bucket: bucket,
Key: file.dest,
Body: fs.createReadStream(file.src),
ACL: config.s3ACL
}, {partSize, queueSize: concurrency}, err => {
Body: fs.createReadStream(file.src)
}
if (config.s3ACL != "none") {
uploadCfg.ACL = config.s3ACL;
}
s3.upload(uploadCfg, {partSize, queueSize: concurrency}, err => {
if (err){
logger.debug(err);
const msg = `Cannot upload file to S3: ${err.message} (${err.code}), retrying... ${file.retries}`;