Skip to content

Commit

Permalink
Merge pull request #537 from getodk/next
Browse files Browse the repository at this point in the history
Release v2023.5
  • Loading branch information
matthew-white authored Dec 18, 2023
2 parents cc2a672 + 65bc575 commit b04bb6e
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 32 deletions.
2 changes: 1 addition & 1 deletion client
Submodule client updated 155 files
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
environment:
POSTGRES_USER: odk
POSTGRES_PASSWORD: odk
POSTGRES_DATABASE: odk
POSTGRES_DB: odk
restart: always
postgres:
# This service upgrades from postgres 9.6 to 14.
Expand All @@ -25,9 +25,9 @@ services:
PGUSER: odk
POSTGRES_INITDB_ARGS: -U odk
POSTGRES_PASSWORD: odk
POSTGRES_DATABASE: odk
POSTGRES_DB: odk
mail:
image: "ixdotai/smtp:v0.5.1"
image: "ixdotai/smtp:v0.5.2"
volumes:
- ./files/mail/rsa.private:/etc/exim4/dkim.key.temp:ro
environment:
Expand Down Expand Up @@ -102,7 +102,7 @@ services:
options:
max-file: "30"
pyxform:
image: 'ghcr.io/getodk/pyxform-http:v1.12.2'
image: 'ghcr.io/getodk/pyxform-http:v2.0.0'
restart: always
secrets:
volumes:
Expand Down
4 changes: 2 additions & 2 deletions enketo.dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ghcr.io/enketo/enketo-express:6.2.2
FROM ghcr.io/enketo/enketo:7.0.0

ENV ENKETO_SRC_DIR=/srv/src/enketo_express
ENV ENKETO_SRC_DIR=/srv/src/enketo/packages/enketo-express
WORKDIR ${ENKETO_SRC_DIR}

# we copy the config template twice. eventually we do want to actually template
Expand Down
6 changes: 3 additions & 3 deletions files/enketo/start-enketo.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

CONFIG_PATH=${ENKETO_SRC_DIR}/config/config.json
echo "generating enketo configuration.."
echo "generating enketo configuration..."

