From 8026e22d2e28054e2a060b1346a322a5d79f89da Mon Sep 17 00:00:00 2001 From: Tobias McNulty Date: Tue, 9 Jan 2024 13:50:26 -0500 Subject: [PATCH] add variables for ENKETO_URL and PYXFORM_* --- docker-compose.yml | 3 +++ files/service/config.json.template | 6 +++--- files/service/scripts/start-odk.sh | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ed3460e2..94b1e784 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -64,10 +64,13 @@ services: - EMAIL_IGNORE_TLS=${EMAIL_IGNORE_TLS:-true} - EMAIL_USER=${EMAIL_USER:-} - EMAIL_PASSWORD=${EMAIL_PASSWORD:-} + - ENKETO_URL=${ENKETO_URL:-http://enketo:8005/-} - OIDC_ENABLED=${OIDC_ENABLED:-false} - OIDC_ISSUER_URL=${OIDC_ISSUER_URL:-} - OIDC_CLIENT_ID=${OIDC_CLIENT_ID:-} - OIDC_CLIENT_SECRET=${OIDC_CLIENT_SECRET:-} + - PYXFORM_HOST=${PYXFORM_HOST:-pyxform} + - PYXFORM_PORT=${PYXFORM_PORT:-80} - SENTRY_ORG_SUBDOMAIN=${SENTRY_ORG_SUBDOMAIN:-o130137} - SENTRY_KEY=${SENTRY_KEY:-3cf75f54983e473da6bd07daddf0d2ee} - SENTRY_PROJECT=${SENTRY_PROJECT:-1298632} diff --git a/files/service/config.json.template b/files/service/config.json.template index c4500224..5f976b21 100644 --- a/files/service/config.json.template +++ b/files/service/config.json.template @@ -22,11 +22,11 @@ } }, "xlsform": { - "host": "pyxform", - "port": 80 + "host": "${PYXFORM_HOST}", + "port": ${PYXFORM_PORT} }, "enketo": { - "url": "http://enketo:8005/-", + "url": "${ENKETO_URL}", "apiKey": "${ENKETO_API_KEY}" }, "env": { diff --git a/files/service/scripts/start-odk.sh b/files/service/scripts/start-odk.sh index dd92d804..cdf644d7 100755 --- a/files/service/scripts/start-odk.sh +++ b/files/service/scripts/start-odk.sh @@ -4,7 +4,7 @@ echo "generating local service configuration.." ENKETO_API_KEY=$(cat /etc/secrets/enketo-api-key) \ BASE_URL=$( [ "${HTTPS_PORT}" = 443 ] && echo https://"${DOMAIN}" || echo https://"${DOMAIN}":"${HTTPS_PORT}" ) \ -envsubst '$DOMAIN $BASE_URL $SYSADMIN_EMAIL $ENKETO_API_KEY $DB_HOST $DB_USER $DB_PASSWORD $DB_NAME $DB_SSL $EMAIL_FROM $EMAIL_HOST $EMAIL_PORT $EMAIL_SECURE $EMAIL_IGNORE_TLS $EMAIL_USER $EMAIL_PASSWORD $OIDC_ENABLED $OIDC_ISSUER_URL $OIDC_CLIENT_ID $OIDC_CLIENT_SECRET $SENTRY_ORG_SUBDOMAIN $SENTRY_KEY $SENTRY_PROJECT' \ +envsubst '$DOMAIN $BASE_URL $SYSADMIN_EMAIL $ENKETO_URL $ENKETO_API_KEY $DB_HOST $DB_USER $DB_PASSWORD $DB_NAME $DB_SSL $EMAIL_FROM $EMAIL_HOST $EMAIL_PORT $EMAIL_SECURE $EMAIL_IGNORE_TLS $EMAIL_USER $EMAIL_PASSWORD $OIDC_ENABLED $OIDC_ISSUER_URL $OIDC_CLIENT_ID $OIDC_CLIENT_SECRET $PYXFORM_HOST $PYXFORM_PORT $SENTRY_ORG_SUBDOMAIN $SENTRY_KEY $SENTRY_PROJECT' \ < /usr/share/odk/config.json.template \ > /usr/odk/config/local.json