Skip to content

Commit 72243e6

Browse files
committed
update s3
1 parent cd94435 commit 72243e6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

config/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ config.development = {
1919
},
2020
// Config for Amazon s3 (https://aws.amazon.com/cn/s3/) storage when storageType value is "s3".
2121
s3: {
22+
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
23+
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
2224
bucketName: process.env.BUCKET_NAME,
2325
region: process.env.REGION,
2426
downloadUrl: process.env.DOWNLOAD_URL, // binary files download host address.

core/utils/common.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ common.uploadFileToS3 = function (key, filePath) {
229229
return (
230230
new Promise((resolve, reject) => {
231231
AWS.config.update({
232+
accessKeyId: _.get(config, 's3.accessKeyId'),
233+
secretAccessKey: _.get(config, 's3.secretAccessKey'),
232234
region: _.get(config, 's3.region')
233235
});
234236
var s3 = new AWS.S3({

0 commit comments

Comments
 (0)