Skip to content

Commit

Permalink
Merge pull request #457 from getodk/next
Browse files Browse the repository at this point in the history
Release v2023.4
  • Loading branch information
sadiqkhoja authored Sep 25, 2023
2 parents f09c50b + 28dad0a commit 65d38c5
Show file tree
Hide file tree
Showing 18 changed files with 58 additions and 230 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- checkout

- run: sudo apt install shellcheck
- run: cat <(git grep -El '^#!.*sh\b') <(git ls-files | grep -E '.sh$') | sort -u | grep -v '/wait-for-it.sh$' | xargs shellcheck --exclude=SC2016
- run: cat <(git grep -El '^#!.*sh\b') <(git ls-files | grep -E '.sh$') | sort -u | xargs shellcheck --exclude=SC2016

- run: git submodule update -i

Expand Down
6 changes: 6 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ HTTPS_PORT=443
# EMAIL_USER=
# EMAIL_PASSWORD=

# Optional: configure Single Sign-on with OpenID Connect
# OIDC_ENABLED=
# OIDC_ISSUER_URL=
# OIDC_CLIENT_ID=
# OIDC_CLIENT_SECRET=

# Optional: configure error reporting
# SENTRY_ORG_SUBDOMAIN=
# SENTRY_KEY=
Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@
/files/postgres14/upgrade/*
!/files/postgres14/upgrade/check-available-space

/files/local/customssl/*.pem
/files/local/customssl/*.pem

/files/mail/rsa.private
/files/mail/rsa.public

/files/dkim/*
2 changes: 1 addition & 1 deletion client
Submodule client updated 185 files
28 changes: 17 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ services:
POSTGRES_PASSWORD: odk
POSTGRES_DATABASE: odk
mail:
image: "ixdotai/smtp:v0.2.0"
image: "ixdotai/smtp:v0.5.1"
volumes:
- ./files/dkim/config:/etc/exim4/_docker_additional_macros:ro
- ./files/dkim/rsa.private:/etc/exim4/domain.key:ro
- ./files/mail/rsa.private:/etc/exim4/dkim.key.temp:ro
environment:
- MAILNAME=${DOMAIN}
- DKIM_KEY_PATH=/etc/exim4/dkim.key.temp
restart: always
service:
build:
Expand All @@ -51,29 +51,35 @@ services:
- DOMAIN=${DOMAIN}
- SYSADMIN_EMAIL=${SYSADMIN_EMAIL}
- HTTPS_PORT=${HTTPS_PORT:-443}
- NODE_OPTIONS=${SERVICE_NODE_OPTIONS:-''}
- NODE_OPTIONS=${SERVICE_NODE_OPTIONS:-}
- DB_HOST=${DB_HOST:-postgres14}
- DB_USER=${DB_USER:-odk}
- DB_PASSWORD=${DB_PASSWORD:-odk}
- DB_NAME=${DB_NAME:-odk}
- DB_SSL=${DB_SSL:-null}
- EMAIL_FROM=${EMAIL_FROM:-no-reply@${DOMAIN}}
- EMAIL_FROM=${EMAIL_FROM:-no-reply@$DOMAIN}
- EMAIL_HOST=${EMAIL_HOST:-mail}
- EMAIL_PORT=${EMAIL_PORT:-25}
- EMAIL_SECURE=${EMAIL_SECURE:-false}
- EMAIL_IGNORE_TLS=${EMAIL_IGNORE_TLS:-true}
- EMAIL_USER=${EMAIL_USER:-''}
- EMAIL_PASSWORD=${EMAIL_PASSWORD:-''}
- EMAIL_USER=${EMAIL_USER:-}
- EMAIL_PASSWORD=${EMAIL_PASSWORD:-}
- OIDC_ENABLED=${OIDC_ENABLED:-false}
- OIDC_ISSUER_URL=${OIDC_ISSUER_URL:-}
- OIDC_CLIENT_ID=${OIDC_CLIENT_ID:-}
- OIDC_CLIENT_SECRET=${OIDC_CLIENT_SECRET:-}
- SENTRY_ORG_SUBDOMAIN=${SENTRY_ORG_SUBDOMAIN:-o130137}
- SENTRY_KEY=${SENTRY_KEY:-3cf75f54983e473da6bd07daddf0d2ee}
- SENTRY_PROJECT=${SENTRY_PROJECT:-1298632}
command: [ "./wait-for-it.sh", "${DB_HOST:-postgres14}:5432", "--", "./start-odk.sh" ]
command: [ "wait-for-it", "${DB_HOST:-postgres14}:5432", "--", "./start-odk.sh" ]
restart: always
logging:
driver: local
nginx:
build:
context: .
args:
- OIDC_ENABLED=${OIDC_ENABLED:-false}
dockerfile: nginx.dockerfile
depends_on:
- service
Expand All @@ -96,7 +102,7 @@ services:
options:
max-file: "30"
pyxform:
image: 'ghcr.io/getodk/pyxform-http:v1.12.1'
image: 'ghcr.io/getodk/pyxform-http:v1.12.2'
restart: always
secrets:
volumes:
Expand All @@ -121,7 +127,7 @@ services:
- SUPPORT_EMAIL=${SYSADMIN_EMAIL}
- HTTPS_PORT=${HTTPS_PORT:-443}
enketo_redis_main:
image: redis:7.0
image: redis:7.2
volumes:
- ./files/enketo/redis-enketo-main.conf:/usr/local/etc/redis/redis.conf:ro
- enketo_redis_main:/data
Expand All @@ -130,7 +136,7 @@ services:
- /usr/local/etc/redis/redis.conf
restart: always
enketo_redis_cache:
image: redis:7.0
image: redis:7.2
volumes:
- ./files/enketo/redis-enketo-cache.conf:/usr/local/etc/redis/redis.conf:ro
- enketo_redis_cache:/data
Expand Down
2 changes: 1 addition & 1 deletion enketo.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/enketo/enketo-express:6.2.0
FROM ghcr.io/enketo/enketo-express:6.2.2

ENV ENKETO_SRC_DIR=/srv/src/enketo_express
WORKDIR ${ENKETO_SRC_DIR}
Expand Down
5 changes: 0 additions & 5 deletions files/dkim/config.disabled

This file was deleted.

Empty file added files/mail/rsa.private
Empty file.
9 changes: 8 additions & 1 deletion files/postgres14/upgrade/check-available-space
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ fi
dockerRootDir="$(docker info --format '{{print .DockerRootDir}}')"
free="$(df --output=avail "$dockerRootDir/volumes" | tail -n+2)"

containerName="central_postgres_1"
# Support both Docker Compose v1 & v2 container names.
# See: https://docs.docker.com/compose/migrate/#service-container-names
if ! docker compose version >/dev/null 2>/dev/null; then
containerName="central_postgres_1"
else
containerName="central-postgres-1"
fi

# The --format argument is a Go template. Adding spaces between the
# curlies seems to affect the output. For more info on this
# wonderful language, see:
Expand Down
2 changes: 1 addition & 1 deletion files/prebuild/build-frontend.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -eu
cd client
npm clean-install --no-audit --fund=false --update-notifier=false
npm run build
VUE_APP_OIDC_ENABLED="$OIDC_ENABLED" npm run build
6 changes: 6 additions & 0 deletions files/service/config.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
"domain": "${BASE_URL}",
"sysadminAccount": "${SYSADMIN_EMAIL}"
},
"oidc": {
"enabled": ${OIDC_ENABLED},
"issuerUrl": "${OIDC_ISSUER_URL}",
"clientId": "${OIDC_CLIENT_ID}",
"clientSecret": "${OIDC_CLIENT_SECRET}"
},
"external": {
"sentry": {
"orgSubdomain": "${SENTRY_ORG_SUBDOMAIN}",
Expand Down
2 changes: 1 addition & 1 deletion files/service/scripts/start-odk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 $SENTRY_ORG_SUBDOMAIN $SENTRY_KEY $SENTRY_PROJECT' \
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' \
< /usr/share/odk/config.json.template \
> /usr/odk/config/local.json

Expand Down
200 changes: 0 additions & 200 deletions files/service/scripts/wait-for-it.sh

This file was deleted.

5 changes: 3 additions & 2 deletions nginx.dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM node:16.20 as intermediate
FROM node:18.17 as intermediate

COPY ./ ./
RUN files/prebuild/write-version.sh
RUN files/prebuild/build-frontend.sh
ARG OIDC_ENABLED
RUN OIDC_ENABLED="$OIDC_ENABLED" files/prebuild/build-frontend.sh

# when upgrading, look for upstream changes to redirector.conf
# also, confirm setup-odk.sh strips out HTTP-01 ACME challenge location
Expand Down
2 changes: 1 addition & 1 deletion postgres14.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM postgres:14.8
FROM postgres:14.9

COPY files/postgres14/start-postgres.sh /usr/local/bin/

Expand Down
Loading

0 comments on commit 65d38c5

Please sign in to comment.