-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #661 from getodk/next
Release v2024.2
- Loading branch information
Showing
38 changed files
with
2,064 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: GHCR | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [master] | ||
tags: ["v*.*.*"] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
|
||
jobs: | ||
build-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
strategy: | ||
matrix: | ||
image: [nginx, service] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
submodules: recursive | ||
|
||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/central-${{ matrix.image }} | ||
|
||
- name: Set up QEMU emulator for multi-arch images | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and push ${{ matrix.image }} Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: ${{ matrix.image }}.dockerfile | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: 'linux/amd64,linux/arm64' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Test nginx config | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.17.0 | ||
- run: cd test && npm i | ||
- run: cd test && ./run-tests.sh | ||
|
||
- if: always() | ||
run: docker logs test-nginx-1 | ||
- if: always() | ||
run: docker logs test-service-1 | ||
- if: always() | ||
run: docker logs test-enketo-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"oidcEnabled": $OIDC_ENABLED | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
VUE_APP_OIDC_ENABLED="$OIDC_ENABLED" npm run build | ||
npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
0 4 * * * root /usr/odk/purge-forms.sh | ||
0 5 * * * root /usr/odk/upload-blobs.sh | ||
0 4 * * * root /usr/odk/purge.sh | ||
0 3 * * * root /usr/odk/run-analytics.sh | ||
0 2 * * * root /usr/odk/process-backlog.sh | ||
0 1 * * 0 root /usr/odk/reap-sessions.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh -eu | ||
|
||
cd /usr/odk | ||
/usr/local/bin/node lib/bin/process-backlog.js >/proc/1/fd/1 2>/proc/1/fd/2 | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh -eu | ||
|
||
cd /usr/odk | ||
/usr/local/bin/node lib/bin/purge.js >/proc/1/fd/1 2>/proc/1/fd/2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh -eu | ||
|
||
cd /usr/odk | ||
/usr/local/bin/node lib/bin/s3.js upload-pending >/proc/1/fd/1 2>/proc/1/fd/2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,38 @@ | ||
FROM node:20.12.2-slim as intermediate | ||
FROM node:20.17.0-slim AS intermediate | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
git \ | ||
gettext-base \ | ||
&& 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 | ||
RUN 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:5.0.1 | ||
FROM jonasal/nginx-certbot:5.4.0 | ||
|
||
EXPOSE 80 | ||
EXPOSE 443 | ||
|
||
VOLUME [ "/etc/dh", "/etc/selfsign", "/etc/nginx/conf.d" ] | ||
ENTRYPOINT [ "/bin/bash", "/scripts/setup-odk.sh" ] | ||
# Persist Diffie-Hellman parameters and/or selfsign key | ||
VOLUME [ "/etc/dh", "/etc/selfsign" ] | ||
|
||
RUN apt-get update && apt-get install -y netcat-openbsd | ||
|
||
RUN mkdir -p /usr/share/odk/nginx/ | ||
|
||
COPY files/nginx/setup-odk.sh /scripts/ | ||
COPY files/local/customssl/*.pem /etc/customssl/live/local/ | ||
COPY files/nginx/*.conf* /usr/share/odk/nginx/ | ||
RUN chmod +x /scripts/setup-odk.sh | ||
|
||
COPY files/nginx/redirector.conf /usr/share/odk/nginx/ | ||
COPY files/nginx/common-headers.conf /usr/share/odk/nginx/ | ||
|
||
COPY --from=intermediate client/dist/ /usr/share/nginx/html | ||
COPY --from=intermediate /tmp/version.txt /usr/share/nginx/html | ||
|
||
ENTRYPOINT [ "/scripts/setup-odk.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
FROM node:20.12.2-slim | ||
FROM node:20.17.0-slim | ||
|
||
COPY files/enketo/generate-secrets.sh ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hi-from-letsencrypt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hi:/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hi:/should-be-cached.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hi:/version.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
const express = require('express'); | ||
|
||
const port = process.env.PORT || 80; | ||
const log = (...args) => console.log('[mock-http-server]', ...args); | ||
|
||
const requests = []; | ||
|
||
const app = express(); | ||
|
||
app.get('/health', withStdLogging((req, res) => res.send('OK'))); | ||
app.get('/request-log', withStdLogging((req, res) => res.json(requests))); | ||
app.get('/reset', withStdLogging((req, res) => { | ||
requests.length = 0; | ||
res.json('OK'); | ||
})); | ||
|
||
app.get('/*', ok('GET')); | ||
app.post('/*', ok('POST')); | ||
// TODO add more methods as required | ||
|
||
app.listen(port, () => { | ||
log(`Listening on port: ${port}`); | ||
}); | ||
|
||
function withStdLogging(fn) { | ||
return (req, res) => { | ||
console.log(new Date(), req.method, req.path); | ||
return fn(req, res); | ||
}; | ||
} | ||
|
||
function ok(method) { | ||
return withStdLogging((req, res) => { | ||
requests.push({ method, path:req.path }); | ||
res.send('OK'); | ||
}); | ||
} |
Oops, something went wrong.