Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
7a594a7
docker-compose: add explicit dependency between postgres containers (…
alxndrsn Sep 17, 2026
e83be33
upgrade-postgres: clarify data cleanup link (#2215)
alxndrsn Sep 17, 2026
d61c207
ci: fix npm/package.json location references (#2249)
alxndrsn Sep 17, 2026
5930a08
test/with-pgenvblock: add additional test (#2204)
alxndrsn Sep 17, 2026
8045ba2
Merge branch 'master' into next
matthew-white Sep 23, 2026
3e852f5
Merge branch 'master' into next
matthew-white Sep 28, 2026
cdc6645
upload-blobs: do not attempt unless S3-related vars are set (#2279)
alxndrsn Oct 7, 2026
26187fe
test/with-pgenvblock: compare binary outputs accurately (#2265)
alxndrsn Oct 15, 2026
3511d6e
test/with-pgenvblock: add additional test cases (#2266)
alxndrsn Oct 16, 2026
adaff4b
with-pgenvblock: fix linebreak support (#2290)
alxndrsn Oct 22, 2026
dd78c4d
docker-compose: remove "service" dependency on "secrets" (#2302)
alxndrsn Nov 2, 2026
2b0f92b
ci: use specific ubuntu version (#2304)
alxndrsn Nov 2, 2026
eda7d65
Revert "docker-compose: remove "service" dependency on "secrets" (#23…
alxndrsn Nov 3, 2026
35c5bfd
service/start-odk: check memtot in bytes (#2306)
alxndrsn Nov 5, 2026
1dcc94d
enketo-secrets: tidy up files (#2303)
alxndrsn Nov 5, 2026
39f785b
postgres: upgrade to v18 with pgautoupgrade (#2285)
alxndrsn Nov 6, 2026
eb95a1e
form-wrapper: allow any frame-ancestor (#2321)
alxndrsn Nov 13, 2026
031aea4
service: upgrade postgresql-client version (#2317)
alxndrsn Nov 16, 2026
8ab600a
ci: deprioritise azure ubuntu mirrors (#2329)
alxndrsn Nov 17, 2026
9d5b7c8
feat(web-forms#517): add variable for Google Maps API key (#2326)
latin-panda Nov 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ HTTPS_PORT=443
# Optional: configure frontend error reporting
# SENTRY_DSN_FRONTEND=

# Optional: show Google Maps layers in Web Forms map questions
# GOOGLE_MAPS_KEY=

# Optional: configure S3-compatible storage for binary files
# S3_SERVER=
# S3_ACCESS_KEY=
Expand Down
19 changes: 19 additions & 0 deletions .github/actions/relegate-azure-mirrors/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Relegate Azure mirrors
description: Relegate azure Ubuntu repo mirrors, as they can be fatally slow

runs:
using: 'composite'
steps:
- shell: bash
run: cat /etc/apt/apt-mirrors.txt
- name: relegate azure ubuntu mirrors
shell: bash
run: |
sudo sed \
--in-place \
-E \
--expression '/archive.ubuntu.com\/ubuntu\/[[:space:]]+priority:/ s/priority:2/priority:1/' \
--expression '/azure.archive.ubuntu.com\/ubuntu\/[[:space:]]+priority:/ s/priority:[-0-9]+/priority:999/' \
/etc/apt/apt-mirrors.txt
- shell: bash
run: cat /etc/apt/apt-mirrors.txt
2 changes: 1 addition & 1 deletion .github/workflows/close-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
close_issues:
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'next'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
permissions:
issues: write
pull-requests: read
Expand Down
34 changes: 21 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ on:
jobs:
test-misc: # quick, simple checks
timeout-minutes: 2
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- run: docker --version
- run: docker compose version
- uses: actions/checkout@v5
- uses: ./.github/actions/relegate-azure-mirrors
- run: ./test/check-submodules.sh
- run: ./test/test-with-pgenvblock.sh
- run: sudo apt-get install shellcheck
Expand All @@ -30,25 +31,27 @@ jobs:
- run: cd test && npm run test:github-actions
test-envsub:
timeout-minutes: 2
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/relegate-azure-mirrors
- run: cd test/envsub && ./run-tests.sh
test-nginx:
timeout-minutes: 4
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/relegate-azure-mirrors
- uses: actions/setup-node@v5
with:
node-version-file: test/package.json
- run: cd test/nginx && npm clean-install --no-audit
- run: cd test && npm clean-install --no-audit
- run: cd test/nginx && ./setup-tests.sh
- run: cd test/nginx && npm run test:nginx:mocha
- run: cd test && npm run test:nginx:mocha
- run: cd test/nginx && ./lint-config.sh

- run: cd test/nginx && npx playwright install --with-deps chromium-headless-shell
- run: cd test/nginx && npm run test:nginx:playwright
- run: cd test && npx playwright install --with-deps chromium-headless-shell
- run: cd test && npm run test:nginx:playwright

- if: always()
run: cd test/nginx && docker compose -f nginx.test.docker-compose.yml logs --no-log-prefix nginx-ssl-selfsign
Expand All @@ -62,22 +65,25 @@ jobs:
run: cd test/nginx && docker compose -f nginx.test.docker-compose.yml logs --no-log-prefix sentry-mock
test-secrets:
timeout-minutes: 2
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/relegate-azure-mirrors
- run: ./test/test-secrets.sh
test-service:
timeout-minutes: 5
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
with:
submodules: true
- uses: ./.github/actions/relegate-azure-mirrors
- uses: actions/setup-node@v5
with:
node-version-file: test/package.json
- run: cd test/nginx && npm clean-install --no-audit
- run: cd test/nginx && npm run test:service
- run: cd test && npm clean-install --no-audit
- run: touch ./files/allow-postgres14-upgrade
- run: cd test && npm run test:service
test-images:
timeout-minutes: 10
needs:
Expand All @@ -86,13 +92,14 @@ jobs:
- test-nginx
- test-secrets
- test-service
runs-on: ubuntu-latest # TODO matrix to run on all expected versions?
runs-on: ubuntu-24.04 # TODO matrix to run on all expected versions?
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
fetch-tags: true
submodules: recursive
- uses: ./.github/actions/relegate-azure-mirrors

- run: ./test/check-docker-context.sh --min-size 5000 --max-size 10000 --min-count 650 --max-count 750

Expand All @@ -119,7 +126,7 @@ jobs:
))
needs:
- test-images
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
Expand All @@ -135,6 +142,7 @@ jobs:
fetch-depth: 0
fetch-tags: true
submodules: recursive
- uses: ./.github/actions/relegate-azure-mirrors
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v4
with:
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ This changelog lists changes to operations infrastructure, i.e., code changes to
* [packages/xpath](https://github.com/getodk/central-frontend/tree/master/packages/xpath/CHANGELOG.md)
</details>

## 2026.4.0

- Upgrade PostgreSQL version to v18 (getodk/central#2285)
- Don't attempt to upload blobs to S3 if not configured (getodk/central#1476)
- Fix support for multiline values in postgres-related environment variables (getodk/central#2203)
- Reduce `central-backend` worker count for some systems with &lt;1GB RAM (getodk/central#2306)
- Rename `secrets.dockerfile` -> `enketo-secrets.dockerfile` (getodk/central#2303)
- Rename `files/enketo/generate-secrets.sh` -> `files/enketo-secrets/generate-secrets.sh` (getodk/central#2303)
- Allow embedding of public-access forms in iframes (getodk/central#2321)
- Update postgresql-client in the `service` container from v14 to v18 (getodk/central#2317)
- Add optional `GOOGLE_MAPS_KEY` to show Google Maps layers in Web Forms map questions (getodk/web-forms#517)

## 2026.3.0

- Show error message for incorrect encryption password (getodk/central#2080)
Expand Down
26 changes: 22 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,35 @@
services:
postgres14:
# CURRENT PostgreSQL container.
# This service runs the LATEST version of postgres specificed in
# the associated dockerfile, which is now >v14.
# The legacy name is maintained to simplify ops/maintenance.
build:
context: .
dockerfile: postgres14.dockerfile
dockerfile: postgres-current.dockerfile
shm_size: 512m
volumes:
- postgres14:/var/lib/odk/postgresql/14
- type: volume
source: postgres14
target: /var/lib/postgresql/data
volume:
subpath: data
- ./files/postgres14/upgrade:/postgres14-upgrade
environment:
POSTGRES_USER: odk
POSTGRES_PASSWORD: odk
POSTGRES_DB: odk
restart: always
depends_on:
postgres:
condition: service_completed_successfully
postgres:
# LEGACY PostgreSQL container.
# This service upgrades from postgres 9.6 to 14.
# The legacy name must be maintained to allow access to the anonymous volume.
build:
context: .
dockerfile: postgres-upgrade.dockerfile
dockerfile: postgres-legacy.dockerfile
platform: linux/amd64
volumes:
- /var/lib/postgresql/data
Expand Down Expand Up @@ -110,6 +123,7 @@ services:
- SENTRY_PROJECT=${SENTRY_PROJECT:-1298632}
- OIDC_ENABLED=${OIDC_ENABLED:-false}
- SENTRY_DSN_FRONTEND=${SENTRY_DSN_FRONTEND:-}
- GOOGLE_MAPS_KEY=${GOOGLE_MAPS_KEY:-}
volumes:
- ./files/local/customssl/:/etc/customssl/live/local/:ro
- ./files/nginx/odk.conf.template:/usr/share/odk/nginx/odk.conf.template:ro
Expand All @@ -132,7 +146,7 @@ services:
- secrets:/etc/secrets
build:
context: .
dockerfile: secrets.dockerfile
dockerfile: enketo-secrets.dockerfile
command: './generate-secrets.sh'
enketo:
volumes:
Expand Down Expand Up @@ -170,5 +184,9 @@ services:
volumes:
secrets:
postgres14:
# CURRENT PostgreSQL storage volume.
# This volume contains the data used by the postgres14 service,
# which now runs a version of postgres >v14.
# The legacy name is maintained to simplify ops/maintenance.
enketo_redis_main:
enketo_redis_cache:
3 changes: 3 additions & 0 deletions enketo-secrets.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM node:24.20.0-slim

COPY files/enketo-secrets/generate-secrets.sh ./
3 changes: 2 additions & 1 deletion files/nginx/client-config.json.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"oidcEnabled": ${OIDC_ENABLED},
"sentryDsn": "${SENTRY_DSN_FRONTEND}"
"sentryDsn": "${SENTRY_DSN_FRONTEND}",
"googleMapsKey": "${GOOGLE_MAPS_KEY}"
}
9 changes: 7 additions & 2 deletions files/nginx/odk.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ map $arg_st $redirect_single_prefix {
default "/new${is_args}${args}${qp_deliminator}single=true";
}

map $arg_st $formwrapper_frame_ancestors {
~.+ "*";
default "'self'";
}

# Note: using $request_uri here remains safe while percent-encodings are not
# normalised in frontend URLs. Tracked at https://github.com/getodk/central/issues/1532
map $request_uri $spa_name {
Expand All @@ -102,7 +107,7 @@ map $spa_name $spa_csp {
# Use 'none' per directive instead of falling back to default-src to make CSP violation reports more specific

form-wrapper
"default-src 'report-sample' 'none'; connect-src 'self' https:; font-src 'self' data:; form-action 'self'; frame-ancestors 'self'; frame-src 'self' https://getodk.github.io/central/; img-src blob: data: https:; manifest-src 'self'; media-src blob:; object-src 'none'; script-src 'report-sample' 'self' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; worker-src 'report-sample' blob: data:; report-uri /csp-report";
"default-src 'report-sample' 'none'; connect-src 'self' https:; font-src 'self' data:; form-action 'self'; frame-ancestors $formwrapper_frame_ancestors; frame-src 'self' https://getodk.github.io/central/; img-src blob: data: https:; manifest-src 'self'; media-src blob:; object-src 'none'; script-src 'report-sample' 'self' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; worker-src 'report-sample' blob: data:; report-uri /csp-report";

default
"default-src 'report-sample' 'none'; connect-src 'self' ${SENTRY_DSN_FRONTEND_ROOT} https://translate.google.com https://translate.googleapis.com; font-src 'self'; form-action 'self'; frame-ancestors 'none'; frame-src 'self' https://getodk.github.io/central/; img-src data: https:; manifest-src 'self'; media-src 'none'; object-src 'none'; script-src 'report-sample' 'self'; style-src 'report-sample' 'self'; style-src-attr 'unsafe-inline'; worker-src 'report-sample' blob:; report-uri /csp-report";
Expand Down Expand Up @@ -227,7 +232,7 @@ server {
# central-frontend
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ $spa_html;
try_files $uri $uri/ "$spa_html$is_args$args";

add_header Content-Security-Policy "$spa_csp" always;

Expand Down
6 changes: 2 additions & 4 deletions files/postgres/upgrade-postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
set -o pipefail
shopt -s inherit_errexit

flag_upgradeCompletedOk="$PGDATANEW/../.postgres14-upgrade-successful"
flag_deleteOldData_name="delete-old-data"
flag_deleteOldData_internal="/postgres14-upgrade/$flag_deleteOldData_name"
flag_oldDataDeleted="/postgres14-upgrade/old-data-deleted"
Expand All @@ -13,7 +12,7 @@ log() {
}

log "Checking for existing upgrade marker file..."
if [[ -f "$flag_upgradeCompletedOk" ]]; then
if [[ -f "/postgres14-upgrade/upgrade-successful" ]]; then
log "Upgrade has been run previously."

if [[ -f "$flag_deleteOldData_internal" ]]; then
Expand All @@ -28,7 +27,7 @@ if [[ -f "$flag_upgradeCompletedOk" ]]; then
log "!!!"
log "!!! This is taking up disk space: $(du -hs "$PGDATAOLD" 2>/dev/null | cut -f1)B"
log "!!!"
log "!!! Continue with the instructions at https://docs.getodk.org/central-upgrade/"
log "!!! Continue with the instructions at https://docs.getodk.org/central-upgrade/#upgrading-to-central-v2023-2"
log "!!!"
fi
else
Expand Down Expand Up @@ -97,7 +96,6 @@ else
log "Upgrade complete."
) > >(tee --append "/postgres14-upgrade/upgrade-postgres.log" >&2) 2>&1
fi
touch "$flag_upgradeCompletedOk"
touch "/postgres14-upgrade/upgrade-successful"
fi

Expand Down
8 changes: 4 additions & 4 deletions files/postgres14/start-postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
set -o pipefail
shopt -s inherit_errexit

flag_upgradeCompletedOk="$PGDATA/../.postgres14-upgrade-successful"
flag_upgradeCompletedOk="/postgres14-upgrade/upgrade-successful"

logPrefix="$(basename "$0")"
log() {
echo "$(TZ=GMT date) [$logPrefix] $*"
}

if ! [[ -f "$flag_upgradeCompletedOk" ]]; then
log "Waiting for upgrade to complete..."
log "Waiting for upgrade to v14 to complete..."
while ! [[ -f "$flag_upgradeCompletedOk" ]]; do sleep 1; done
log "Upgrade complete."
log "Upgrade to v14 complete."
fi

log "Starting postgres..."
# call ENTRYPOINT + CMD from parent Docker image
exec docker-entrypoint.sh postgres "$@"
exec /usr/local/bin/docker-entrypoint.sh postgres "$@"
2 changes: 1 addition & 1 deletion files/service/scripts/start-odk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ get_memory_limit() {

determine_worker_count() {
local memtot=$1
if [ "$memtot" -gt 1100000 ]; then
if [ "$memtot" -gt 1100000000 ]; then
echo 4
else
echo 1
Expand Down
8 changes: 8 additions & 0 deletions files/service/scripts/upload-blobs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,13 @@
set -o pipefail
shopt -s inherit_errexit

# Exit cleanly without attempting upload if there are no S3-related vars set.
if [[ -z "${S3_SERVER-}" ]] &&
[[ -z "${S3_ACCESS_KEY-}" ]] &&
[[ -z "${S3_BUCKET_NAME-}" ]] &&
[[ -z "${S3_SECRET_KEY-}" ]]; then
exit
fi

cd /usr/odk
/usr/local/bin/node lib/bin/s3.js upload-pending >/proc/1/fd/1 2>/proc/1/fd/2
2 changes: 1 addition & 1 deletion files/service/with-pgenvblock.pl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
my @entries = split /\x00/, $content;

for my $entry (@entries) {
if ($entry =~ /\A(?<varname>PG[^=]+)=(?<varvalue>.*)\Z/m) {
if ($entry =~ /\A(?<varname>PG[^=]+)=(?<varvalue>.*)\Z/s) {
$ENV{$+{varname}} = $+{varvalue};
}
}
Expand Down
8 changes: 8 additions & 0 deletions postgres-current.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM pgautoupgrade/pgautoupgrade:18.4-trixie

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

ENV PGDATA=/var/lib/postgresql/data

ENTRYPOINT []
CMD ["/usr/local/bin/start-postgres.sh"]
File renamed without changes.
17 changes: 0 additions & 17 deletions postgres14.dockerfile

This file was deleted.

3 changes: 0 additions & 3 deletions secrets.dockerfile

This file was deleted.

Loading
Loading