forked from supabase/postgres
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·36 lines (31 loc) · 1.15 KB
/
Copy pathentrypoint.sh
File metadata and controls
executable file
·36 lines (31 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
set -eou pipefail
PG_CONF=/etc/postgresql/postgresql.conf
if [ "${S3_ENABLED:-}" == "true" ]; then
echo "Enabling OrioleDB S3 Backend..."
echo "
archive_mode = on
archive_library = 'orioledb'
max_worker_processes = 50 # should fit orioledb.s3_num_workers as long as other workers
orioledb.s3_num_workers = 20 # should be enough for comfortable work
orioledb.s3_mode = true
orioledb.s3_host = '$S3_HOST' # replace with your bucket URL, accelerated buckets are recommended
orioledb.s3_region = '$S3_REGION' # replace with your S3 region
orioledb.s3_accesskey = '$S3_ACCESS_KEY' # replace with your S3 key
orioledb.s3_secretkey = '$S3_SECRET_KEY' # replace with your S3 secret key
" >> "$PG_CONF"
else
echo "Disabling OrioleDB S3 Backend..."
sed -i \
-e "/^archive_mode = on/d" \
-e "/^archive_library = 'orioledb'/d" \
-e "/^max_worker_processes = 50/d" \
-e "/^orioledb.s3_num_workers = /d" \
-e "/^orioledb.s3_mode = /d" \
-e "/^orioledb.s3_host = /d" \
-e "/^orioledb.s3_region = /d" \
-e "/^orioledb.s3_accesskey = /d" \
-e "/^orioledb.s3_secretkey = /d" \
"$PG_CONF"
fi
orioledb-entrypoint.sh "$@"