kopia lustrzana https://github.com/OpenDroneMap/NodeODM
Support for not specifying an S3 object ACL.
rodzic
eb2ea1bbab
commit
c2c56e8500
|
@ -52,7 +52,7 @@ Options:
|
||||||
--s3_force_path_style Whether to force path style URLs for S3 objects. (default: false)
|
--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_secret_key <secret> S3 secret key, required if --s3_endpoint is set. (default: none)
|
||||||
--s3_signature_version <version> S3 signature version. (default: 4)
|
--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_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)
|
--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)
|
--max_concurrency <number> Place a cap on the max-concurrency option to use for each task. (default: no limit)
|
||||||
|
|
13
libs/S3.js
13
libs/S3.js
|
@ -118,12 +118,17 @@ module.exports = {
|
||||||
const filename = path.basename(file.dest);
|
const filename = path.basename(file.dest);
|
||||||
progress[filename] = 0;
|
progress[filename] = 0;
|
||||||
|
|
||||||
s3.upload({
|
let uploadCfg = {
|
||||||
Bucket: bucket,
|
Bucket: bucket,
|
||||||
Key: file.dest,
|
Key: file.dest,
|
||||||
Body: fs.createReadStream(file.src),
|
Body: fs.createReadStream(file.src)
|
||||||
ACL: config.s3ACL
|
}
|
||||||
}, {partSize, queueSize: concurrency}, err => {
|
|
||||||
|
if (config.s3ACL != "none") {
|
||||||
|
uploadCfg.ACL = config.s3ACL;
|
||||||
|
}
|
||||||
|
|
||||||
|
s3.upload(uploadCfg, {partSize, queueSize: concurrency}, err => {
|
||||||
if (err){
|
if (err){
|
||||||
logger.debug(err);
|
logger.debug(err);
|
||||||
const msg = `Cannot upload file to S3: ${err.message} (${err.code}), retrying... ${file.retries}`;
|
const msg = `Cannot upload file to S3: ${err.message} (${err.code}), retrying... ${file.retries}`;
|
||||||
|
|
Ładowanie…
Reference in New Issue