Skip to content

Commit 34e3648

Browse files
committed
feat(wal-e): add WALE_S3_SSE environment variable
1 parent 336b7d8 commit 34e3648

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ if [[ "$DATABASE_STORAGE" == "s3" || "$DATABASE_STORAGE" == "minio" ]]; then
1717
else
1818
echo "https+path://s3-${AWS_REGION}.amazonaws.com:443" > WALE_S3_ENDPOINT
1919
fi
20+
if [[ $S3_SSE ]]; then
21+
echo $S3_SSE > WALE_S3_SSE
22+
else
23+
echo "false" > WALE_S3_SSE
24+
fi
2025
else
2126
AWS_REGION="us-east-1"
2227
BUCKET_NAME="dbwal"

rootfs/patcher-script.d/patch_wal_e_s3.py

+3-3
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)