Skip to content

Commit 4c2868e

Browse files
authored
Merge pull request #201 from terraframe/upstream-rebase
Support for not specifying an S3 object ACL.
2 parents eb2ea1b + c2c56e8 commit 4c2868e

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

config.js

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

libs/S3.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,17 @@ module.exports = {
118118
const filename = path.basename(file.dest);
119119
progress[filename] = 0;
120120

121-
s3.upload({
121+
let uploadCfg = {
122122
Bucket: bucket,
123123
Key: file.dest,
124-
Body: fs.createReadStream(file.src),
125-
ACL: config.s3ACL
126-
}, {partSize, queueSize: concurrency}, err => {
124+
Body: fs.createReadStream(file.src)
125+
}
126+
127+
if (config.s3ACL != "none") {
128+
uploadCfg.ACL = config.s3ACL;
129+
}
130+
131+
s3.upload(uploadCfg, {partSize, queueSize: concurrency}, err => {
127132
if (err){
128133
logger.debug(err);
129134
const msg = `Cannot upload file to S3: ${err.message} (${err.code}), retrying... ${file.retries}`;

0 commit comments

Comments
 (0)