diff options
author | Max Wu | 2016-11-27 10:54:00 +0800 |
---|---|---|
committer | GitHub | 2016-11-27 10:54:00 +0800 |
commit | bd3d4958e43a8437e45113354059cf41dacda995 (patch) | |
tree | 8b1b08557a7caa516609dbb1f0b1a82d0b47d92a /lib | |
parent | 76a6190dacae691968dc3baa7dd86696ac7bbc1e (diff) | |
parent | 1a4f3950e6d03797beb79c63a3e6f071d8298c17 (diff) |
Merge pull request #248 from hackmdio/file-upload-options
Support other options for image uploading
Diffstat (limited to 'lib')
-rw-r--r-- | lib/config.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/config.js b/lib/config.js index 76b21f0d..a906dfa4 100644 --- a/lib/config.js +++ b/lib/config.js @@ -56,6 +56,17 @@ var heartbeattimeout = config.heartbeattimeout || 10000; // document var documentmaxlength = config.documentmaxlength || 100000; +// image upload setting, available options are imgur/s3/filesystem +var imageUploadType = process.env.HMD_IMAGE_UPLOAD_TYPE || config.imageUploadType || 'imgur'; + +config.s3 = config.s3 || {}; +var s3 = { + accessKeyId: process.env.HMD_S3_ACCESS_KEY_ID || config.s3.accessKeyId, + secretAccessKey: process.env.HMD_S3_SECRET_ACCESS_KEY || config.s3.secretAccessKey, + region: process.env.HMD_S3_REGION || config.s3.region +} +var s3bucket = process.env.HMD_S3_BUCKET || config.s3.bucket; + // auth var facebook = (process.env.HMD_FACEBOOK_CLIENTID && process.env.HMD_FACEBOOK_CLIENTSECRET) ? { clientID: process.env.HMD_FACEBOOK_CLIENTID, @@ -139,5 +150,8 @@ module.exports = { gitlab: gitlab, dropbox: dropbox, google: google, - imgur: imgur + imgur: imgur, + imageUploadType: imageUploadType, + s3: s3, + s3bucket: s3bucket }; |