Use manual approach on entrypoint for now

See coop-cloud/peertube#2.
This commit is contained in:
decentral1se 2021-05-06 13:46:41 +02:00
parent a723573bf3
commit 929722d640
Signed by untrusted user who does not match committer: decentral1se
GPG Key ID: 92DAD76BD9567B8A
1 changed files with 4 additions and 22 deletions

View File

@ -2,31 +2,13 @@
set -e set -e
file_env() { # Note(decentral1se): get file_env function back soon
local var="$1" # https://git.autonomic.zone/coop-cloud/peertube/issues/2
local fileVar="${var}_FILE"
local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then export PEERTUBE_DB_PASSWORD=$(cat "$PEERTUBE_DB_PASSWORD_FILE")
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 "PEERTUBE_DB_PASSWORD"
{{ if (env "PEERTUBE_SMTP_ENABLED") }} {{ if (env "PEERTUBE_SMTP_ENABLED") }}
file_env "PEERTUBE_SMTP_PASSWORD" export PEERTUBE_SMTP_PASSWORD=$(cat "$PEERTUBE_SMTP_PASSWORD_FILE")
{{ end }} {{ end }}
# upstream entrypoint # upstream entrypoint