Skip to content

Commit 6863e0b

Browse files
author
Matthew Fisher
authored
Merge pull request #171 from bacongobbler/fixup-boto2-bug
fix(setup-envdir): convert AWS_REGION to WALE_S3_ENDPOINT
2 parents 6fb2999 + 758632d commit 6863e0b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

rootfs/docker-entrypoint-initdb.d/001_setup_envdir.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ if [[ "$DATABASE_STORAGE" == "s3" || "$DATABASE_STORAGE" == "minio" ]]; then
88
if [[ "$DATABASE_STORAGE" == "s3" ]]; then
99
AWS_REGION=$(cat /var/run/secrets/deis/objectstore/creds/region)
1010
BUCKET_NAME=$(cat /var/run/secrets/deis/objectstore/creds/database-bucket)
11+
# Convert $AWS_REGION into $WALE_S3_ENDPOINT to avoid "Connection reset by peer" from
12+
# regions other than us-standard.
13+
# See https://github.com/wal-e/wal-e/issues/167
14+
# See https://github.com/boto/boto/issues/2207
15+
if [[ "$AWS_REGION" == "us-east-1" ]]; then
16+
echo "https+path://s3.amazonaws.com:443" > WALE_S3_ENDPOINT
17+
else
18+
echo "https+path://s3-${AWS_REGION}.amazonaws.com:443" > WALE_S3_ENDPOINT
19+
fi
1120
else
1221
AWS_REGION="us-east-1"
1322
BUCKET_NAME="dbwal"

0 commit comments

Comments
 (0)