From c24f629869d0a75100f20050f3f5d19c87f8bc01 Mon Sep 17 00:00:00 2001 From: Sluijsens Date: Mon, 19 Oct 2026 16:14:26 +0200 Subject: [PATCH] Redirects www to andreaslop.nl and closes out the front-end shell IIS now sends www.andreaslop.nl to https://andreaslop.nl in one step, so monitoring and search engines see a single address. The go-live steps check the redirect and wait for the privacy statement, and the readiness checklist lists what is left for the go-live. Co-Authored-By: Claude Opus 5.5 --- aidlc-docs/active-features.md | 2 +- .../features/frontend-shell/aidlc-state.md | 12 ++-- aidlc-docs/features/frontend-shell/audit.md | 46 ++++++++++++++ .../deployment/deployment-instructions.md | 10 ++- .../plans/production-readiness-questions.md | 61 +++++++++++++++++++ .../production-readiness-checklist.md | 41 +++++++++++++ web/config/serverConfig.test.ts | 20 ++++++ web/config/serverConfig.ts | 15 ++++- web/deploy/iis/web.config | 7 +++ 9 files changed, 203 insertions(+), 11 deletions(-) create mode 100644 aidlc-docs/features/frontend-shell/operations/plans/production-readiness-questions.md create mode 100644 aidlc-docs/features/frontend-shell/operations/production-readiness-checklist.md diff --git a/aidlc-docs/active-features.md b/aidlc-docs/active-features.md index b1a82b0..60537e8 100644 --- a/aidlc-docs/active-features.md +++ b/aidlc-docs/active-features.md @@ -2,4 +2,4 @@ | Type | Name | Status | Branch | Affected Components | Session Start | |------|------|--------|--------|---------------------|---------------| -| Feature | frontend-shell | 🟡 Operations | feature/frontend-shell | web/src (AppShell, NavigationBar, Footer, Hero socials, new BackToTop/SkipLink/404/error pages, routes, theme.ts, main.tsx), web/vite.config.js, web/package.json | 2026-10-14 | +| Feature | frontend-shell | ✅ Complete | feature/frontend-shell | web/src (AppShell, NavigationBar, Footer, Hero socials, new BackToTop/SkipLink/404/error pages, routes, theme.ts, main.tsx), web/vite.config.js, web/package.json | 2026-10-14 | diff --git a/aidlc-docs/features/frontend-shell/aidlc-state.md b/aidlc-docs/features/frontend-shell/aidlc-state.md index d4bded1..53ffac5 100644 --- a/aidlc-docs/features/frontend-shell/aidlc-state.md +++ b/aidlc-docs/features/frontend-shell/aidlc-state.md @@ -5,7 +5,7 @@ - **Feature Slug**: frontend-shell - **Project Type**: Brownfield - **Start Date**: 2026-10-14T09:46:02Z -- **Current Stage**: OPERATIONS - Monitoring Setup (code done, awaiting approval) +- **Current Stage**: Complete - **Branch**: feature/frontend-shell ## Workspace State @@ -74,13 +74,13 @@ ### 🟡 OPERATIONS PHASE - [x] Deployment Setup - EXECUTE (approved; pipeline verified, first test deploy green) -- [~] Monitoring Setup - EXECUTE (setup done in Sentry/Umami, code implemented and green; awaiting approval) -- [ ] Production Readiness Validation - EXECUTE +- [x] Monitoring Setup - EXECUTE (approved; Sentry + Umami live on test and verified) +- [x] Production Readiness Validation - EXECUTE (complete; ready with caveats, go-live follow-ups in the checklist) ## Current Status -- **Lifecycle Phase**: OPERATIONS -- **Current Stage**: Monitoring Setup -- **Next Stage**: Production Readiness Validation +- **Lifecycle Phase**: COMPLETE +- **Current Stage**: Complete +- **Next Stage**: None (feature complete) ## Reverse Engineering Status - [x] Reverse Engineering - Artifacts generated on 2026-10-14T09:58:04Z (approved 2026-10-14T10:05:21Z) diff --git a/aidlc-docs/features/frontend-shell/audit.md b/aidlc-docs/features/frontend-shell/audit.md index 6178229..b3ac242 100644 --- a/aidlc-docs/features/frontend-shell/audit.md +++ b/aidlc-docs/features/frontend-shell/audit.md @@ -942,3 +942,49 @@ Verder heb ik de vraag ook beantwoord" **Context**: OPERATIONS - Deployment pipeline adjustment verified --- + +## Monitoring Setup - Approval + +**Timestamp**: 2026-10-19T13:02:24Z + +**User Input**: "helemaal goed. ga door naar Production Readiness" + +**AI Response**: "Monitoring Setup marked approved (Sentry + Umami verified on test: Sentry event in environment test with the commit as release, owner saw it and resolved it; Umami counted the owner's own visit, headless Chrome is ignored as a bot). Started Production Readiness Validation: not a .NET project (no .csproj, api/ empty), so the appsettings check is skipped. Rollback (rollback-plan.md), backups (static site, nothing to back up), secrets (Gitea secrets; DSN/Umami IDs public by design) and alert ownership (owner, Q7 = A) are covered. Open gaps put in operations/plans/production-readiness-questions.md: production dress rehearsal, www.andreaslop.nl, incident runbook, SSH password for deploy-test, privacy statement before go-live." + +**Context**: OPERATIONS - Monitoring Setup complete; Production Readiness Validation started, awaiting answers + +--- + +## Production Readiness Validation - Answers + +**Timestamp**: 2026-10-19T13:49:14Z + +**User Input**: "ik heb de vragen beantwoord" + +**AI Response**: "Answers: Q1 B ('want ik heb de hosting nog niet dus kan dat nog niet testen'), Q2 A, Q3 B, Q4 B, Q5 A. Implemented Q2: web.config redirects www.andreaslop.nl with 301 to https://andreaslop.nl in one step (rule before HTTPS; productionHost in serverConfig.ts; tests for the rule, its order and that the target is the monitored production host); regenerated web.config; lint, format, typecheck, 111 tests and build green. Deployment instructions go-live: www check in the dress rehearsal, privacy statement as blocking step before the DNS switch (Q5 A), certificate must cover www, post-go-live monitoring checks. Created operations/production-readiness-checklist.md. Not committed (commit/push only on request)." + +**Context**: OPERATIONS - Production Readiness Validation + +--- + +## Production Readiness Validation - Complete + +**Timestamp**: 2026-10-19T13:49:14Z + +**Overall Readiness**: Yes with caveats (production go-live belongs to the feature that fills the pages; hosting not yet available) + +**Feature Status**: Complete + +--- + +## Production Readiness Validation - Commit and Push + +**Timestamp**: 2026-10-19T14:14:26Z + +**User Input**: "heb je alle changes al gepusht" / "ja doe dat maar" + +**AI Response**: "Committing the www redirect, go-live instructions, readiness checklist and questions, state, registry and audit, and pushing together with the local runner-docs commit to PR #4; watching the run until green." + +**Context**: Feature complete; commit/push on request + +--- diff --git a/aidlc-docs/features/frontend-shell/operations/deployment/deployment-instructions.md b/aidlc-docs/features/frontend-shell/operations/deployment/deployment-instructions.md index 8d374d8..23db185 100644 --- a/aidlc-docs/features/frontend-shell/operations/deployment/deployment-instructions.md +++ b/aidlc-docs/features/frontend-shell/operations/deployment/deployment-instructions.md @@ -123,10 +123,14 @@ git rm --cached -r -q . && git reset --hard - an unknown URL (the 404 page) - the five security headers (`curl -sI`) - that HTTP redirects to HTTPS + - that `www.andreaslop.nl` (also add it to the `hosts` entry) redirects with 301 to `https://andreaslop.nl/` in one step, path included - Remove the `hosts` entry afterwards. -2. Switch the DNS of `andreaslop.nl` (and `www`) to the new host, and make sure HTTPS is active. -3. Set `HEALTH_CHECK_URL_PRODUCTION` so every deploy is checked from then on. -4. Verify the live headers: `curl -sI https://andreaslop.nl/` must show all five security headers. +2. **Privacy statement first (blocking).** The privacy statement page must mention Umami (anonymous, cookieless, self-hosted in the Netherlands) and Sentry (error reports without IP address or personal data, EU region). Do not switch the DNS before it does. +3. Switch the DNS of `andreaslop.nl` and `www` to the new host, and make sure HTTPS is active for both (the certificate must cover `www`, otherwise the redirect shows a certificate error first). +4. Set `HEALTH_CHECK_URL_PRODUCTION` so every deploy is checked from then on. +5. Verify the live headers: `curl -sI https://andreaslop.nl/` must show all five security headers. +6. Add the UptimeRobot deep-link monitor for `https://andreaslop.nl/portfolio` (monitoring-setup §3). +7. Check the monitoring on production: a test error in the console arrives in Sentry under `production`, and a visit shows in Umami's production website. ## 3. If something fails diff --git a/aidlc-docs/features/frontend-shell/operations/plans/production-readiness-questions.md b/aidlc-docs/features/frontend-shell/operations/plans/production-readiness-questions.md new file mode 100644 index 0000000..3002d4d --- /dev/null +++ b/aidlc-docs/features/frontend-shell/operations/plans/production-readiness-questions.md @@ -0,0 +1,61 @@ +# Production Readiness — vragen + +Al geregeld en daarom geen vraag: + +- **Rollback**: [rollback-plan.md](../deployment/rollback-plan.md), een vorige versie opnieuw deployen via de pipeline. Op test is die route vandaag een paar keer gebruikt. +- **Back-ups**: niet nodig voor deze feature. De site is statisch en alles staat in git; er is geen database of upload. +- **Secrets**: de Pi- en FTP-gegevens staan als secrets in Gitea. De Sentry-DSN en de Umami-ID's zijn openbaar en staan bewust in de code (M2). +- **Eigenaarschap van alerts**: jij krijgt alle mails (Sentry: nieuw issue; UptimeRobot: site down) en lost ze op (Q7 = A). + +Vul na elke vraag je antwoord in achter `[Answer]:`. + +## Vraag 1: Generale repetitie productie + +De productie-deploy (FTPS naar IIS bij MijnHostingPartner) heeft nog nooit gedraaid. Test draait op nginx; `web.config`, de IIS-rewrite voor deep links en de FTPS-upload zijn dus alleen getest met de generator-tests. Zolang de DNS naar de huidige host wijst, raakt een deploy naar de nieuwe host geen bezoekers (D12). + +- A) Nu een generale repetitie: een `release/0.1`-branch, de workflow met **Deploy to Production**, en daarna de site via een tijdelijke `hosts`-regel controleren (home, deep link, headers). Pas daarna is de feature klaar. **(aanbevolen)** +- B) Pas bij de livegang, als onderdeel van de feature die de pagina's vult. In de checklist komt het als open punt. +- C) Other (beschrijf hieronder) + +[Answer]: B, want ik heb de hosting nog niet dus kan dat nog niet testen. + +## Vraag 2: www.andreaslop.nl + +De go-live-stappen zetten de DNS van `andreaslop.nl` **en `www`** naar de nieuwe host. De site meet alleen op `andreaslop.nl` en `test.andreaslop.nl` (M1). Een bezoeker op `www.andreaslop.nl` krijgt dus geen Sentry en geen Umami, en Google ziet twee adressen voor dezelfde pagina's. + +- A) `web.config` stuurt `www.andreaslop.nl` permanent (301) door naar `https://andreaslop.nl`, via de generator met een test. Monitoring en SEO zien dan één adres. **(aanbevolen)** +- B) `www.andreaslop.nl` toevoegen aan de monitoringconfig als productie, zonder doorverwijzing. +- C) Geen `www`-record aanmaken; alleen `andreaslop.nl`. +- D) Other (beschrijf hieronder) + +[Answer]: A + +## Vraag 3: Wat te doen bij een melding + +Er komen twee soorten mails binnen: een nieuw issue in Sentry en "site down" van UptimeRobot. De deployment-instructies hebben een tabel met problemen in de pipeline, maar niet wat je doet als zo'n mail binnenkomt. + +- A) Een korte runbook-pagina (`operations/runbook.md`): per soort melding wat je eerst controleert, hoe je terugzet en wie je belt (hoster, Pi). **(aanbevolen)** +- B) Niet nodig: ik ben de enige beheerder en ken de opzet. De rollback- en deployment-documenten zijn genoeg. +- C) Other (beschrijf hieronder) + +[Answer]: B + +## Vraag 4: SSH-wachtwoord voor de test-deploy + +`deploy-test` logt op de Pi in met het wachtwoord van `gitea-workflow` (secret `PI_MAIN_PASSWORD`). Deployment-instructies 1.4 beschrijft de overstap naar een SSH-sleutel. De Pi bereikt zichzelf, dus het wachtwoord gaat niet over internet, maar het werkt wel voor elke SSH-login van die gebruiker. + +- A) Nu overstappen op een sleutel, alleen voor `gitea-workflow`, en de wachtwoord-login voor die gebruiker uitzetten. +- B) Als open punt laten staan; later, samen met je andere projecten die hetzelfde doen. **(aanbevolen: het is een wijziging aan alle pipelines op de Pi, niet alleen deze)** +- C) Other (beschrijf hieronder) + +[Answer]: B + +## Vraag 5: Privacyverklaring vóór de livegang + +Het monitoringplan legt vast dat de privacyverklaring Umami (anoniem, zonder cookies, eigen server in Nederland) en Sentry (foutmeldingen zonder IP of persoonsgegevens, EU-regio) moet noemen. De pagina is nu nog een placeholder. + +- A) Als harde voorwaarde voor de livegang in de checklist: de DNS gaat pas om als de privacyverklaring dit noemt. **(aanbevolen)** +- B) Als gewoon open punt, zonder dat het de livegang blokkeert. +- C) Other (beschrijf hieronder) + +[Answer]: A diff --git a/aidlc-docs/features/frontend-shell/operations/production-readiness-checklist.md b/aidlc-docs/features/frontend-shell/operations/production-readiness-checklist.md new file mode 100644 index 0000000..6284d8b --- /dev/null +++ b/aidlc-docs/features/frontend-shell/operations/production-readiness-checklist.md @@ -0,0 +1,41 @@ +# Production Readiness Checklist — frontend-shell + +Answers: [production-readiness-questions.md](plans/production-readiness-questions.md) (Q1 = B, Q2 = A, Q3 = B, Q4 = B, Q5 = A). + +## Deployment +- **Status**: Configured +- **Method**: CI/CD with Gitea Actions ([deployment-plan.md](deployment/deployment-plan.md)). + - Test: automatic from `master` or by hand, SSH/scp to nginx on the Raspberry Pi. Verified many times on `test.andreaslop.nl`. + - Production: by hand from `release/*`, FTPS to IIS at the hoster. **Never run yet**: the hosting package does not exist yet (Q1 = B). + - Runners: the Pi (always on, does everything) plus an optional PC runner for `check` and `lighthouse`. A single runner deploys before Lighthouse. Verified on 2026-10-19 with both runners and with the Pi only. +- **Rollback Plan**: Yes, [rollback-plan.md](deployment/rollback-plan.md): redeploy a previous version through the pipeline. Used on test; not yet on production. +- **www**: `web.config` redirects `www.andreaslop.nl` with 301 to `https://andreaslop.nl` in one step (Q2 = A), covered by a generator test. + +## Monitoring +- **Status**: Configured ([monitoring-plan.md](monitoring/monitoring-plan.md), [monitoring-setup.md](monitoring/monitoring-setup.md)) +- **Approach**: + - **Sentry** (EU, project `andreaslop-fotografie`): JavaScript errors only, without personal data. Verified on test: event under environment `test`, with the commit as release. + - **Umami** (self-hosted): cookieless visits, a separate website per environment. Verified on test with a real visit. + - **UptimeRobot**: availability of test and production. The monitors are the owner's one-time step and were not checked by the AI. + - **Alerts**: by e-mail to the owner, for a new Sentry issue and for a site that is down. + - Monitoring only runs on `andreaslop.nl` and `test.andreaslop.nl`; local and CI runs send nothing. + +## Additional Readiness Items +- **Backups**: Not needed. The site is static and everything is in git; this feature has no database or uploads. With the future .NET API and database, the rollback plan already describes backups before migrations. +- **Secrets Management**: Covered. + - Pi and FTP credentials are Gitea secrets. + - The Sentry DSN and Umami website IDs are public by design and live in `src/monitoring/config.ts` (M2). + - Open: `deploy-test` still logs in with an SSH password instead of a key (Q4 = B, later for all pipelines on the Pi together). +- **Runbook/Support Handover**: Not needed (Q3 = B): one administrator who knows the setup. Guidance lives in [rollback-plan.md](deployment/rollback-plan.md) and the troubleshooting table in [deployment-instructions.md](deployment/deployment-instructions.md). +- **Alert Ownership**: The owner receives every alert and owns the fix (Q7 = A). + +## Overall Readiness +- **Ready for Production**: Yes with caveats. The feature is complete and runs on test. Production is blocked until the go-live, which belongs to the feature that fills the pages: the hosting and the content do not exist yet (D12). +- **Open Follow-ups**: + 1. **Dress rehearsal on the production host** (Q1 = B), once the hosting package exists: production deploy, then check home, deep link, 404, headers, HTTP→HTTPS and the www redirect (deployment-instructions, Go-live step 1). + 2. **Privacy statement mentions Umami and Sentry: blocks the DNS switch** (Q5 = A; Go-live step 2). + 3. **HTTPS certificate covers `www.andreaslop.nl`** at the switch, so the 301 works without a certificate error. + 4. **After go-live**: set `HEALTH_CHECK_URL_PRODUCTION`, add the UptimeRobot deep-link monitor for `/portfolio`, and check Sentry and Umami on production. + 5. **SSH key instead of a password** for `gitea-workflow`, together with the owner's other pipelines on the Pi (Q4 = B). + 6. **Sentry tunnel** against ad-blockers, together with the .NET API (M3). + 7. **Container actions on the Podman runners** do not work (409 on attach). The workflow uses none; keep that in mind for new workflows. diff --git a/web/config/serverConfig.test.ts b/web/config/serverConfig.test.ts index 35abe1d..5eed5c4 100644 --- a/web/config/serverConfig.test.ts +++ b/web/config/serverConfig.test.ts @@ -1,10 +1,12 @@ import { readFileSync } from 'node:fs'; import { describe, expect, it } from 'vitest'; +import { monitoringFor } from '../src/monitoring/config'; import { securityHeaders } from './securityHeaders'; import { iisWebConfig, nginxProxyConf, nginxTestConf, + productionHost, serverConfigFiles, } from './serverConfig'; @@ -29,6 +31,24 @@ describe('serverconfiguratie', () => { } }); + it('IIS stuurt www in één stap door naar https://andreaslop.nl', () => { + const iis = iisWebConfig(); + expect(iis).toContain( + '', + ); + expect(iis).toContain( + '', + ); + // Vóór de HTTPS-regel, anders eerst http://www → https://www + expect(iis.indexOf('name="www naar')).toBeLessThan( + iis.indexOf('name="HTTPS"'), + ); + }); + + it('www-doorverwijzing verwijst naar de productiehost uit de monitoring', () => { + expect(monitoringFor(productionHost)?.environment).toBe('production'); + }); + it('IIS heeft een SPA-fallback en een HTTPS-redirect', () => { const iis = iisWebConfig(); expect(iis).toContain(''); diff --git a/web/config/serverConfig.ts b/web/config/serverConfig.ts index 8d515e7..4f265c0 100644 --- a/web/config/serverConfig.ts +++ b/web/config/serverConfig.ts @@ -15,7 +15,13 @@ const xmlAttribute = (value: string) => .replace(//g, '>'); -// IIS (productie): security headers, HTTPS-redirect, SPA-fallback en caching. +// De enige productiehost: www stuurt hierheen door, zodat monitoring (alleen +// op deze hostname) en zoekmachines één adres zien +export const productionHost = 'andreaslop.nl'; + +// IIS (productie): www-doorverwijzing, security headers, HTTPS-redirect, +// SPA-fallback en caching. De www-regel staat vóór HTTPS, zodat +// http://www. in één stap op https://andreaslop.nl uitkomt. // Bestanden in /assets hebben een hash in de naam en mogen lang gecachet // worden; index.html nooit, zodat een nieuwe release direct zichtbaar is. export function iisWebConfig(): string { @@ -32,6 +38,13 @@ export function iisWebConfig(): string { + + + + + + + diff --git a/web/deploy/iis/web.config b/web/deploy/iis/web.config index 8d10e70..5a7fc91 100644 --- a/web/deploy/iis/web.config +++ b/web/deploy/iis/web.config @@ -4,6 +4,13 @@ + + + + + + +