Skip to content

Commit e0265fe

Browse files
committed
feat(workflow): add parameters to determine that s3 enabled SSE
1 parent 89cb370 commit e0265fe

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if [[ "$DATABASE_STORAGE" == "s3" || "$DATABASE_STORAGE" == "minio" ]]; then
66
AWS_ACCESS_KEY_ID=$(cat /var/run/secrets/deis/objectstore/creds/accesskey)
77
AWS_SECRET_ACCESS_KEY=$(cat /var/run/secrets/deis/objectstore/creds/secretkey)
88
if [[ "$DATABASE_STORAGE" == "s3" ]]; then
9+
USE_SSE=$(cat /var/run/secrets/deis/objectstore/creds/use-sse)
910
AWS_REGION=$(cat /var/run/secrets/deis/objectstore/creds/region)
1011
BUCKET_NAME=$(cat /var/run/secrets/deis/objectstore/creds/database-bucket)
1112
# Convert $AWS_REGION into $WALE_S3_ENDPOINT to avoid "Connection reset by peer" from
@@ -17,6 +18,7 @@ if [[ "$DATABASE_STORAGE" == "s3" || "$DATABASE_STORAGE" == "minio" ]]; then
1718
else
1819
echo "https+path://s3-${AWS_REGION}.amazonaws.com:443" > WALE_S3_ENDPOINT
1920
fi
21+
echo $USE_SSE > WALE_S3_SSE
2022
else
2123
AWS_REGION="us-east-1"
2224
BUCKET_NAME="dbwal"

rootfs/patcher-script.d/patch_wal_e_s3.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ def wrap_uri_put_file(creds, uri, fp, content_type=None, conn=None):
77
k = s3_util._uri_to_key(creds, uri, conn=conn)
88
if content_type is not None:
99
k.content_type = content_type
10+
encrypt_key = False
1011
if os.getenv('DATABASE_STORAGE') == 's3':
11-
encrypt_key=True
12-
else:
13-
encrypt_key=False
12+
if os.getenv('WALE_S3_SSE', 'false') == 'true':
13+
encrypt_key = True
1414
k.set_contents_from_file(fp, encrypt_key=encrypt_key)
1515
return k
1616
s3.uri_put_file = wrap_uri_put_file

0 commit comments

Comments
 (0)