modify entrypoint file to work using sh instead of bash, rtfm
This commit is contained in:
parent
81ca7f52d0
commit
726097711e
@ -1,27 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
if [ -f /run/secrets/oidc_secret ]; then
|
||||
export GTS_OIDC_CLIENT_SECRET=$(cat /run/secrets/oidc_secret)
|
||||
else
|
||||
echo "OIDC secret not found, skipping."
|
||||
fi
|
||||
|
||||
file_env() {
|
||||
local var="$1"
|
||||
local fileVar="${var}_FILE"
|
||||
local def="${2:-}"
|
||||
if [ -f /run/secrets/smtp_password ]; then
|
||||
export GTS_SMTP_PASSWORD=$(cat /run/secrets/smtp_password)
|
||||
else
|
||||
echo "SMTP password secret not found, skipping."
|
||||
fi
|
||||
|
||||
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 "GTS_OIDC_CLIENT_SECRET"
|
||||
file_env "GTS_SMTP_PASSWORD"
|
||||
/gotosocial/gotosocial server start
|
Loading…
Reference in New Issue
Block a user