members.lumbung.space/entrypoint.sh.tmpl

31 lines
525 B
Cheetah
Raw Normal View History

2022-01-10 13:22:33 +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"
}
2022-01-10 15:53:43 +00:00
file_env "NEXTCLOUD_APP_SECRET"
2022-01-10 13:22:33 +00:00
file_env "APP_SECRET_KEY"
2022-01-10 15:20:47 +00:00
file_env "KEYCLOAK_CLIENT_SECRET"
2022-01-10 13:22:33 +00:00
exec "$@"