Skip to content

Commit

Permalink
Block invalid S3 bucket name
Browse files Browse the repository at this point in the history
RELATED ISSUES

deis/workflow#700
deis/workflow#701 (documentation fix)

Note: this bug also exists for https://github.com/deis/registry/blob/master/rootfs/bin/create-bucket#L27

REPRODUCING THE BUG

Using a period in BUCKET_NAME causes `helm install -f values.yaml deis/workflow --namespace=deis` to fail with this error:
```
ssl.CertificateError: hostname 'deis.subdomain.domain.com-registry.s3-us-west-2.amazonaws.com' doesn't match either of 's3-us-west-2.amazonaws.com', '*.s3-us-west-2.amazonaws.com', 's3.us-west-2.amazonaws.com', '*.s3.us-west-2.amazonaws.com', 's3.dualstack.us-west-2.amazonaws.com', '*.s3.dualstack.us-west-2.amazonaws.com', '*.s3.amazonaws.com'
2017/01/14 07:20:04 Error creating the registry bucket: exit status 1
```

A POSSIBLE FIX

Not sure how to create a test for this (I just started using Deis 4 days ago), but, a hacky test is this:
```
echo "a.bad.thing-mixed-with-a-good-thing" | sed "s/[.]/-/g"
# a-bad-thing-mixed-with-a-good-thing
```

THOUGHTS
  • Loading branch information
greglearns authored Jan 14, 2017
1 parent 1efbb2a commit 49a0042
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rootfs/docker-entrypoint-initdb.d/001_setup_envdir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [[ "$DATABASE_STORAGE" == "s3" || "$DATABASE_STORAGE" == "minio" ]]; then
AWS_SECRET_ACCESS_KEY=$(cat /var/run/secrets/deis/objectstore/creds/secretkey)
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)
BUCKET_NAME=$(cat /var/run/secrets/deis/objectstore/creds/database-bucket | sed "s/[.]/-/g")
# 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
Expand Down

0 comments on commit 49a0042

Please sign in to comment.