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
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local def="${2:-}"
# Note(decentral1se): get file_env function back soon
# https://git.autonomic.zone/coop-cloud/peertube/issues/2
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1
fi
export PEERTUBE_DB_PASSWORD=$(cat "$PEERTUBE_DB_PASSWORD_FILE")
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") }}
file_env "PEERTUBE_SMTP_PASSWORD"
export PEERTUBE_SMTP_PASSWORD=$(cat "$PEERTUBE_SMTP_PASSWORD_FILE")
{{ end }}
# upstream entrypoint