diff --git a/README.md b/README.md index 4a6b8e3..cd5186c 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,8 @@ App op http://localhost:3000, healthcheck op `/healthz`, DB-check op `/readyz`. - **Forgejo container registry**: CI bouwt de image één keer en pusht die; beide VM's pullen exact dezelfde geteste image. Geen build op de productie-VM. - **Pangolin/Traefik verzorgt de publieke HTTPS-ingang**. De meegeleverde nginx - vormt de interne proxylaag en is standaard alleen via `127.0.0.1:8081` - bereikbaar. De Fastify-app vertrouwt precies twee proxy-hops. + vormt de interne proxylaag en luistert standaard op poort `8081`, zodat de + Pangolin/Traefik-route deze via het VM-/containernetwerk kan bereiken. De Fastify-app vertrouwt precies twee proxy-hops. ## Eenmalige setup @@ -108,7 +108,7 @@ POSTGRES_USER=teach POSTGRES_PASSWORD= DATABASE_URL=postgres://teach:@db:5432/teach APP_PORT=3000 -WEB_BIND_IP=127.0.0.1 +WEB_BIND_IP=0.0.0.0 WEB_PORT=8081 TRUST_PROXY_HOPS=2 SUPER_USER=beheerder @@ -120,11 +120,11 @@ CI werkt bij elke deploy de `IMAGE=`-regel bij, pullt en herstart. ### 4. Pangolin/Traefik publiceren -Publiceer `http://127.0.0.1:8081` via Pangolin/Traefik en laat daar TLS +Publiceer `http://:8081` via Pangolin/Traefik en laat daar TLS beëindigen. De interne nginx behoudt `X-Forwarded-Proto: https`, waarna de app Secure/HttpOnly/SameSite-cookies, HSTS en overige securityheaders gebruikt. -- Laat poort 8081 niet rechtstreeks vanaf internet of het LAN benaderbaar zijn. +- Beperk poort 8081 met de hostfirewall tot het Pangolin/Traefik- of tunnelnetwerk. - Pas `TRUST_PROXY_HOPS` alleen aan wanneer de proxyketen werkelijk verandert. - Bij een aparte Traefik-container kan een gedeeld intern Docker-netwerk nodig zijn; zet `WEB_BIND_IP` niet ruimer dan noodzakelijk. diff --git a/VERSION b/VERSION index dbc6fab..1cb92ea 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.05-beta +0.3.06-beta diff --git a/deploy/compose.deploy.yaml b/deploy/compose.deploy.yaml index 3002825..8baf432 100644 --- a/deploy/compose.deploy.yaml +++ b/deploy/compose.deploy.yaml @@ -35,8 +35,9 @@ services: depends_on: - app ports: - # Alleen lokaal bereikbaar; Pangolin/Traefik publiceert deze endpoint met TLS. - - "${WEB_BIND_IP:-127.0.0.1}:${WEB_PORT:-8081}:80" + # Bereikbaar voor Pangolin/Traefik via het VM-/containernetwerk. + # Beperk poort 8081 met de hostfirewall tot de proxy/tunnel. + - "${WEB_BIND_IP:-0.0.0.0}:${WEB_PORT:-8081}:80" volumes: - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro restart: unless-stopped diff --git a/public/js/core.js b/public/js/core.js index d7e89a0..64e9032 100644 --- a/public/js/core.js +++ b/public/js/core.js @@ -2,7 +2,7 @@ "use strict"; /* version — shown until /api/version resolves (or if the fetch fails, e.g. offline). Kept in sync by hand with the VERSION file at the repo root on every release. */ -const VERSION = "0.3.05-beta"; +const VERSION = "0.3.06-beta"; (function(){ const tag = document.getElementById("verTag"); tag.textContent = "v"+VERSION; diff --git a/test/security-config.test.js b/test/security-config.test.js index 89dd142..786689e 100644 --- a/test/security-config.test.js +++ b/test/security-config.test.js @@ -6,7 +6,7 @@ test('productieconfig gebruikt secure cookies en begrensde proxy trust', async ( const compose = await readFile('deploy/compose.deploy.yaml', 'utf8'); assert.match(compose, /COOKIE_SECURE: "true"/); assert.match(compose, /TRUST_PROXY_HOPS:/); - assert.match(compose, /WEB_BIND_IP:-127\.0\.0\.1/); + assert.match(compose, /WEB_BIND_IP:-0\.0\.0\.0/); }); test('nginx behoudt het publieke forwarded protocol', async () => {