From cd7d527cb162945e1a9e2c83ee2b8dd7de1e9a18 Mon Sep 17 00:00:00 2001 From: Adrien Girardeau Date: Tue, 25 Jul 2017 21:28:00 +0200 Subject: [PATCH 1/3] Add : Adding posibility to change AWS endpoint Configuration available in next commit. --- server/lib/user-aws-s3-post-authenticator.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/lib/user-aws-s3-post-authenticator.js b/server/lib/user-aws-s3-post-authenticator.js index dd63d93..3f275e6 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 () { From 2754587dbe9e3fc08cb3488e7987aebfdbd1bd3d Mon Sep 17 00:00:00 2001 From: Adrien Girardeau Date: Tue, 25 Jul 2017 21:30:17 +0200 Subject: [PATCH 2/3] Fix: respecting existing config value case --- server/lib/user-aws-s3-post-authenticator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/lib/user-aws-s3-post-authenticator.js b/server/lib/user-aws-s3-post-authenticator.js index 3f275e6..d27a219 100644 --- a/server/lib/user-aws-s3-post-authenticator.js +++ b/server/lib/user-aws-s3-post-authenticator.js @@ -28,7 +28,7 @@ class UserAwsS3PostAuthenticator { acl: 'private' } if (config.AWSEndpoint) { - returnValues.endpoint = config.AWSEndpoint + returnValues.endpoint = config.awsEndpoint } return returnValues } From 65a3fd58b6895bb960474ce0d4d19ecc241bf04a Mon Sep 17 00:00:00 2001 From: Adrien Girardeau Date: Tue, 25 Jul 2017 21:31:24 +0200 Subject: [PATCH 3/3] Add: example configuration value for AWS endpoint --- server/config/custom-environment-variables.json | 1 + 1 file changed, 1 insertion(+) 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",*/