diff --git a/compose.yml b/compose.yml index d1d6d59..e2100fa 100644 --- a/compose.yml +++ b/compose.yml @@ -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: diff --git a/entrypoint.sh.tmpl b/entrypoint.sh.tmpl index ca00200..ac29a1a 100644 --- a/entrypoint.sh.tmpl +++ b/entrypoint.sh.tmpl @@ -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 "$@"