From 8bd4a3bad095fad2b45efba4d77b288d61c6d306 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Fri, 14 May 2021 17:36:00 +0200 Subject: [PATCH] Move env var exposing to the top --- entrypoint.core.sh.tmpl | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) 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 "$@"