Move env var exposing to the top

This commit is contained in:
decentral1se 2021-05-14 17:36:00 +02:00
parent 4149c33b1c
commit 8bd4a3bad0
Signed by: decentral1se
GPG Key ID: 92DAD76BD9567B8A
1 changed files with 11 additions and 7 deletions

View File

@ -1,7 +1,8 @@
#! /bin/bash
# Note(decentral1se): This is a copy/pasta of the upstream entrypoint
# because https://github.com/maxking/docker-mailman/issues/86
# See https://github.com/maxking/docker-mailman/issues/86
# See https://git.autonomic.zone/coop-cloud/mailman3/issues/3
set -e
@ -26,6 +27,15 @@ file_env() {
unset "$fileVar"
}
# Load secrets and expose env vars
file_env "DATABASE_PASSWORD"
file_env "HYPERKITTY_API_KEY"
file_env "MAILMAN_REST_PASSWORD"
export DATABASE_URL="postgres://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}/${DATABASE_NAME}"
# --- upstream entrypoint below ---
function wait_for_postgres () {
# Check if the postgres database is up and accepting connections before
# moving forward.
@ -255,10 +265,4 @@ mailman aliases
# Now chown the places where mailman wants to write stuff.
chown -Rf mailman /opt/mailman
# Load secrets and expose env vars
file_env "DATABASE_PASSWORD"
file_env "HYPERKITTY_API_KEY"
file_env "MAILMAN_REST_PASSWORD"
export DATABASE_URL="postgres://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}/${DATABASE_NAME}"
exec su-exec mailman "$@"