From 089bf3e0846bc2195300d762ae90a8499177718e Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 10 Jul 2018 14:17:37 +0100 Subject: [PATCH] seperate the standard s3 creds from the bucket s3 creds --- services/filestore/app/coffee/BucketController.coffee | 2 +- services/filestore/config/settings.defaults.coffee | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/services/filestore/app/coffee/BucketController.coffee b/services/filestore/app/coffee/BucketController.coffee index 81c660ec69..bb7bd4544b 100644 --- a/services/filestore/app/coffee/BucketController.coffee +++ b/services/filestore/app/coffee/BucketController.coffee @@ -9,7 +9,7 @@ module.exports = BucketController = getFile: (req, res)-> {bucket} = req.params key = req.params[0] - credentials = settings.filestore.s3?[bucket] + credentials = settings.filestore.s3BucketCreds?[bucket] options = { key: key, bucket: bucket, diff --git a/services/filestore/config/settings.defaults.coffee b/services/filestore/config/settings.defaults.coffee index 62d42cf9e3..59f5d8a0a6 100644 --- a/services/filestore/config/settings.defaults.coffee +++ b/services/filestore/config/settings.defaults.coffee @@ -28,11 +28,14 @@ module.exports = # s3: # key: "" # default # secret: "" # default + # + # s3BucketCreds: # bucketname1: # secrets for bucketname1 # auth_key: "" # auth_secret: "" # bucketname2: # secrets for bucketname2... - s3: JSON.parse process.env['S3_CREDENTIALS'] if process.env['S3_CREDENTIALS'] + + s3BucketCreds: JSON.parse process.env['S3_BUCKET_CREDENTIALS'] if process.env['S3_BUCKET_CREDENTIALS'] path: uploadFolder: Path.resolve(__dirname + "/../uploads")