summaryrefslogtreecommitdiff
path: root/lib/web/imageRouter
diff options
context:
space:
mode:
authorMathias Merscher2019-02-11 17:31:45 +0100
committerMathias Merscher2019-02-11 17:45:24 +0100
commit9613197f5d26efd699a00e322dc12a862ea3417b (patch)
treec419f0fe34f449c3b5e031ac44d52bfb30cf42d2 /lib/web/imageRouter
parentb28201176ed522c6a57f6fcb7d0885807badfdf4 (diff)
make aws s3 endpoint configurable
Signed-off-by: Mathias Merscher <Mathias.Merscher@dg-i.net>
Diffstat (limited to 'lib/web/imageRouter')
-rw-r--r--lib/web/imageRouter/s3.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/web/imageRouter/s3.js b/lib/web/imageRouter/s3.js
index 626fe148..f2a5a5df 100644
--- a/lib/web/imageRouter/s3.js
+++ b/lib/web/imageRouter/s3.js
@@ -42,7 +42,9 @@ exports.uploadImage = function (imagePath, callback) {
}
let s3Endpoint = 's3.amazonaws.com'
- if (config.s3.region && config.s3.region !== 'us-east-1') {
+ if (config.s3.endpoint) {
+ s3Endpoint = config.s3.endpoint
+ } else if (config.s3.region && config.s3.region !== 'us-east-1') {
s3Endpoint = `s3-${config.s3.region}.amazonaws.com`
}
callback(null, `https://${s3Endpoint}/${config.s3bucket}/${params.Key}`)