diff options
author | Yukai Huang | 2016-11-16 12:05:24 +0800 |
---|---|---|
committer | Yukai Huang | 2016-11-16 12:05:24 +0800 |
commit | 518a4a120b1fe30953b6b526da1eff826484aee0 (patch) | |
tree | 3cbbc3b19a302404045f9501610434b9d7b80b61 /lib | |
parent | 4d3672ae5d52b781ea1a740142a74ba416833113 (diff) |
upload image to s3
Diffstat (limited to '')
-rw-r--r-- | lib/config.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/config.js b/lib/config.js index 001cc8fa..ecc68f75 100644 --- a/lib/config.js +++ b/lib/config.js @@ -59,6 +59,15 @@ var documentmaxlength = config.documentmaxlength || 100000; // image upload setting, available options are imgur/s3/filesystem var imageUploadType = config.imageUploadType || 'imgur'; +var s3Keys = ['accessKeyId', 'secretAccessKey', 'region']; +config.s3 = config.s3 || {}; +var s3 = s3Keys.reduce(function(prev, cur) { + prev[cur] = config.s3[cur]; + return prev; +}, {}); + +var s3bucket = config.s3.bucket; + // auth var facebook = (process.env.HMD_FACEBOOK_CLIENTID && process.env.HMD_FACEBOOK_CLIENTSECRET) ? { clientID: process.env.HMD_FACEBOOK_CLIENTID, @@ -143,5 +152,7 @@ module.exports = { dropbox: dropbox, google: google, imgur: imgur, - imageUploadType: imageUploadType + imageUploadType: imageUploadType, + s3: s3, + s3bucket: s3bucket }; |