Skip to content

Commit

Permalink
Merge pull request #171 from bacongobbler/fixup-boto2-bug
Browse files Browse the repository at this point in the history
fix(setup-envdir): convert AWS_REGION to WALE_S3_ENDPOINT
  • Loading branch information
Matthew Fisher authored Nov 30, 2016
2 parents 6fb2999 + 758632d commit 6863e0b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rootfs/docker-entrypoint-initdb.d/001_setup_envdir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ if [[ "$DATABASE_STORAGE" == "s3" || "$DATABASE_STORAGE" == "minio" ]]; then
if [[ "$DATABASE_STORAGE" == "s3" ]]; then
AWS_REGION=$(cat /var/run/secrets/deis/objectstore/creds/region)
BUCKET_NAME=$(cat /var/run/secrets/deis/objectstore/creds/database-bucket)
# Convert $AWS_REGION into $WALE_S3_ENDPOINT to avoid "Connection reset by peer" from
# regions other than us-standard.
# See https://github.com/wal-e/wal-e/issues/167
# See https://github.com/boto/boto/issues/2207
if [[ "$AWS_REGION" == "us-east-1" ]]; then
echo "https+path://s3.amazonaws.com:443" > WALE_S3_ENDPOINT
else
echo "https+path://s3-${AWS_REGION}.amazonaws.com:443" > WALE_S3_ENDPOINT
fi
else
AWS_REGION="us-east-1"
BUCKET_NAME="dbwal"
Expand Down

0 comments on commit 6863e0b

Please sign in to comment.