diff --git a/config.js b/config.js index 2accc9e..e42b551 100644 --- a/config.js +++ b/config.js @@ -52,7 +52,7 @@ Options: --s3_force_path_style Whether to force path style URLs for S3 objects. (default: false) --s3_secret_key S3 secret key, required if --s3_endpoint is set. (default: none) --s3_signature_version S3 signature version. (default: 4) - --s3_acl S3 object acl. (default: public-read) + --s3_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 Place a cap on the max-concurrency option to use for each task. (default: no limit) diff --git a/libs/S3.js b/libs/S3.js index 8d18fc3..16db1dc 100644 --- a/libs/S3.js +++ b/libs/S3.js @@ -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}`;