mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 22:54:42 -04:00
make aws s3 endpoint configurable
Signed-off-by: Mathias Merscher <Mathias.Merscher@dg-i.net>
This commit is contained in:
parent
b28201176e
commit
9613197f5d
2 changed files with 5 additions and 2 deletions
|
@ -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}`)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue