Use template parser and quote correctly

This commit is contained in:
decentral1se 2021-06-28 14:03:22 +02:00
parent c13aa2c715
commit 833edf2dc5
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
2 changed files with 4 additions and 6 deletions

View File

@ -43,6 +43,7 @@ configs:
custom_entrypoint:
name: ${STACK_NAME}_custom_entrypoint_${CUSTOM_ENTRYPOINT_VERSION}
file: entrypoint.sh.tmpl
template_driver: golang
secrets:
admin_password:

View File

@ -11,15 +11,12 @@ file_env() {
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"
}
@ -27,9 +24,9 @@ file_env() {
file_env "PASSWORD"
{{ if eq (env "OIDC_ENABLED") "1" }}
echo "auth-openid=1" >> /etc/rstudio/rserver.conf
echo "auth-openid-issuer=${OIDC_ISSUER_URL}" >> /etc/rstudio/rserver.conf
echo "auth-openid-base-uri=https://${DOMAIN}" >> /etc/rstudio/rserver.conf
echo 'auth-openid=1' >> /etc/rstudio/rserver.conf
echo 'auth-openid-issuer={{ env "OIDC_ISSUER_URL"}}' >> /etc/rstudio/rserver.conf
echo 'auth-openid-base-uri=https://{{ env "DOMAIN" }}' >> /etc/rstudio/rserver.conf
{{ end }}
exec "$@"