parent
a723573bf3
commit
929722d640
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user