summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/config/environment.js3
-rw-r--r--lib/response.js1
-rw-r--r--lib/web/imageRouter/s3.js4
3 files changed, 6 insertions, 2 deletions
diff --git a/lib/config/environment.js b/lib/config/environment.js
index d2350e72..716f8b75 100644
--- a/lib/config/environment.js
+++ b/lib/config/environment.js
@@ -41,7 +41,8 @@ module.exports = {
s3: {
accessKeyId: process.env.CMD_S3_ACCESS_KEY_ID,
secretAccessKey: process.env.CMD_S3_SECRET_ACCESS_KEY,
- region: process.env.CMD_S3_REGION
+ region: process.env.CMD_S3_REGION,
+ endpoint: process.env.CMD_S3_ENDPOINT
},
minio: {
accessKey: process.env.CMD_MINIO_ACCESS_KEY,
diff --git a/lib/response.js b/lib/response.js
index 1313f9f4..6450bdf5 100644
--- a/lib/response.js
+++ b/lib/response.js
@@ -70,6 +70,7 @@ function showIndex (req, res, next) {
signin: authStatus,
infoMessage: req.flash('info'),
errorMessage: req.flash('error'),
+ imprint: fs.existsSync(path.join(config.docsPath, 'imprint.md')),
privacyStatement: fs.existsSync(path.join(config.docsPath, 'privacy.md')),
termsOfUse: fs.existsSync(path.join(config.docsPath, 'terms-of-use.md')),
deleteToken: deleteToken
diff --git a/lib/web/imageRouter/s3.js b/lib/web/imageRouter/s3.js
index 4effea04..2bf08cc7 100644
--- a/lib/web/imageRouter/s3.js
+++ b/lib/web/imageRouter/s3.js
@@ -43,7 +43,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}`)