Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for not specifying an S3 object ACL. #201

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 9 additions & 4 deletions libs/S3.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down