diff --git a/entrypoint.core.sh.tmpl b/entrypoint.core.sh.tmpl index a445d92..13136fd 100644 --- a/entrypoint.core.sh.tmpl +++ b/entrypoint.core.sh.tmpl @@ -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 "$@"