diff --git a/server/config/custom-environment-variables.json b/server/config/custom-environment-variables.json index 69ea64b..2795b2e 100644 --- a/server/config/custom-environment-variables.json +++ b/server/config/custom-environment-variables.json @@ -3,6 +3,7 @@ "awsSecretAccessKey": "AWS_SECRET_ACCESS_KEY", "awsRegion": "AWS_REGION", "awsS3Bucket": "AWS_S3_BUCKET", + /*"awsEndpoint": "http://127.0.0.1:9000",*/ /*"apiVersion": "0",*/ /*"categoryIdBookmarks": "0",*/ /*"categoryIdHistorySites": "1",*/ diff --git a/server/lib/user-aws-s3-post-authenticator.js b/server/lib/user-aws-s3-post-authenticator.js index dd63d93..d27a219 100644 --- a/server/lib/user-aws-s3-post-authenticator.js +++ b/server/lib/user-aws-s3-post-authenticator.js @@ -21,12 +21,16 @@ class UserAwsS3PostAuthenticator { const policySignature = crypto.createHmac('sha1', config.awsSecretAccessKey) .update(s3PostPolicy) .digest('base64') - return { + const returnValues = { AWSAccessKeyId: config.awsAccessKeyId, policy: s3PostPolicy, signature: policySignature, acl: 'private' } + if (config.AWSEndpoint) { + returnValues.endpoint = config.awsEndpoint + } + return returnValues } expirationDate () {