BASE_URL=$( [ "${HTTPS_PORT}" = 443 ] && echo https://"${DOMAIN}" || echo https://"${DOMAIN}":"${HTTPS_PORT}" ) \
SECRET=$(cat /etc/secrets/enketo-secret) \
Expand All @@ -11,5 +11,5 @@ envsubst '$DOMAIN $BASE_URL $SECRET $LESS_SECRET $API_KEY $SUPPORT_EMAIL' \
< "$CONFIG_PATH.template" \
> "$CONFIG_PATH"

echo "starting pm2/enketo.."
exec pm2-runtime app.js -n enketo
echo "starting enketo..."
exec yarn workspace enketo-express start
2 changes: 1 addition & 1 deletion files/postgres14/start-postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ fi

log "Starting postgres..."
# call ENTRYPOINT + CMD from parent Docker image
docker-entrypoint.sh postgres
exec docker-entrypoint.sh postgres
11 changes: 9 additions & 2 deletions nginx.dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
FROM node:18.17 as intermediate
FROM node:20.10-slim as intermediate

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*

COPY ./ ./
RUN files/prebuild/write-version.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
FROM jonasal/nginx-certbot:4.2.0
FROM jonasal/nginx-certbot:5.0.0

EXPOSE 80
EXPOSE 443
Expand Down
4 changes: 2 additions & 2 deletions postgres14.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM postgres:14.9
FROM postgres:14.10

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

Expand All @@ -14,4 +14,4 @@ COPY files/postgres14/start-postgres.sh /usr/local/bin/
ENV PGDATA /var/lib/odk/postgresql/14/data

ENTRYPOINT []
CMD start-postgres.sh
CMD ["start-postgres.sh"]
3 changes: 2 additions & 1 deletion secrets.dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
FROM node:18.17
FROM node:20.10-slim

COPY files/enketo/generate-secrets.sh ./
2 changes: 1 addition & 1 deletion server
Submodule server updated 72 files
+2 −2 .circleci/config.yml
+3 −2 .github/workflows/oidc-e2e.yml
+4 −3 .github/workflows/oidc-integration.yml
+3 −2 .github/workflows/soak-test.yml
+4 −3 .github/workflows/standard-suite.yml
+6 −0 CONTRIBUTING.md
+11 −1 Makefile
+4 −2 README.md
+2 −2 config/default.json
+770 −1,223 docs/api.yaml
+3 −3 lib/bin/run-server.js
+15 −1 lib/data/analytics.js
+50 −27 lib/data/dataset.js
+123 −29 lib/data/entity.js
+4 −0 lib/data/schema.js
+14 −4 lib/data/submission.js
+2 −0 lib/formats/odata.js
+14 −14 lib/http/endpoint.js
+4 −2 lib/model/frames/dataset.js
+28 −15 lib/model/frames/entity.js
+38 −0 lib/model/migrations/20231002-01-add-conflict-details.js
+19 −0 lib/model/migrations/20231013-01-change-entity-error-action.js
+20 −0 lib/model/migrations/20231208-01-dataset-form-def-actions.js
+33 −3 lib/model/query/analytics.js
+2 −2 lib/model/query/audits.js
+20 −11 lib/model/query/datasets.js
+216 −90 lib/model/query/entities.js
+21 −9 lib/model/query/forms.js
+13 −6 lib/resources/datasets.js
+31 −12 lib/resources/entities.js
+47 −43 lib/resources/oidc.js
+2 −2 lib/task/db.js
+8 −0 lib/util/db.js
+1 −31 lib/util/html.js
+11 −0 lib/util/problem.js
+2 −2 lib/worker/entity.js
+3 −3 lib/worker/jobs.js
+103 −92 lib/worker/worker.js
+17 −0 odk-docs.dockerfile
+6 −8 oidc-dev/fake-oidc-server/.eslintrc.cjs
+1 −1 oidc-dev/fake-oidc-server/package.json
+6 −8 oidc-dev/playwright-tests/.eslintrc.js
+1 −1 oidc-dev/playwright-tests/package.json
+1 −1 oidc-tester.dockerfile
+359 −190 package-lock.json
+2 −2 package.json
+1 −1 soak-tester/package.json
+40 −2 test/assertions.js
+65 −12 test/data/xml.js
+21 −2 test/integration/api/audits.js
+1,559 −104 test/integration/api/datasets.js
+1,741 −49 test/integration/api/entities.js
+6 −6 test/integration/api/forms/draft.js
+151 −28 test/integration/api/forms/forms.js
+89 −5 test/integration/api/odata-entities.js
+7 −2 test/integration/api/projects.js
+18 −17 test/integration/api/submissions.js
+33 −0 test/integration/fixtures/scenarios.js
+215 −8 test/integration/other/analytics-queries.js
+182 −0 test/integration/other/empty-entity-structure.js
+45 −2 test/integration/other/migrations.js
+0 −1 test/integration/setup.js
+359 −105 test/integration/worker/entity.js
+28 −27 test/integration/worker/worker.js
+167 −56 test/unit/data/dataset.js
+383 −107 test/unit/data/entity.js
+1 −0 test/unit/data/odata-filter.js
+29 −0 test/unit/data/schema.js
+134 −1 test/unit/data/submission.js
+2 −1 test/unit/model/frames/entity.js
+3 −25 test/unit/util/html.js
+4 −1 test/util/enketo.js
61 changes: 46 additions & 15 deletions service.dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,69 @@
ARG node_version=18.17
FROM node:${node_version} as intermediate
ARG node_version=20.10



FROM node:${node_version}-slim as pgdg
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gpg \
&& rm -rf /var/lib/apt/lists/* \
&& update-ca-certificates
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ $(grep -oP 'VERSION_CODENAME=\K\w+' /etc/os-release)-pgdg main" \
| tee /etc/apt/sources.list.d/pgdg.list \
&& curl https://www.postgresql.org/media/keys/ACCC4CF8.asc \
| gpg --dearmor > /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg



FROM node:${node_version}-slim as intermediate
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*
COPY . .
RUN mkdir /tmp/sentry-versions
RUN git describe --tags --dirty > /tmp/sentry-versions/central
WORKDIR server
WORKDIR /server
RUN git describe --tags --dirty > /tmp/sentry-versions/server
WORKDIR ../client
WORKDIR /client
RUN git describe --tags --dirty > /tmp/sentry-versions/client

FROM node:${node_version}

WORKDIR /usr/odk

RUN apt-get update && apt-get install wait-for-it && rm -rf /var/lib/apt/lists/*
FROM node:${node_version}-slim

RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ $(grep -oP 'VERSION_CODENAME=\K\w+' /etc/os-release)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list && \
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg && \
apt-get update && \
apt-get install -y cron gettext postgresql-client-14
ARG node_version
LABEL org.opencontainers.image.source="https://github.com/getodk/central"

COPY files/service/crontab /etc/cron.d/odk
WORKDIR /usr/odk

COPY server/package*.json ./

RUN npm clean-install --omit=dev --legacy-peer-deps --no-audit --fund=false --update-notifier=false
COPY --from=pgdg /etc/apt/sources.list.d/pgdg.list \
/etc/apt/sources.list.d/pgdg.list
COPY --from=pgdg /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg \
/etc/apt/trusted.gpg.d/apt.postgresql.org.gpg
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gpg \
cron \
wait-for-it \
gettext \
procps \
postgresql-client-14 \
netcat-traditional \
&& rm -rf /var/lib/apt/lists/* \
&& npm clean-install --omit=dev --legacy-peer-deps --no-audit \
--fund=false --update-notifier=false

COPY server/ ./
COPY files/service/scripts/ ./

COPY files/service/config.json.template /usr/share/odk/
COPY files/service/crontab /etc/cron.d/odk
COPY files/service/odk-cmd /usr/bin/

COPY --from=intermediate /tmp/sentry-versions/ ./sentry-versions

EXPOSE 8383

0 comments on commit b04bb6e

Please sign in to comment.