This repository has been archived on 2021-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
mailman3/entrypoint.web.sh.tmpl

34 lines
683 B
Cheetah
Raw Normal View History

2020-11-10 12:05:22 +00:00
#!/bin/bash
set -eu
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi
export "$var"="$val"
unset "$fileVar"
}
file_env "DATABASE_PASSWORD"
file_env "HYPERKITTY_API_KEY"
file_env "MAILMAN_REST_PASSWORD"
2021-05-14 14:57:09 +00:00
file_env "SECRET_KEY"
2020-11-10 12:05:22 +00:00
export DATABASE_URL="postgres://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}/${DATABASE_NAME}"
2021-05-14 14:28:51 +00:00
/usr/local/bin/docker-entrypoint.sh "$@"