Merge pull request 'Prepares the test site for the CMS host' (#17) from feature/cms-api-foundation into master
This commit was merged in pull request #17.
This commit is contained in:
@@ -113,6 +113,11 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# Voor config/printCsp.ts (de exacte CSP in de controle na deploy)
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- name: Download build artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
@@ -161,9 +166,17 @@ jobs:
|
||||
- name: Controle na deploy
|
||||
env:
|
||||
HEALTH_URL: ${{ vars.HEALTH_CHECK_URL_TEST }}
|
||||
# 'true' zodra test.andreaslop.nl door de CMS-host (Api.AndreaSlopFotografie)
|
||||
# wordt bediend in plaats van nginx: dan controleert het script ook de
|
||||
# exacte CSP en de CMS-routes. Zet hem om samen met de proxy-route.
|
||||
SERVED_BY_CMS: ${{ vars.ASF_TEST_SERVED_BY_CMS }}
|
||||
run: |
|
||||
if [ -z "$HEALTH_URL" ]; then echo "Geen HEALTH_CHECK_URL_TEST ingesteld; overgeslagen"; exit 0; fi
|
||||
bash deploy/verify-deployment.sh "$HEALTH_URL" dist --test
|
||||
if [ "$SERVED_BY_CMS" = "true" ]; then
|
||||
EXPECTED_CSP="$(node config/printCsp.ts)" bash deploy/verify-deployment.sh "$HEALTH_URL" dist --test --cms
|
||||
else
|
||||
bash deploy/verify-deployment.sh "$HEALTH_URL" dist --test
|
||||
fi
|
||||
echo "Test bereikbaar en gelijk aan de build"
|
||||
|
||||
# Lighthouse tegen de gebouwde site (mobiel en desktop)
|
||||
|
||||
@@ -12,3 +12,4 @@
|
||||
| Feature | shoot-type-pages | ✅ Complete (content follow-up: [content-pending.md](features/shoot-type-pages/content-pending.md)) | feature/shoot-type-pages (worktree ../AndreaSlopFotografie-shoot-type-pages) | new route(s) per shoot type under web/src/routes, web/src/content (shootTypes.ts extension, timeline content), shared Timeline component, links from soorten-fotoshoots, seo.ts (webPage helper), sitePages.ts / sitemap, lighthouserc.cjs | 2026-10-29 |
|
||||
| Feature | prerendering | ✅ Complete (merge pending) | feature/prerendering (worktree ../AndreaSlopFotografie-prerendering) | web/vite.config.ts, web/src/main.tsx, web/index.html, web/config/serverConfig.ts + web/deploy, CI workflow, web/lighthouserc.cjs, possibly Reveal/useReveal and hooks using media queries | 2026-10-31 |
|
||||
| Feature | testimonials-redesign | ✅ Complete (pull request next) | feature/testimonials-redesign (worktree ../AndreaSlopFotografie-testimonials-redesign) | web/src/components/home/Testimonials (Testimonials, TestimonialSlide, TestimonialCarousel), web/src/recipes/carouselControl.ts, web/src/content (Testimonial type, testimonials.ts), possibly SectionHeading, LAYOUT.md, unit/e2e tests that reference the dots | 2026-11-05 |
|
||||
| Feature | cms-api-foundation | 🟢 Construction | feature/cms-api-foundation (worktree ../AndreaSlopFotografie-cms-api-foundation) | Cross-repo: feature briefs for the SlpModularCms repo (new Api.AndreaSlopFotografie client, per-site theming, per-site module set); in this repo only docs, later web integration (CMS serves the site) | 2026-11-05 |
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
# AI-DLC State Tracking
|
||||
|
||||
## Project Information
|
||||
- **Feature Name**: CMS & API foundation (Andrea Slop client on SlpModularCms: theming per site, per-site module set, CMS serves the site)
|
||||
- **Feature Slug**: cms-api-foundation
|
||||
- **Project Type**: Brownfield (cross-repo: this web repo + the separate SlpModularCms repo at K:\Development\Projects\SlpModularCms)
|
||||
- **Start Date**: 2026-11-05T23:06:41Z
|
||||
- **Current Stage**: CONSTRUCTION - U1 and U2 handed back by the CMS session (2026-11-07, not pushed, not deployed); U2 Build and Test awaits Bryan there, CI vulnerability-scan decision open; Pi preparation 19a/19b done; U3 (web repo) not started
|
||||
- **Branch**: feature/cms-api-foundation (from master c8ca5eb)
|
||||
- **Worktree**: K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-cms-api-foundation
|
||||
|
||||
## Workspace State
|
||||
- **Existing Code**: Yes
|
||||
- **Reverse Engineering Needed**: No (team agreement: no full RE refresh per feature; the CMS repo has its own aidlc-docs and is the CMS session's concern)
|
||||
- **Workspace Root**: K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-cms-api-foundation
|
||||
|
||||
## Code Location Rules
|
||||
- **Application Code**: Workspace root (NEVER in aidlc-docs/). Web code in web/; the CMS code lives in the separate SlpModularCms repo and is built by the CMS session (AndreaSlopFotografie [dbb9e4], confirmed by the user), NOT from this session
|
||||
- **Feature Documentation**: aidlc-docs/features/cms-api-foundation/ only
|
||||
- **Shared Artifacts**: aidlc-docs/_shared/
|
||||
|
||||
## Language Configuration
|
||||
- **Documentation Language**: English
|
||||
- **Conversation Language**: User Language (Dutch)
|
||||
- **Source**: inherited from aidlc-docs/language-preference.md (answer A); user may override
|
||||
|
||||
## Cross-session coordination
|
||||
- A parallel session works on feature testimonials-redesign (worktree AndreaSlopFotografie-testimonials-redesign). It also edits aidlc-docs/active-features.md: expect a trivial row-level merge conflict there. This feature must not touch web/ files owned by testimonials-redesign until it is merged.
|
||||
- The CMS repo has its own AIDLC workspace (features/ + active-features.md). Hand-offs go as feature briefs; the CMS session runs its own AIDLC.
|
||||
|
||||
## Extension Configuration
|
||||
|
||||
|
||||
## Stage Progress
|
||||
- [x] INCEPTION - Workspace Detection (2026-11-05T23:06:41Z)
|
||||
- [x] INCEPTION - Requirements Analysis (approved)
|
||||
|
||||
## Extension Configuration
|
||||
| Extension | Enabled | Decided At |
|
||||
|---|---|---|
|
||||
| Security Baseline | Yes | Requirements Analysis |
|
||||
| Property-Based Testing | Partial (only PBT-02, PBT-03, PBT-07, PBT-08, PBT-09 enforced; others advisory) | Requirements Analysis |
|
||||
|
||||
## Operations Configuration
|
||||
- **Include Operations Phase**: Yes
|
||||
- **Decided At**: Requirements Analysis
|
||||
- [x] INCEPTION - User Stories: SKIP (one persona; acceptance criteria in requirements)
|
||||
- [x] INCEPTION - Reverse Engineering: SKIP (team agreement)
|
||||
- [x] INCEPTION - Workflow Planning (approved)
|
||||
- [x] INCEPTION - Application Design (approved)
|
||||
- [x] INCEPTION - Units Generation (approved): 3 units: U1 core-site-hosting (CMS), U2 andreaslop-client (CMS), U3 site-delivery (WEB)
|
||||
- [ ] CONSTRUCTION - Functional Design: EXECUTE (U1), SKIP (U2)
|
||||
- [ ] CONSTRUCTION - NFR Requirements: EXECUTE (U1), SKIP (U2)
|
||||
- [ ] CONSTRUCTION - NFR Design: EXECUTE (U1), SKIP (U2)
|
||||
- [ ] CONSTRUCTION - Infrastructure Design: EXECUTE (U1, U2)
|
||||
- [ ] CONSTRUCTION - Code Generation: EXECUTE (per unit)
|
||||
- [ ] CONSTRUCTION - Build and Test: EXECUTE
|
||||
- [ ] OPERATIONS - Deployment Setup, Monitoring Setup, Production Readiness: EXECUTE (Operations = Yes)
|
||||
@@ -0,0 +1,625 @@
|
||||
# Audit Log: cms-api-foundation
|
||||
|
||||
## Workspace Detection - Initial Request (user messages that started this feature, raw)
|
||||
|
||||
**Timestamp**: 2026-11-05T23:06:41Z
|
||||
|
||||
**User Input (message 1)**: "Ik wil een start gaan maken aan de API en het CMS. Nou heb ik een modulaire CMS gebouwd die ik wil uitbreiden om de nodige functionaliteit toe te voegen. Hoe kan ik dat het beste aanpakken? Ik zat te denken aan de volgende opties:
|
||||
|
||||
1. Een hand-off laten maken door jou die ik aan de agent van de CMS kan geven die dan de benodigde functionaliteiten inbouwt en weer een hand-off teruggeeft met de implementatie.
|
||||
2. Een sessie starten in die workspace waar jij mee gaat communiceren. De CMS workspace moet ook werken met AIDLC workflow. Die zou jij dan kunnen aansturen en de vragen zelf beantwoorden en als je het echt niet weet alsnog aan mij stellen.
|
||||
3. Eventueel een andere manier waar ik niet aan heb gedacht. Doe eventueel suggesties als je andere ideeën hebt.
|
||||
|
||||
Voer nog niks uit maar denk alleen even mee met mij. Ik wil per feature laten opzetten. beginnend met de basis waar we eerst een werkende CMS met API opzetten met Authentricatie. Dan verder met de features zoals pakketten, contact formulier etc"
|
||||
|
||||
**User Input (message 2)**: "Hybride klinkt goed, maar kijk ook even wat de CMS al doet. Er is namelijk al een basis-opzet waar onder andere al registraties in kunnen worden gedaan. Ook is er al een stijl. Willen we de CMS dichtbij de site styling willen laten komen moet er op z'n minst theming wordne toegevoegd. Het CMS moet met meerdere websites gebruikt kunnen worden. Per websites moeten modules ana en uit kunnen wordne gezet. Op dit moment ben ik ook nog bezig met de testimonials in een andere sessie. Daar moet je niet me egaan conflicteren.
|
||||
|
||||
Het CMS staat in een eigen repo. Er is een sessie in slp-modular-cms genaamd AndreaSlopFotografie. Die kunnen we gebruiken."
|
||||
|
||||
**User Input (message 3)**: "Allereerst wil ik deze sessie ook gebruik maken van AIDLC odra we echt beginnen met het opzetten. Dan de antwoorden op je vragen:
|
||||
|
||||
1. Ja, dat klopt.
|
||||
2. Nee, het thema moet idealiter vast staan. Dit moet dus ook per website anders kunnen zijn om aan te sluiten op de front-end van de website.
|
||||
3. Ik denk dat je bedoelt of die het beschreven patroon gebruikt zoals SLP Software dat ook doet. Dan is het antwoord ja. De API moet de CMS en de website gaan serveren. De host heeft namelijk maar ruimte voor 1 website dus ik moet dat slim opetten."
|
||||
|
||||
**AI Response**: Read the SlpModularCms repo (read-only) and answered with findings: .NET 10 modular monolith + MariaDB, modules Identity/Master/Availability/Offerings, per-site client projects via shared CmsHost (Api.SlpSoftware pattern), single-host serving of / (wwwroot/web), /admin, /api/v1, no theming present. Questions 1-3 asked; user answered (message 3). Invoked the aidlc-workflow skill, created worktree + branch feature/cms-api-foundation and this feature directory.
|
||||
|
||||
**Context**: Workspace Detection. Classification: Feature (new capability, cross-repo). Decisions captured from the user: (1) per-deployment multi-site with a config switch per module; (2) theme is fixed per site (not admin-editable), different per website, matching that site's front-end; (3) the API host serves both CMS and website (pattern of Api.SlpSoftware); the host has room for only one website, so this must be set up smartly.
|
||||
|
||||
---
|
||||
|
||||
## Conflict Detection
|
||||
|
||||
**Timestamp**: 2026-11-05T23:06:41Z
|
||||
|
||||
**AI Response**: Potential conflict with active feature testimonials-redesign (separate worktree): both touch aidlc-docs/active-features.md (row-level merge, trivial). testimonials-redesign also edits web/ testimonials components; this feature does not touch web/ in Inception.
|
||||
|
||||
**Context**: Informational only; developer handles at merge time.
|
||||
|
||||
---
|
||||
|
||||
## Session Confirmation
|
||||
|
||||
**Timestamp**: 2026-11-05T23:06:51Z
|
||||
|
||||
**User Input**: "En ja, met AndreaSlopFotografie bedoelde ik de CMS sessie"
|
||||
|
||||
**AI Response**: Recorded session AndreaSlopFotografie [dbb9e4] as the CMS session in aidlc-state.md.
|
||||
|
||||
**Context**: Workspace Detection; cross-session coordination.
|
||||
|
||||
---
|
||||
|
||||
## Requirements Analysis - questions issued
|
||||
|
||||
**Timestamp**: 2026-11-05T23:08:15Z
|
||||
|
||||
**AI Response**: Created inception/requirements/requirement-verification-questions.md (13 questions, incl. Security Baseline, PBT and Operations opt-ins). Awaiting the user answers in the file.
|
||||
|
||||
**Context**: Requirements Analysis, depth Standard to Comprehensive (cross-repo, security-relevant: CSP, auth). Reverse Engineering skipped per team agreement.
|
||||
|
||||
---
|
||||
|
||||
## Requirements Analysis - answers received (interactive, in chat)
|
||||
|
||||
**Timestamp**: 2026-11-05T23:27:52Z
|
||||
|
||||
**User Input**: "Q1 CMS + web, bewezen op test (Recommended); Q2 de vraag is of we prerendering willen houden. ik wil niet bij elke aanpassing op de website moetne rebuilden. Maar wat zijn alternatieven? Server side rendering? Of iets anders?; Q3 Client bepaalt CSP, strikt (Recommended); Q4 Is client-project de Andrea Slop Fotografie website? Kan je optie A eens toelichten?; then: Q2 is de node-proces ook te doen op mijnhostingpartner.nl? Ik heb het liefst SSR omdat ik onafhankelijk van de build pipeline wil zijn; Q4 Kunnen we een Admin-build per site doen waar alleen de thema file wordt aangegeven? Ik zie niet zo goed hoe we front-end styling in de API willen gaan zetten.; Q5 Kleuren, radius, font, logo, favicon (Recommended); Q6 Met deze feature bedoel je zeg maar stap 0? Want uiteindelijk hebben we de offerings nodig voor de pakketten, maar die hoeven we pas aan te zetten zodra we die erin gaan zetten.; then: Q2 Prerender-modus nu, SSR later (Recommended); Q7 Zoals nu, geen nieuwe rollen (Recommended); Q8 Nederlands, per site vast (Recommended); Q9 Eerst alleen test (Recommended); Q10 Hybride (Recommended); Q11 Ja, afdwingen (Recommended); Q12 Gedeeltelijk; Q13 Ja"
|
||||
|
||||
**AI Response**: Answered the clarifications (client project = Api.AndreaSlopFotografie host in the CMS repo; theme via per-site theme file; Node unknown on the hosting partner). Recorded all 13 answers in requirement-verification-questions.md and the extension/operations configuration in aidlc-state.md.
|
||||
|
||||
**Context**: Requirements Analysis. Security Baseline Yes, PBT Partial, Operations Yes.
|
||||
|
||||
---
|
||||
|
||||
## Requirements Analysis - approval prompt
|
||||
|
||||
**Timestamp**: 2026-11-05T23:28:43Z
|
||||
|
||||
**AI Response**: Presented requirements.md for review (options: Request Changes / Add User Stories / Continue to Next Stage). Security compliance at this stage: no blocking findings; rules assessed per stage.
|
||||
|
||||
**Context**: Requirements Analysis complete, waiting for explicit approval.
|
||||
|
||||
---
|
||||
|
||||
## Requirements Analysis - approval
|
||||
|
||||
**Timestamp**: 2026-11-05T23:29:50Z
|
||||
|
||||
**User Input**: "ga verder"
|
||||
|
||||
**AI Response**: Requirements approved (User Stories skipped). Proceeding to Workflow Planning.
|
||||
|
||||
**Context**: Requirements Analysis approved.
|
||||
|
||||
---
|
||||
|
||||
## Workflow Planning - approval prompt
|
||||
|
||||
**Timestamp**: 2026-11-05T23:30:43Z
|
||||
|
||||
**AI Prompt**: "Ready to proceed with this plan?" (options: Request Changes / Add Skipped Stages / Continue to Next Stage)
|
||||
|
||||
**Context**: Execution plan created: Application Design and Units Generation execute; User Stories and Reverse Engineering skipped; two units (U1 cms-host built by the CMS session, U2 site-delivery here); Operations included. Risk Medium-High.
|
||||
|
||||
---
|
||||
|
||||
## Workflow Planning - approval
|
||||
|
||||
**Timestamp**: 2026-11-05T23:34:28Z
|
||||
|
||||
**User Input**: "Goedgekeurd, ga verder"
|
||||
|
||||
**AI Response**: Plan approved. Proceeding to Application Design.
|
||||
|
||||
**Context**: Workflow Planning approved.
|
||||
|
||||
---
|
||||
|
||||
## Application Design - requirement change (module set)
|
||||
|
||||
**Timestamp**: 2026-11-05T23:48:18Z
|
||||
|
||||
**User Input**: "Het idee achter die DLL's was dat ik niet standaard alle functionaliteiten wil meebuilden, maar dat bij het toevoegen van een DLL de module wordt aan gezet."
|
||||
|
||||
**AI Response**: Design question 1 answered as: module set = DLLs referenced by the client project (existing mechanism); no configuration filter in the shared host. FR-2 in requirements.md and the module-switch mentions in execution-plan.md were updated accordingly. Also answered: Q2 StrictSite policy in CspPolicyCatalog; Q3 CSP drift check in web verify-deployment; Q4 hosting parity for what the site needs.
|
||||
|
||||
**Context**: Application Design; requirement refinement (supersedes the Q1 requirements assumption of a per-module configuration switch).
|
||||
|
||||
---
|
||||
|
||||
## Application Design - answers received (interactive, in chat)
|
||||
|
||||
**Timestamp**: 2026-11-05T23:50:31Z
|
||||
|
||||
**User Input**: "Q1 Het idee achter die DLL's was dat ik niet standaard alle functionaliteiten wil meebuilden, maar dat bij het toevoegen van een DLL de module wordt aan gezet.; Q2 Derde policy StrictSite (Recommended); Q3 Check in verify-deployment (Recommended); Q4 Pariteit voor wat de site nodig heeft (Recommended); Q5 Modus in code, omgeving in appsettings (Recommended); Q6 Map met CSS-override (Recommended); Q7 Kopie in de CMS-repo"
|
||||
|
||||
**AI Response**: Recorded in application-design-plan.md; generating the application design artifacts.
|
||||
|
||||
**Context**: Application Design.
|
||||
|
||||
---
|
||||
|
||||
## Application Design - approval prompt
|
||||
|
||||
**Timestamp**: 2026-11-05T23:52:05Z
|
||||
|
||||
**AI Response**: Presented application-design/ (components, methods, services, dependencies, consolidated) for review (options: Request Changes / Continue to Next Stage). Security compliance: no blocking findings; SECURITY-01,02,03,06,07,14 deferred to NFR/Infrastructure stages.
|
||||
|
||||
**Context**: Application Design complete, waiting for explicit approval.
|
||||
|
||||
---
|
||||
|
||||
## Application Design - approval
|
||||
|
||||
**Timestamp**: 2026-11-05T23:59:30Z
|
||||
|
||||
**User Input**: "Ga verder"
|
||||
|
||||
**AI Response**: Application design approved. Proceeding to Units Generation.
|
||||
|
||||
**Context**: Application Design approved.
|
||||
|
||||
---
|
||||
|
||||
## Units Generation - answers received (interactive, in chat)
|
||||
|
||||
**Timestamp**: 2026-11-06T00:02:46Z
|
||||
|
||||
**User Input**: "Q1 Twee CMS units. Maar de naam mag worden Api.AndreaSlopFotografie in plaats van Api.AndreaSlop; Q2 Eén brief voor beide"
|
||||
|
||||
**AI Response**: Renamed the planned client project to SlpModularCms.Api.AndreaSlopFotografie in all feature documents. Two CMS units, one brief for both (checkpoint after U1 requested in the brief).
|
||||
|
||||
**Context**: Units Generation.
|
||||
|
||||
---
|
||||
|
||||
## Units Generation - approval prompt
|
||||
|
||||
**Timestamp**: 2026-11-06T00:03:30Z
|
||||
|
||||
**AI Response**: Presented unit-of-work.md, unit-of-work-dependency.md and unit-of-work-story-map.md (options: Request Changes / Continue to Next Stage).
|
||||
|
||||
**Context**: Units Generation complete, waiting for explicit approval.
|
||||
|
||||
---
|
||||
|
||||
## Units Generation - approval
|
||||
|
||||
**Timestamp**: 2026-11-06T00:04:16Z
|
||||
|
||||
**User Input**: "Ga verder"
|
||||
|
||||
**AI Response**: Units approved. Entering the Construction phase; first step is the brief for the CMS session (U1 and U2).
|
||||
|
||||
**Context**: Units Generation approved.
|
||||
|
||||
---
|
||||
|
||||
## Construction - brief written and copied
|
||||
|
||||
**Timestamp**: 2026-11-06T00:05:14Z
|
||||
|
||||
**AI Response**: Wrote construction/cms-host/brief-u1-u2.md (one brief for U1 and U2, checkpoint after U1). Copied it to the CMS repo at aidlc-docs/_shared/handoffs/cms-api-foundation-brief-u1-u2.md (owner decision: copy in the CMS repo). Message to the CMS session follows.
|
||||
|
||||
**Context**: Construction, hand-off of U1 and U2.
|
||||
|
||||
---
|
||||
|
||||
## Construction - brief sent
|
||||
|
||||
**Timestamp**: 2026-11-06T00:05:21Z
|
||||
|
||||
**AI Response**: Sent the brief to the CMS session AndreaSlopFotografie [dbb9e4] via SendMessage (msg_id b840598d-bea9-4ac4-ba49-b5e5a33d1c3a). Delivered to its inbox; not yet confirmed as read.
|
||||
|
||||
**Context**: Construction, U1 and U2 handed to the CMS session. This session waits for its questions and the U1 hand-back.
|
||||
|
||||
---
|
||||
|
||||
## Construction - CMS session status and answers relayed
|
||||
|
||||
**Timestamp**: 2026-11-06T07:42:47Z
|
||||
|
||||
**User Input**: "dubbel check even bij de CMS sessie. De pc is uit geweest en ik denk dat die halverwege is gestopt. Als dat zo is mag je hem dus aangeven weer verder te gaan"
|
||||
|
||||
**AI Response**: Checked the CMS session (restarted, id 89ad65, idle): it was not stopped mid-run but waiting for Bryan answers to its 9 requirement questions. Asked Bryan in chat and relayed the answers (Q1 setup token via config; Q2 branch, PR after U2; Q3 deploy to test allowed, Pi and pipeline still to be set up, contact Pi-Main; Q4 host partly prepared; Q5 theme tokens plus logo and favicon; Q6 skip User Stories; Q7 Security Yes; Q8 PBT partial; Q9 Operations Yes; the CMS session may start the test deploy itself once ready, test only). Sent a read-only inventory request to the Pi-Main - Server session.
|
||||
|
||||
**Context**: Construction, waiting for the CMS session requirements, the Pi inventory and the U1 hand-back. The Testimonials feature (PR 16) merged into master, so the U3 precondition is met; this branch will be updated from master when U3 starts.
|
||||
|
||||
---
|
||||
|
||||
## Construction - Pi inventory and hostname decision
|
||||
|
||||
**Timestamp**: 2026-11-06T07:56:38Z
|
||||
|
||||
**User Input**: "test.andreaslop.nl overnemen (Recommended)" (answer to: on which hostname should Andrea CMS instance run on test)
|
||||
|
||||
**AI Response**: Received the read-only Pi inventory from the Pi-Main - Server session, wrote construction/cms-host/pi-inventory.md and forwarded the key facts plus the hostname decision to the CMS session. No changes were made on the Pi.
|
||||
|
||||
**Context**: Construction. Inputs for U2 Infrastructure Design (CMS session) and U3 (web delivery: possible shared wwwroot-web folder with the existing static deploy).
|
||||
|
||||
---
|
||||
|
||||
## Construction - database naming decided
|
||||
|
||||
**Timestamp**: 2026-11-06T08:11:28Z
|
||||
|
||||
**User Input**: "Als database wil ik liever AndreaSlopFotografieTest en de gebruiker AndreaSlopFotografie in plaats van AndreaSlopCms. CMS is gewoon onderdeel van de website de website en het bedrijf heet AndreaSlopFotografie. Een draft met de commando's en instructies is wel fijn om te krijgen. Dus zodra de definitieve lijst compleet is dan zie ik die graag."
|
||||
|
||||
**AI Response**: Recorded database AndreaSlopFotografieTest and user AndreaSlopFotografie@localhost; informed the CMS session and the Pi-Main session. The command draft is requested from Pi-Main once the CMS session final manual-steps list is complete, then shown to Bryan.
|
||||
|
||||
**Context**: Construction, input for U2 Infrastructure Design.
|
||||
|
||||
---
|
||||
|
||||
## Construction - CMS session waits for Bryan
|
||||
|
||||
**Timestamp**: 2026-11-06T08:59:18Z
|
||||
|
||||
**User Input**: "Wacht de cms sessie ook niet op input van ons? Anders aangeven dat hij daarvoor ook een melding moet geven?"
|
||||
|
||||
**AI Response**: Checked the CMS session audit: requirements.md is generated and awaits Bryan approval in the CMS session; relayed answers are recorded as unconfirmed. Asked the CMS session to message this session whenever it waits for Bryan, and to report when requirements and design are approved.
|
||||
|
||||
**Context**: Construction, U1 and U2 in the CMS session; Bryan must act in that session.
|
||||
|
||||
---
|
||||
|
||||
## Construction - CMS requirements approved (reported)
|
||||
|
||||
**Timestamp**: 2026-11-06T09:18:57Z
|
||||
|
||||
**AI Response**: The CMS session reports that Bryan approved its requirements.md in that session, after seeing the relayed items. Recorded in construction/cms-host/status.md as reported by the CMS session. It now waits for Bryan on its execution plan; design approval follows.
|
||||
|
||||
**Context**: Construction, U1 and U2 in the CMS session.
|
||||
|
||||
---
|
||||
|
||||
## Construction - CMS execution plan approved (reported)
|
||||
|
||||
**Timestamp**: 2026-11-06T09:23:57Z
|
||||
|
||||
**AI Response**: The CMS session reports that Bryan approved its execution plan and that it waits for Bryan on 3 design questions (StrictSite origins, known-page check, setup-token UX). Recorded in construction/cms-host/status.md. No web-side question for this session yet.
|
||||
|
||||
**Context**: Construction, U1 and U2 in the CMS session.
|
||||
|
||||
---
|
||||
|
||||
## Construction - CMS design questions answered
|
||||
|
||||
**Timestamp**: 2026-11-06T09:37:54Z
|
||||
|
||||
**User Input**: "kan jij die vragen niet hier naar mij doorsturen?" Answers (interactive): Q1 Aparte lijsten voor de site (Recommended); Q2 Bestandscheck per verzoek (Recommended); Q3 Veld op de setup-pagina (Recommended)
|
||||
|
||||
**AI Response**: Read the CMS session design questions, asked Bryan in chat, relayed the answers to the CMS session and confirmed the site origins (Umami script and connect, Sentry ingest) from web/config/securityHeaders.ts.
|
||||
|
||||
**Context**: Construction, U1 and U2 in the CMS session; Application Design questions.
|
||||
|
||||
---
|
||||
|
||||
## Construction - CMS design approved (reported)
|
||||
|
||||
**Timestamp**: 2026-11-06T09:52:32Z
|
||||
|
||||
**AI Response**: The CMS session reports that Bryan approved its application design (including his relayed answers Q1-Q3). Recorded in construction/cms-host/status.md. It now waits for Bryan on its minimal unit-of-work.md; then U1 construction starts and it hands back after U1.
|
||||
|
||||
**Context**: Construction, U1 and U2 in the CMS session.
|
||||
|
||||
---
|
||||
|
||||
## Construction - CMS units approved; direction note
|
||||
|
||||
**Timestamp**: 2026-11-06T10:11:08Z
|
||||
|
||||
**AI Response**: The CMS session reports that Bryan approved the units and keeps the full scope; U1 Functional Design started. Recorded the owner direction note (the website becomes increasingly CMS-driven, static share shrinks) in requirements.md and the status log; it feeds the SSR-versus-hybrid decision before the first content feature.
|
||||
|
||||
**Context**: Construction, U1 in the CMS session.
|
||||
|
||||
---
|
||||
|
||||
## Construction - U1 functional design answers
|
||||
|
||||
**Timestamp**: 2026-11-06T12:12:32Z
|
||||
|
||||
**User Input**: Interactive answers: U1-Q1 Volledige set overal (Recommended); U1-Q2 Weigeren, behalve .well-known (Recommended)
|
||||
|
||||
**AI Response**: Relayed to the CMS session. U3 consequence: verify-deployment must assert the same header set on a page, an asset, a 301, robots.txt and the 404 page.
|
||||
|
||||
**Context**: Construction, U1 Functional Design in the CMS session.
|
||||
|
||||
---
|
||||
|
||||
## Construction - U1 functional design review (web side)
|
||||
|
||||
**Timestamp**: 2026-11-06T12:14:28Z
|
||||
|
||||
**AI Response**: Reviewed the CMS session U1 business-rules.md against web/config/canonicalUrls.ts and the generated nginx test config. One deviation (R11, trailing slash) reported to the CMS session with the web-side requirement (BR-HST-03: strip trailing slashes on every path). Other rules consistent. Bryan approves the functional design in the CMS session.
|
||||
|
||||
**Context**: Construction, U1 Functional Design.
|
||||
|
||||
---
|
||||
|
||||
## Construction - R11 adjusted
|
||||
|
||||
**Timestamp**: 2026-11-06T12:14:48Z
|
||||
|
||||
**AI Response**: The CMS session adjusted R11 as requested; verified the new text in business-rules.md. Still waiting for Bryan approval of the U1 functional design in the CMS session.
|
||||
|
||||
**Context**: Construction, U1 Functional Design.
|
||||
|
||||
---
|
||||
|
||||
## Construction - U1 functional design approved (reported)
|
||||
|
||||
**Timestamp**: 2026-11-06T12:15:24Z
|
||||
|
||||
**AI Response**: The CMS session reports that Bryan approved the U1 functional design (including R11 nginx parity). U1 NFR Requirements started. Recorded in construction/cms-host/status.md.
|
||||
|
||||
**Context**: Construction, U1 in the CMS session.
|
||||
|
||||
---
|
||||
|
||||
## Construction - U1 NFR answers
|
||||
|
||||
**Timestamp**: 2026-11-06T13:15:14Z
|
||||
|
||||
**User Input**: Interactive answers: Q1 Alleen gzip (Recommended); Q2 "Alleen waarschuwingen en meer op de pi, op productie later bepalen"; Q3 Aantaltest plus lokale tijdmeting (Recommended)
|
||||
|
||||
**AI Response**: Relayed to the CMS session. Q2 was ambiguous; my interpretation (warnings by default, more on test, production later; per-environment log level of a dedicated category) was stated explicitly so Bryan can correct it. Consequence for U3: verify-deployment accepts gzip only and must not expect br.
|
||||
|
||||
**Context**: Construction, U1 NFR Requirements.
|
||||
|
||||
---
|
||||
|
||||
## Construction - U1 NFR requirements approved (reported)
|
||||
|
||||
**Timestamp**: 2026-11-06T13:18:58Z
|
||||
|
||||
**AI Response**: The CMS session reports that Bryan approved the U1 NFR requirements, including the test-only FsCheck.Xunit dependency. U1 NFR Design started. Recorded in construction/cms-host/status.md.
|
||||
|
||||
**Context**: Construction, U1 in the CMS session.
|
||||
|
||||
---
|
||||
|
||||
## Construction - U1 NFR design approved; infra design skipped
|
||||
|
||||
**Timestamp**: 2026-11-06T13:39:14Z
|
||||
|
||||
**AI Response**: The CMS session reports that Bryan approved the U1 NFR design. Confirmed to the CMS session that U1 Infrastructure Design can be skipped (unit-of-work.md: only if the host change touches deployment, expected none). U1 Code Generation is next.
|
||||
|
||||
**Context**: Construction, U1 in the CMS session.
|
||||
|
||||
---
|
||||
|
||||
## Construction - U1 code generated, awaiting Bryan's review
|
||||
|
||||
**Timestamp**: 2026-11-06
|
||||
|
||||
**AI Response**: The CMS session reports U1 code is generated, built and tested: Core.Tests 330 passed (integration tests assert the full header set on page, asset, 301, 404 and robots.txt; gzip only; dotfiles 404; R11 trailing-slash 301); Identity/Master/Offerings/Availability tests green; Api.Tests could not run (no MariaDB reachable). Two local commits, not pushed. Bryan reviews the code in the CMS session; the formal hand-back note follows after approval. Gap noted for the checkpoint: Api.Tests regression is still unverified.
|
||||
|
||||
**Context**: Construction, U1 in the CMS session.
|
||||
|
||||
---
|
||||
|
||||
## Construction - U1 hand-back accepted, go for U2
|
||||
|
||||
**Timestamp**: 2026-11-06
|
||||
|
||||
**AI Response**: Read handback-u1.md (CMS repo). U1 delivers WebsiteMode, WebsitePathResolver, PrerenderedSiteMiddleware, StrictSite (CSP byte-identical, tested), full header set on every website response, gzip only, NoIndex. Core.Tests 330 plus module suites green. Open risk: Api.Tests not run (no MariaDB); to be run in U2. Bryan approved the U1 code in the CMS session. Gave the CMS session the go for U2 with notes (Api.Tests run, proxy/HTTP 1.0 observation, manual-steps list for Pi-Main draft). Config values for U3 recorded in the hand-back section 3.
|
||||
|
||||
**Context**: Construction, checkpoint between U1 and U2.
|
||||
|
||||
---
|
||||
|
||||
## Construction - U2 NFR questions answered
|
||||
|
||||
**Timestamp**: 2026-11-06
|
||||
|
||||
**User Input (Dutch, interactive)**: Q1 "Zelfde als nu" (automatic test deploy on every push to master); Q2 separate jobs; Q3 existing login limiter; Q4 setup token required on test; Q5 "Merkkleuren exact" (no contrast check).
|
||||
|
||||
**AI Response**: Relayed to the CMS session. Noted that Q5 overrides the brief's accessibility hint and Q1 requires the Andrea deploy to skip cleanly until Pi and secrets exist.
|
||||
|
||||
**Context**: Construction, U2 NFR Requirements in the CMS session.
|
||||
|
||||
---
|
||||
|
||||
## Construction - U2 NFR requirements awaiting approval
|
||||
|
||||
**Timestamp**: 2026-11-06
|
||||
|
||||
**AI Response**: CMS session wrote the U2 NFR requirements. Andrea jobs (publish-andrea-test, deploy-andrea-test) only run when Gitea variable ANDREA_TEST_DEPLOY_ENABLED == 'true'; until then skipped, Api.SlpSoftware jobs and deploy-scp.yaml unchanged. Q5 trade-off recorded in NFR-UX-02. Bryan approves in the CMS session.
|
||||
|
||||
**Context**: Construction, U2.
|
||||
|
||||
---
|
||||
|
||||
## Construction - U2 NFR requirements approved, NFR design awaiting approval
|
||||
|
||||
**Timestamp**: 2026-11-06
|
||||
|
||||
**AI Response**: CMS session reports Bryan approved the U2 NFR requirements (earlier file write had failed, now present) and wrote the U2 NFR design. Open risk: the login limiter may be partitioned per client address; behind the proxy Pi all visitors may share one address, so the limiter could lock out everyone (or be ineffective). CMS session verifies the partition key in code. Bryan approves the design in the CMS session.
|
||||
|
||||
**Context**: Construction, U2.
|
||||
|
||||
---
|
||||
|
||||
## Construction - Forwarded headers / login limiter behind the proxy Pi
|
||||
|
||||
**Timestamp**: 2026-11-06
|
||||
|
||||
**User Input (Dutch)**: "Aha, die eerste stap wordt de k ik niet gedaan voor deze website, maar wel bij andere, maar laat het meenemen in de instructies voor het opzetten van de testomgeving zodat we het niet vergeten."
|
||||
|
||||
**AI Response**: Asked the CMS session to verify current handling (incl. Api.SlpSoftware), propose UseForwardedHeaders with KnownProxies 192.168.1.102 only and limiter on the client address, say whether it is U2 or a shared-host change, and list the proxy-Pi X-Forwarded-For/-Proto step in the manual steps for Bryan.
|
||||
|
||||
**Context**: Construction, U2.
|
||||
|
||||
---
|
||||
|
||||
## Construction - Login limiter is a single global bucket
|
||||
|
||||
**Timestamp**: 2026-11-06
|
||||
|
||||
**AI Response**: CMS session verified: no forwarded-headers handling; AddFixedWindowLimiter("login") is one global bucket for all callers (also refresh, sentry tunnel, offerings-public), so a lockout DoS exists on all hosts regardless of proxy. This corrects my earlier statement that the problem arises because of the shared proxy address. Fix would be a shared Core change (opt-in KnownProxies + per-IP partition); decision for Bryan in the CMS session; recommended as a separate follow-up, U2 stays as agreed (Q3 = A).
|
||||
|
||||
**Context**: Construction, U2.
|
||||
|
||||
---
|
||||
|
||||
## Construction - U2 infrastructure design questions answered
|
||||
|
||||
**Timestamp**: 2026-11-06
|
||||
|
||||
**User Input (Dutch, interactive)**: Q1 "Symlink (Aanbevolen)"; Q2 "Eerst route omzetten (Aanbevolen)"; Q3 "Bestaand project hergebruiken".
|
||||
|
||||
**AI Response**: Relayed to the CMS session. Context: Bryan chose option B for forwarded headers (shared Core change) and approved the U2 NFR design. For U3 the symlink variant means no change to the web delivery pipeline; U3 reduces to verification and retiring nginx's role after the route switch.
|
||||
|
||||
**Context**: Construction, U2 Infrastructure Design.
|
||||
|
||||
---
|
||||
|
||||
## Construction - U2 manual-steps draft ready
|
||||
|
||||
**Timestamp**: 2026-11-06
|
||||
|
||||
**AI Response**: CMS session wrote a complete ordered draft of the manual steps (18 steps) and the infrastructure design; it becomes final when Bryan approves the infrastructure design, after which Pi-Main is asked for the exact commands. Items to verify against the Pi are listed in status.md.
|
||||
|
||||
**Context**: Construction, U2 Infrastructure Design.
|
||||
|
||||
---
|
||||
|
||||
## Construction - Naming convention ASF
|
||||
|
||||
**Timestamp**: 2026-11-07
|
||||
|
||||
**User Input (Dutch)**: "Even een dubbel check. De sentry dan en umami ID worden gebruikt van de huidige website van Andrea Slop Fotografie... Niet die van huidige admin van SlpSoftware? ... Ik wil dat je vastlegt dat de naam van de website is Andrea Slop Fotografie. In de code wordt dat dus AndreaSlopFotografie of een andere vorm van casing. De afkorting mag zijn ASF of Asf afhankelijk van conventie. Dus de sentry key wordt dan bijvoorbeeld 'VITE_SENTRY_DSN_ASF'"
|
||||
|
||||
**AI Response**: Saved the convention as memory and relayed it to the CMS session (rename new names, report final list). Confirmed that the Sentry DSNs come from the website's own Sentry project (Q3 = B), not SlpSoftware's admin project, and that Umami only appears as an origin in the website CSP.
|
||||
|
||||
**Context**: Construction, U2 Infrastructure Design.
|
||||
|
||||
---
|
||||
|
||||
## Construction - ASF naming applied by the CMS session
|
||||
|
||||
**Timestamp**: 2026-11-07
|
||||
|
||||
**AI Response**: CMS session applied the naming convention. Final names recorded in construction/cms-host/status.md. Infrastructure design still awaits Bryan's approval in the CMS session.
|
||||
|
||||
**Context**: Construction, U2 Infrastructure Design.
|
||||
|
||||
---
|
||||
|
||||
## Construction - U2 infrastructure design approved; Pi command draft requested
|
||||
|
||||
**Timestamp**: 2026-11-07
|
||||
|
||||
**AI Response**: CMS session reports Bryan approved the U2 Infrastructure Design; the 18-step manual list is final. Asked the Pi-Main - Server session for a draft with exact commands (no changes on the Pi, placeholders for secrets, verification and rollback; check the marked 'verify' items read-only). The draft will be shown to Bryan. U2 Code Generation plan awaits Bryan's approval in the CMS session.
|
||||
|
||||
**Context**: Construction, U2.
|
||||
|
||||
---
|
||||
|
||||
## Construction - Pi-Main read-only verification; list pasted
|
||||
|
||||
**Timestamp**: 2026-11-07
|
||||
|
||||
**AI Response**: Pi-Main could not read the Windows paths and verified the Pi facts read-only (see status.md). Pasted the final 18-step list and the env table into a message and asked for the command draft. Open points: XDG_RUNTIME_DIR for systemctl --user over SSH and the SERVICE_NAME_* form (both to confirm against deploy-scp.yaml via the CMS session), and where Website__NoIndex=true is set on test.
|
||||
|
||||
**Context**: Construction, U2.
|
||||
|
||||
---
|
||||
|
||||
## Construction - XDG_RUNTIME_DIR, SERVICE_NAME and NoIndex answers
|
||||
|
||||
**Timestamp**: 2026-11-07
|
||||
|
||||
**AI Response**: Forwarded the CMS session's answers to Pi-Main: no XDG_RUNTIME_DIR export in deploy-scp.yaml, so the draft must include a non-interactive ssh systemctl --user check; SERVICE_NAME_ASF_TEST must match the form of SERVICE_NAME_TEST (Bryan checks the value in Gitea); Website:NoIndex=true comes from the committed appsettings.json of the new client.
|
||||
|
||||
**Context**: Construction, U2.
|
||||
|
||||
---
|
||||
|
||||
## Construction - Pi-Main command draft ready
|
||||
|
||||
**Timestamp**: 2026-11-07
|
||||
|
||||
**AI Response**: Pi-Main wrote the draft (private repo Sluijsens/pi-main-serverops, commit 9c98d79, drafts/2026-11-07-asf-cms/). Nothing executed. To show to Bryan; open points recorded in status.md.
|
||||
|
||||
**Context**: Construction, U2.
|
||||
|
||||
---
|
||||
|
||||
## Construction - Correction: proxy block already sets forwarded headers
|
||||
|
||||
**Timestamp**: 2026-11-07
|
||||
|
||||
**AI Response**: Verified in the website repo that the generated proxy-Pi conf already sets Host, X-Forwarded-Proto, X-Forwarded-For and X-Real-IP. Corrected the earlier statement (made by the owner from memory and repeated in the CMS manual list). Only proxy_pass changes to port 5200. U3 must update serverConfig.ts and its generated conf accordingly.
|
||||
|
||||
**Context**: Construction, U2/U3.
|
||||
|
||||
---
|
||||
|
||||
## Construction - U2 code generated, awaiting approval
|
||||
|
||||
**Timestamp**: 2026-11-07
|
||||
|
||||
**AI Response**: CMS session finished U2 code generation (2 local commits). Found and fixed a U1 defect (percent-encoding in the 301 Location). Pointed the CMS session at the real favicon/logo files in the website repo (read-only copy), confirmed radius stays, asked that the CI run of Api.Tests with MariaDB be reported. Bryan approves the code in the CMS session.
|
||||
|
||||
**Context**: Construction, U2.
|
||||
|
||||
---
|
||||
|
||||
## Construction - U2 hand-back received
|
||||
|
||||
**Timestamp**: 2026-11-07
|
||||
|
||||
**AI Response**: Read handback-u2.md. U2 delivers the ASF client, setup token hardening, opt-in forwarded headers with per-client limiters, theme asf, and gated CI jobs. Open: Api.Tests/HostPipelineTests only run in CI (MariaDB); CI vulnerability-scan gate fails on pre-existing advisories (decision Bryan in the CMS session); first-deploy observations (forwarded headers, HTTP/1.0, file lookup timing, vars in job-level if). U3 follows: serverConfig.ts proxy target :5200, verify-deployment.sh extension incl. one percent-encoded path.
|
||||
|
||||
**Context**: Construction, checkpoint after U2.
|
||||
|
||||
---
|
||||
|
||||
## Construction - Bryan delegates control of the CMS session
|
||||
|
||||
**Timestamp**: 2026-11-08
|
||||
|
||||
**User Input (Dutch)**: "kan jij weer de leiding pakken over de sessie `AndreaSlopFotografie` in de slp-modular-cms workspace? Ik wil alles via jou aansturen als dat kan. Dus vragen doorsturen en ook de beslissingen met de vraag of hij verder mag. Eventueel mag jij dat controleren en mij adviseren. Jij hebt een completer beeld hoe alles eruit moet komen te zien namelijk. De hosting is ingericht. Dus zodra er een deployt kan worden gedaan dan mag dat"
|
||||
|
||||
**AI Response**: Relayed to the CMS session with the scope: this session answers its questions and decides within the agreed scope; escalates to Bryan what is his (production, anything outside scope). Given: Build and Test approved; dependency bump as separate commit; push of the feature branch only; no master merge or ASF deploy before explicit go. Production is never touched.
|
||||
|
||||
**Context**: Construction, orchestration.
|
||||
|
||||
---
|
||||
|
||||
## Construction - U3 code done (uncommitted); CMS session requires Bryan's own go to push
|
||||
|
||||
**Timestamp**: 2026-11-08
|
||||
|
||||
**AI Response**: U3 implemented in the worktree (not committed, per the commit/push rule): serverConfig.ts proxy target :5200 with test and regenerated proxy conf, verify-deployment.sh --cms mode (exact headers, cache, gzip-only, encoded path, 405, /health, /admin/, capabilities without Offerings, API 404), config/printCsp.ts, CI deploy-test step using --cms when Gitea variable ASF_TEST_SERVED_BY_CMS is true (setup-node added), two e2e tests. The CMS session refused to push on a relayed message: Bryan must type the go in its session.
|
||||
|
||||
**Context**: Construction, U3.
|
||||
|
||||
---
|
||||
|
||||
## Construction - Push approved, CI run via workflow_dispatch, monitoring answers
|
||||
|
||||
**Timestamp**: 2026-11-08
|
||||
|
||||
**User Input (Dutch, interactive)**: push "Ja, alleen die branch"; Monitoring Q1 "Ja, documenteren + alertadvies", Q2 "Logging + alerting", Q3 "journald + Sentry", Q4 "Security + fouten + uptime", Q5 "Geen nieuw dashboard"; CI-run "Handmatig starten in Gitea".
|
||||
|
||||
**AI Response**: Relayed to the CMS session; corrected my earlier assumption that the push was implied (it was not an explicit word from Bryan; the CMS session rightly asked). The CMS session pushed only the feature branch. Bryan starts the workflow manually without deploy boxes.
|
||||
|
||||
**Context**: Construction/Operations, U2.
|
||||
|
||||
---
|
||||
|
||||
## Construction - Permission to fix pipeline, deploy to test and push/PR
|
||||
|
||||
**Timestamp**: 2026-11-08
|
||||
|
||||
**User Input (Dutch)**: "Goed, jullie hebben toestemming de pipeline samen te fixen. Jullie hebben ook toestemming om een deploy te doen zodra de pipeline slaagt. Ook hebben jullie toestemming om te pushen en als het nodig is een PR te maken"
|
||||
|
||||
**AI Response**: Relayed to the CMS session with the scope: this task only (ASF test), no merge of a PR into master (that also deploys SlpSoftware test with the shared Core change), production never. The permission covers this session's web worktree for pushing too, but not merging.
|
||||
|
||||
**Context**: Construction/Operations, U2/U3.
|
||||
|
||||
---
|
||||
@@ -0,0 +1,90 @@
|
||||
# Feature brief for the CMS session: Andrea's site on SlpModularCms (units U1 and U2)
|
||||
|
||||
- **From**: session "CMS & API" [fc4f23], repo `AndreaSlopFotografie` (the website repo), feature `cms-api-foundation`
|
||||
- **To**: the CMS session `AndreaSlopFotografie` [dbb9e4], repo `SlpModularCms`
|
||||
- **Date**: 2026-11-06
|
||||
- **Source of truth**: `K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-cms-api-foundation\aidlc-docs\features\cms-api-foundation\` (requirements, application design and unit documents are there; this brief summarises them). A copy of this brief sits in your repo at `aidlc-docs/_shared/handoffs/`; move it wherever your AIDLC prefers.
|
||||
|
||||
## 1. What we ask
|
||||
|
||||
Run your own AIDLC workflow for **one feature that contains two units**, and hand back after each unit. Suggested slug: `andreaslop-site-hosting`.
|
||||
|
||||
- **U1 `core-site-hosting`**: teach the shared host to serve a prerendered website the way nginx does today, and give such a site a strict CSP, without changing any existing host.
|
||||
- **U2 `andreaslop-client`**: add the client host `SlpModularCms.Api.AndreaSlopFotografie` with a themed Dutch admin and CI/CD to the test host.
|
||||
|
||||
**Checkpoint**: report back to me after U1 (hand-back note, section 7) and wait for my "go" before U2. The owner (Bryan) approves your requirements and your design for this feature; do not skip those approval gates.
|
||||
|
||||
## 2. Decisions already taken by the owner (do not re-ask)
|
||||
|
||||
1. One deployment and one database per site. A site's modules are the **module projects its client references** (the existing DLL discovery). **No configuration filter** is added to the shared host. `Offerings` is not referenced by Andrea's client; adding the reference later switches it on.
|
||||
2. The theme is fixed per site, never edited in the admin, and not served by the API. Admin is **built per site** with a theme selected at build time.
|
||||
3. The host serves `/admin`, `/api/v1` and the website (`/`) from one process; the production host has room for only one website.
|
||||
4. Test environment only in this feature. Production, the `Master` module for Andrea, extra roles, SSR and CMS-driven site content are out of scope.
|
||||
5. Authentication is the existing Identity module unchanged (first admin via setup flow, then invitations).
|
||||
6. The admin's default language for Andrea is Dutch; English stays selectable.
|
||||
7. Extensions the owner enabled for this work (your own AIDLC will ask its own opt-in questions: forward them to me, the owner decides): Security Baseline enforced; property-based testing in partial mode (PBT-02, 03, 07, 08, 09).
|
||||
|
||||
## 3. Facts from your code that the design builds on (verified read-only)
|
||||
|
||||
- `ModuleOrchestrator.DiscoverModules` loads `SlpModularCms.Modules.*.dll` next to the host; the client `.csproj` references decide the module set.
|
||||
- `CmsHostOptions` is empty and documented as the extension point for per-client differences; it is passed to both `CmsHost.ConfigureServices` and `ConfigurePipeline`.
|
||||
- `StaticContentExtensions` mounts `wwwroot/web` at `/` with `UseDefaultFiles` and an extensionless fallback to `index.html`. It does not map `/over-mij` to `over-mij.html` and does not serve a 404 page with status 404. The current fallback also answers unknown paths under `/api/v1` with the website `index.html`; the new mode must not.
|
||||
- `SecurityHeadersOptions.PathPolicies` plus the code-defined `CspPolicyCatalog` (`Strict`, `Relaxed`). `Strict` deliberately takes no extra script origins.
|
||||
- Admin build already reads `VITE_APP_TITLE`, `VITE_API_BASE_URL`; CI is `.gitea/workflows/continuous_integration.yaml` and `deploy-scp.yaml`.
|
||||
|
||||
## 4. U1 `core-site-hosting`: required behaviour
|
||||
|
||||
Components (names are indicative; responsibilities and interfaces are the contract):
|
||||
|
||||
- **C2 `CmsHostOptions.WebsiteMode`**: `SpaFallback` (default, current behaviour, so `Api` and `Api.SlpSoftware` are unchanged) and `PrerenderedPages`.
|
||||
- **C3 prerendered site serving**, active only in `PrerenderedPages`:
|
||||
- **Path resolution** as a pure function with a file-exists predicate, total (never throws, never leaves the website root, rejects traversal), returning serve-file, redirect-to-canonical or not-found. `/` serves `index.html`; `/x` serves `x.html` (also `x/index.html` if present). Canonical form: lowercase, no `.html`, no trailing slash, query string preserved; other spellings get a 301. Paths that look like files are served as files or 404.
|
||||
- **Unknown path**: serve `404.html` with **status 404**, never `index.html`; plain 404 if `404.html` is missing.
|
||||
- **Reserved prefixes** `/admin`, `/api/v1`, `/health` are never handled by this middleware; an unknown API path stays an API 404.
|
||||
- **Cache-Control**: pages `no-cache`; hashed files under `/assets` long-lived and immutable.
|
||||
- **Compression** of text types using built-in response compression (no new dependency).
|
||||
- **Indexing policy**: setting `Website:NoIndex` (default false). When true: `X-Robots-Tag: noindex, nofollow` on website responses and `/robots.txt` answers `User-agent: *` / `Disallow: /`.
|
||||
- **C4 `StrictSite` policy** in `CspPolicyCatalog`: the `Strict` directives plus configured script origins in `script-src` and configured connect origins in `connect-src`; `X-Frame-Options: DENY`; `frame-ancestors 'none'`. `Strict` and `Relaxed` do not change. The new name is accepted by `PathPolicyRule` validation; unknown names still fail startup. Confirm HSTS, `X-Content-Type-Options` and `Referrer-Policy` are emitted on website responses.
|
||||
- Pipeline order must stay as documented in `CmsHost` (security headers before static content). Compression sits before the website mount. The website 404 handling is last, after API routes.
|
||||
- Update `WEBSITE_WORKSPACE.md` and the README for the new mode.
|
||||
|
||||
**Where the exact rules come from** (read these in the website repo, they are the behaviour to match): `web/config/canonicalUrls.ts`, `web/config/serverConfig.ts` (rules BR-HST-01 to 11), `web/config/compressibleTypes.ts`, `web/deploy/nginx/andreaslop-test.conf` (what test does today).
|
||||
|
||||
**Site build output layout** (TanStack Start prerender, `autoSubfolderIndex: false`): `index.html`, one `<name>.html` per page without folders, `404.html`, `assets/` with hashed names, plus sitemap and static files from `public/`. Inline scripts are externalised so the strict CSP works.
|
||||
|
||||
**The CSP the site sends today** (must be reproduced exactly by `StrictSite` with the right origins):
|
||||
|
||||
```text
|
||||
default-src 'self'; script-src 'self' https://analytics.slpsoftware.nl; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self' https://analytics.slpsoftware.nl https://o4511795618185216.ingest.de.sentry.io; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'
|
||||
```
|
||||
|
||||
plus `Strict-Transport-Security: max-age=31536000; includeSubDomains`, `X-Content-Type-Options: nosniff`, `X-Frame-Options: DENY`, `Referrer-Policy: strict-origin-when-cross-origin`. Note the current `Strict` also emits `frame-ancestors 'none'`, `base-uri`, `form-action` and `object-src`; check that the directive order and content can match the site's policy exactly. If an exact match is impossible, tell me before deciding: the website repo will assert the exact string (`web/deploy/verify-deployment.sh`, my unit U3) and can adapt its side.
|
||||
|
||||
**Done when** (U1): unit and property-based tests pass (path resolution invariants: never escapes the root, canonical form is idempotent, no resolution of reserved prefixes; policy round trips), `Api` and `Api.SlpSoftware` tests are green and behave unchanged, docs updated, hand-back note written.
|
||||
|
||||
## 5. U2 `andreaslop-client`: required behaviour
|
||||
|
||||
- **C1 project `SlpModularCms.Api.AndreaSlopFotografie`** (placed under **Clients** in the solution): thin `Program.cs` on `CmsHost`, `WebsiteMode = PrerenderedPages`, three-file appsettings, own database, own dev port, `SecurityHeaders:DefaultPolicy = StrictSite` with the Umami and Sentry origins above, `Website:NoIndex = true` for test. References only the modules the admin needs; find out the minimum (Identity, and whether Availability is required) and tell me what you found.
|
||||
- **C5 admin theme**: `frontend/themes/andreaslop/` with a CSS file overriding the existing tokens (colours, radius, font) plus logo and favicon; `VITE_THEME` selects it at build time (unset = today's look); new `VITE_DEFAULT_LANGUAGE` (`nl` for Andrea).
|
||||
Andrea's site identity (palette from `web/src/theme.ts`, source `design/andreaslop-static/` in the website repo): paper `#faf7f2`, paper-alt `#f1ebe2`, paper-deep `#e8e0d5`; ink `#232120`, ink-soft `#55504b`, ink-muted `#8a827a`; line `#e2dad0`; accent (heidegroen) `#7f8b76`, accent-deep `#5f6a58` (use for text and buttons: white on it meets 4.5:1), accent-deeper `#475042`; sand `#d9cdbc`; error `#a4443a`. Fonts: Marcellus for headings, Jost for body, with the same fallbacks as the site. Logo: `web/public/logo.png` and favicon `web/public/favicon.png` in the website repo. Keep contrast accessible (the admin's destructive and ring colours must stay readable on the paper background).
|
||||
- **C6 CMS CI/CD**: build the admin per deployable client with its `VITE_THEME`, `VITE_DEFAULT_LANGUAGE` and `VITE_APP_TITLE`; publish the new host; deploy to the **test** host with the existing atomic release switch; keep `wwwroot/web/` outside the swapped release directory so the website survives every CMS deploy. Do not touch the production path for `Api.SlpSoftware`.
|
||||
- **Security**: the first-administrator setup flow on the new instance must not be usable by anyone else once the first administrator exists (assess and test); login rate limiting stays; no secrets in the repo (the three-file appsettings pattern).
|
||||
|
||||
**Done when** (U2): the host starts on test with its own database; `/admin` shows Andrea's theme in Dutch and first-admin setup and login work; `/api/v1/System/capabilities` shows no `Offerings`; `/health` is green; `Api.SlpSoftware` still builds and deploys unchanged; hand-back note written.
|
||||
|
||||
## 6. How we work together
|
||||
|
||||
- **Questions**: web-side questions (what the site needs, file layout, CSP, theme, design source) go to me via SendMessage to "CMS & API" [fc4f23]; I answer from the website repo and its AIDLC documents. CMS-internal choices, security trade-offs and data-model questions: ask the owner (Bryan) directly through your normal question files; I do not decide those.
|
||||
- **Approvals**: the owner approves your requirements and your design. Please tell me when those are approved so I can note it in `construction/cms-host/`.
|
||||
- **Boundaries**: do not change anything in the website repo. Do not touch production. Follow your repo's rules for commits, pushes and deploys; if you are unsure whether you may push or deploy to test, ask the owner.
|
||||
- **Parallel work**: another session is working on a testimonials feature in the website repo; it does not touch your repo. The testimonials will later become a CMS module, so keep module composition by DLL reference intact.
|
||||
|
||||
## 7. Hand-back note (after U1, and again after U2)
|
||||
|
||||
A short markdown file in your AIDLC folder, and a message to me with its path, containing:
|
||||
1. What was built (components, files) and anything that deviates from this brief, with the reason.
|
||||
2. Test results: unit, property-based (with the seed handling you used), and the `Api`/`Api.SlpSoftware` regression run.
|
||||
3. Configuration values the website repo must know (header values, origins, hostnames, delivery path, ports).
|
||||
4. Open questions or risks.
|
||||
|
||||
I verify the hand-back by integrating it in the website repo (unit U3) and by the deployment checks there.
|
||||
@@ -0,0 +1,51 @@
|
||||
# Test Pi inventory (read-only answer from session "Pi-Main - Server", 2026-11-06)
|
||||
|
||||
Source: `INVENTARIS.md` in `/home/claude/server-ops` plus a live check on 2026-11-06. The session has no sudo, so root-only items are "not seen". No secrets are included. Facts below are as reported, not verified by this session.
|
||||
|
||||
## How SlpSoftware is deployed today (the pattern to copy)
|
||||
|
||||
- User `gitea-workflow` (uid 1003, linger on, systemd user units). Base: `/home/gitea-workflow/apps/slpsoftware/{production,test}/` with `releases/<timestamp>/`, `current` (symlink to the release) and `shared/` (`env`, mode 600; `modules/`; `wwwroot-web` -> `/mnt/storage1/www/html/slpsoftware/{test|production}`).
|
||||
- User units `slpsoftware-test.service` / `slpsoftware-production.service`: `WorkingDirectory=%h/apps/slpsoftware/test/current`, `ExecStart=/usr/bin/dotnet %h/.../current/SlpModularCms.Api.SlpSoftware.dll`, `EnvironmentFile=%h/.../shared/env`, `Restart=on-failure`, `RestartSec=5`, `KillSignal=SIGINT`, `TimeoutStopSec=20`, `WantedBy=default.target`.
|
||||
- Ports in use: SlpSoftware test 5100, production 5101; SimpleDeckApp 5150/5151; 5000 (wedding-rsvp, local), 3000 Gitea, 3001 Umami, 3306 MariaDB (local), 80 nginx, 2224 sshd. **Free for us: 5200 / 5201**, with a ufw rule needed.
|
||||
- Reverse proxy: the separate proxy Pi (`pi-entry`, certbot, TLS) sends `test.slpsoftware.nl` and `slpsoftware.nl` **directly** to the app port on the application Pi (HTTP/1.0), bypassing nginx on that Pi. The app serves the SPA itself. Routing per hostname lives on the proxy Pi.
|
||||
- Deploy: `appleboy/drone-scp` over SSH as `gitea-workflow` to port 2224 (password). Before and after a release `~/scripts/backup-slpsoftware-db.sh` runs. The exact steps are in the CMS repo's `deploy-scp.yaml`.
|
||||
|
||||
## Reuse and what is per instance
|
||||
|
||||
- Gitea runners: Pi runner (rootless Podman, `network: host`, labels include `arm64`, `raspberry-pi`, `linux-arm64`) and a second runner on Bryan's PC (x64; a job with only `global/linux/podman` can land there, so ARM64 builds must require `arm64` or `linux-arm64`).
|
||||
- Reusable: SSH user, scp target and base path. Per instance: app folder under `~/apps`, unit, port, env file, database and database user, deploy paths, hostname and proxy config, repo secrets (in the CMS repo that holds the workflow; unknown whether they are organisation-wide).
|
||||
- A new deploy user or method needs an `sshd_config` change (root, Bryan).
|
||||
|
||||
## MariaDB
|
||||
|
||||
- 10.11.19 on `127.0.0.1:3306` and socket. Convention: PascalCase database named after the app (`SlpSoftware` / `SlpSoftwareTest`), user = app name `@localhost`. Decided by Bryan (2026-11-06): database `AndreaSlopFotografieTest`, user `AndreaSlopFotografie@localhost` (the CMS is part of the website; the company is AndreaSlopFotografie). Only `root@%` exists; creation by Bryan via `sudo mariadb -u root -p`.
|
||||
- A database `andreaslop` (WordPress, user `andreaslop@localhost`) already exists: do not confuse.
|
||||
- The weekly backup script reads `SHOW DATABASES` (correction by the Pi-Main session, 2026-11-06): a new database is picked up automatically, no script change needed.
|
||||
|
||||
## To create for the new instance (Bryan, with sudo where needed)
|
||||
|
||||
1. As `gitea-workflow`: `~/apps/<name>/test/{releases,shared}`, `shared/env` (600), a user unit with the new port, enable it; website folder if needed.
|
||||
2. MariaDB: database, user, grants.
|
||||
3. ufw (root): allow the chosen port (5200) only from the proxy Pi `192.168.1.102`.
|
||||
4. Proxy Pi: server block for the hostname to `192.168.1.103:<port>` plus certbot.
|
||||
5. Gitea: secrets and variables (deploy host, port 2224, user, password or key, `DEPLOY_PATH`).
|
||||
6. Hostname: **decision for Bryan.** Taking over `test.andreaslop.nl` = switching the route on the proxy Pi to the new port (nginx on the app Pi stays as fallback). A temporary own name (for example `cms-test.andreaslop.nl`) needs DNS and certbot on the proxy Pi.
|
||||
|
||||
## Effects of taking over `test.andreaslop.nl`
|
||||
|
||||
- Today: proxy Pi -> Pi port 80 -> `/etc/nginx/conf.d/andreaslop-test.conf` (generated by `serverConfig.ts`): canonical-URL map, `error_page 404`, gzip, security headers. The static site is deployed by `gitea-workflow` to `/var/www/html/andreaslop-test` (= `/mnt/storage1/www/html/andreaslop-test`) via `DEPLOY_PATH_TEST`.
|
||||
- The new app must itself provide gzip, security headers, canonical 301 redirects and a real 404, and cope with **HTTP/1.0** from the proxy. The proxy Pi adds no gzip, cache or headers.
|
||||
- Verification against the old setup is possible on the Pi: `curl -H 'Host: test.andreaslop.nl' http://127.0.0.1/` still reaches nginx.
|
||||
- The existing static deploy writes into the same web root: stop that workflow once the new host is live to avoid overwrites (or reuse that folder, see below).
|
||||
|
||||
## Limits
|
||||
|
||||
- Pi 4, 4 cores, 7.6 GiB RAM, swap mostly off; about 5.4 GiB available with five .NET processes running (each 115 to 290 MB). A sixth instance of 250 to 300 MB fits. Builds run on the runner, which also uses this Pi's memory and CPU.
|
||||
- Disk: SD card 57 GB (34% used), USB SSD `/mnt/storage1` 916 GB (1%). Releases are on the SD card (clean old ones); photos and uploads belong on `/mnt/storage1`. MariaDB data is on the SD card.
|
||||
- .NET 10 host runtime is shared by all apps (a runtime update affects all).
|
||||
- The Pi-Main session offered to write a draft with exact commands if asked.
|
||||
|
||||
## Notes for the design (this session)
|
||||
|
||||
- **Possible simplification for U3**: if the new instance's `shared/wwwroot-web` points at `/mnt/storage1/www/html/andreaslop-test` (the folder the static deploy already writes), the existing web deploy keeps delivering the files and the CMS host serves them. Then U3 shrinks to verification plus retiring nginx's role. To evaluate in Infrastructure Design (both repos).
|
||||
- The new host must run behind HTTP/1.0 proxying: check `UseHttpsRedirection` (the proxy terminates TLS) and forwarded headers; SlpSoftware already works this way, so copy its settings.
|
||||
@@ -0,0 +1,65 @@
|
||||
# CMS session status log (reported by the CMS session, not verified here)
|
||||
|
||||
| Date (UTC) | Event | Source |
|
||||
|---|---|---|
|
||||
| 2026-11-06 | Brief received; branch `feature/andreaslop-site-hosting` created in the CMS repo | CMS session audit |
|
||||
| 2026-11-06 | Requirements questions answered (relayed by this session, then confirmed by Bryan in the CMS session) | CMS session message |
|
||||
| 2026-11-06 | Requirements approved by Bryan in the CMS session ("goedgekeurd, ga verder"), after he was shown the relayed items: test-deploy permission, hostname `test.andreaslop.nl`, database `AndreaSlopFotografieTest` / `AndreaSlopFotografie@localhost` | CMS session message |
|
||||
| 2026-11-06 | Workflow Planning: execution plan awaiting Bryan's approval | CMS session message |
|
||||
| 2026-11-06 | Execution plan approved by Bryan in the CMS session; waiting for Bryan on 3 design questions (StrictSite origins, known-page check, setup-token UX) in `application-design-plan.md` | CMS session message |
|
||||
| 2026-11-06 | Bryan answered the 3 design questions in this session (relayed): separate StrictSite origin lists; per-request file-exists check; setup token field on the setup page when tokenRequired | this session |
|
||||
| 2026-11-06 | Application design approved by Bryan in the CMS session ("goedgekeurd, ga verder"), including the relayed answers Q1-Q3; waiting for Bryan on unit-of-work.md | CMS session message |
|
||||
| 2026-11-06 | Units approved by Bryan in the CMS session (U1 core-site-hosting, U2 andreaslop-client), full scope kept incl. canonical 301s. U1 Functional Design started | CMS session message |
|
||||
| 2026-11-06 | Bryan answered the two U1 functional-design questions in this session (relayed): full header set on every website response; dot-segment paths refused except .well-known | this session |
|
||||
| 2026-11-06 | U1 functional design written; waiting for Bryan. Web-side review sent to the CMS session: all rules match web BR-HST rules except R11 (trailing slash: web strips on every path, CMS redirects only if the stripped path resolves) | CMS session message, this session |
|
||||
| 2026-11-06 | R11 adjusted by the CMS session to the web rule (301 to stripped path for every path ending in a slash, guard for // and /\ and control chars); U1 functional design still awaits Bryan | CMS session message |
|
||||
| 2026-11-06 | U1 functional design approved by Bryan in the CMS session (Q1=A, Q2=A, R11 nginx parity); U1 NFR Requirements started | CMS session message |
|
||||
| 2026-11-06 | Bryan answered the 3 U1 NFR questions in this session (relayed): gzip only; count test plus local timing; logging = warnings by default, more on the Pi (test), production decided later (interpretation sent, per-environment log level of a dedicated category) | this session |
|
||||
| 2026-11-06 | U1 NFR requirements approved by Bryan in the CMS session (gzip only, Information logging on test via config, FsCheck.Xunit test-only); U1 NFR Design started | CMS session message |
|
||||
| 2026-11-06 | U1 NFR design approved by Bryan in the CMS session; U1 Infrastructure Design skipped (confirmed by this session: no deployment impact expected); U1 Code Generation next | CMS session message, this session |
|
||||
| 2026-11-06 | U1 code generated, built, tested (Core.Tests 330 passed; Identity/Master/Offerings/Availability green; Api.Tests not run, no MariaDB reachable). 2 local commits, not pushed. Awaiting Bryan's code review in the CMS session; summary in CMS repo `aidlc-docs/features/andreaslop-site-hosting/construction/core-site-hosting/code/code-summary.md`; formal hand-back follows | CMS session message |
|
||||
| 2026-11-06 | U1 hand-back received (`handback-u1.md` in CMS repo), Bryan approved the U1 code; accepted with open risk: Api.Tests not run (no MariaDB), to be run in U2. Go for U2 given by this session | CMS session message, this session |
|
||||
| 2026-11-06 | U2 started (functional design skipped). Bryan answered the 5 U2 NFR questions in this session (relayed): Q1 automatic test deploy on push to master like SlpSoftware (must not break before the Pi is ready); Q2 separate jobs; Q3 setup endpoints under the login limiter + security log; Q4 setup token required on test; Q5 brand colours exactly, no contrast check | CMS session message, this session |
|
||||
| 2026-11-06 | U2 NFR requirements written; Andrea deploy jobs gated by Gitea variable ANDREA_TEST_DEPLOY_ENABLED == 'true' (Bryan flips it once Pi + secrets exist); Q5 trade-off in NFR-UX-02. Awaiting Bryan's approval in the CMS session: `construction/andreaslop-client/nfr-requirements/` (CMS repo) | CMS session message |
|
||||
| 2026-11-06 | U2 NFR requirements approved by Bryan in the CMS session (CMS session corrected: its first write of the files had failed, now exist). U2 NFR design written (new security event setup_token_rejected 5007, identical 401 for missing/wrong token, whitespace-only token = startup error); awaiting Bryan in the CMS session: `construction/andreaslop-client/nfr-design/`. Open: login limiter partition key behind the proxy Pi (all clients may share the proxy address; CMS session verifies and reports) | CMS session message |
|
||||
| 2026-11-06 | Login limiter behind proxy Pi: proposal sent (forwarded headers, KnownProxies = 192.168.1.102 only, limiter on client address). Bryan: the proxy-Pi block for Andrea probably does not set X-Forwarded-For yet (other sites do): must be in the manual-steps list for the test environment | this session |
|
||||
| 2026-11-06 | Limiter finding from the CMS session: no forwarded-headers handling anywhere; the `login` limiter is ONE global bucket (5/60 s for all callers, same for refresh, sentry tunnel, offerings-public), so any 5 requests lock everybody out, on Api.SlpSoftware too, with or without proxy. Fix (opt-in ForwardedHeaders:KnownProxies + per-IP partition) is a shared Core change touching Api, Api.SlpSoftware, Api.Slave; CMS session recommends: U2 as agreed, fix as separate follow-up only if Bryan wants it. Decision with Bryan in the CMS session. Proxy-Pi X-Forwarded step stays in the manual-steps list | CMS session message |
|
||||
| 2026-11-06 | Bryan chose option B for forwarded headers (opt-in ForwardedHeaders:KnownProxies + per-client limiters, shared Core change touching Api/Api.SlpSoftware/Api.Slave) and approved the U2 NFR design in the CMS session. U2 infrastructure design questions answered by Bryan in this session (relayed): Q1 symlink to /mnt/storage1/www/html/andreaslop-test (web pipeline unchanged); Q2 switch proxy-Pi route first, then first deploy; Q3 reuse the website's Sentry project. Manual-steps list follows | CMS session message, this session |
|
||||
| 2026-11-06 | U2 infrastructure design drafted; manual-steps list (18 steps: A prepare, B cut-over incl. proxy route switch + X-Forwarded-For/-Proto + nginx-fallback revert, C verify, rollback, optional SlpSoftware ForwardedHeaders steps) in CMS repo `construction/andreaslop-client/infrastructure-design/manual-steps-for-bryan.md`; FINAL after Bryan approves the infrastructure design. Sentry: admin uses same-origin /sentry-tunnel, no CSP change; vars Observability__SentryDsn (shared/env), VITE_SENTRY_DSN from Gitea variable VITE_SENTRY_DSN_ANDREA. To verify against reality: deploy path/home of gitea-workflow, dotnet path, linger, read access to /mnt/storage1/www/html/andreaslop-test, SERVICE_NAME_* with/without .service | CMS session message |
|
||||
| 2026-11-07 | Naming convention from Bryan: new names use AndreaSlopFotografie (any casing) or ASF/Asf, never Andrea alone (e.g. VITE_SENTRY_DSN_ASF, ASF_TEST_DEPLOY_ENABLED). Sent to the CMS session with the request to rename plans, jobs, variables, theme folder, Pi folder, unit and report the final list. Clarified: Sentry = the website's own project, not SlpSoftware's admin; Umami only in the website CSP | this session |
|
||||
| 2026-11-07 | Naming applied by the CMS session. Final names: Gitea vars ASF_TEST_DEPLOY_ENABLED, DEPLOY_PATH_ASF_TEST, SERVICE_NAME_ASF_TEST, HEALTH_CHECK_URL_ASF_TEST (=https://test.andreaslop.nl/health), VITE_SENTRY_DSN_ASF; secrets PI_MAIN_* unchanged; jobs publish-asf-test / deploy-asf-test; theme frontend/themes/asf, VITE_THEME=asf; project SlpModularCms.Api.AndreaSlopFotografie; Pi folder apps/andreaslopfotografie/test; unit andreaslopfotografie-test.service; DB AndreaSlopFotografieTest / user AndreaSlopFotografie; port 5200. Infra design still awaits Bryan | CMS session message |
|
||||
| 2026-11-07 | Bryan approved the U2 Infrastructure Design; manual-steps list FINAL (18 steps, ASF names). Asked Pi-Main - Server for the exact-commands draft (read-only on the Pi, no secrets, rollback included). U2 Code Generation plan awaits Bryan in the CMS session | CMS session message, this session |
|
||||
| 2026-11-07 | Pi-Main cannot read K:\ paths; verified read-only on the Pi: home /home/gitea-workflow (uid 1003, group www-data), dotnet /usr/bin/dotnet (runtime 10.0.14), linger on, units in ~/.config/systemd/user with .service suffix, /mnt/storage1/www/html/andreaslop-test 775 webadmin:www-data and writable by gitea-workflow, port 5200 free, ufw rule still to add. Open: XDG_RUNTIME_DIR for systemctl --user over SSH (check deploy-scp.yaml), SERVICE_NAME_* form (check workflow). Pasted the full 18-step list + env table to Pi-Main and requested the draft | this session |
|
||||
| 2026-11-07 | CMS session answers: deploy-scp.yaml does not export XDG_RUNTIME_DIR (plain `systemctl --user restart <service_name>` over SSH; service name passed verbatim); existing vars SERVICE_NAME_TEST/SERVICE_NAME_PRODUCTION, value only visible in Gitea (Bryan to check .service suffix, ours must match); Website:NoIndex=true goes into the client's committed appsettings.json (not shared/env). Forwarded to Pi-Main with a request for a non-interactive ssh systemctl check | CMS session message, this session |
|
||||
| 2026-11-07 | Pi-Main draft ready: private repo Sluijsens/pi-main-serverops on Gitea, commit 9c98d79, folder drafts/2026-11-07-asf-cms/ (README.md, 01-database-mappen-env.sh, 02-unit-installeren.sh); steps 19a-19h; nothing executed (bash -n only). Pi-Main notes: proxy-Pi block may already set Host/X-Forwarded-For/-Proto/X-Real-IP (inventory of 01-11), draft has Bryan check with grep; ~gitea-workflow/.bashrc returns early for non-interactive shells, so the XDG check in 19b matters; claim that the proxy block is generated by serverConfig.ts to be verified | Pi-Main message |
|
||||
| 2026-11-07 | Checked web/deploy/nginx/test.andreaslop.nl.proxy.conf (generated by serverConfig.ts, lines ~309-315): the proxy-Pi block ALREADY sets Host, X-Forwarded-Proto, X-Forwarded-For, X-Real-IP; proxy_pass is http://192.168.1.103 (port 80). Earlier claim 'not done' was wrong; only the target port changes to 5200. CMS session asked to reword step 11. U3 task added: update serverConfig.ts so the generated proxy conf points to :5200 (hostingPiAddress with port), keep repo copy in sync with the manual change on the proxy Pi (certbot edits the live file) | this session |
|
||||
| 2026-11-07 | SERVICE_NAME_TEST in Gitea = slpsoftware-test.service (checked by Bryan), so SERVICE_NAME_ASF_TEST = andreaslopfotografie-test.service; Pi-Main draft step 19d updated and pushed | Pi-Main message |
|
||||
| 2026-11-07 | U2 code generated, committed locally (2 commits, not pushed/deployed); awaiting Bryan's code approval in the CMS session: `construction/andreaslop-client/code/code-summary.md`. Notes: U1 defect found and fixed (301 Location lacked percent-encoding, caught by the property test); favicon is a placeholder, real files web/public/favicon.png and logo.png pointed out by this session; dark mode derived from the palette; radius 0.25rem is the CMS session's choice; Api.Tests and ASF host pipeline tests need MariaDB, to run in CI (result to report after first CI run). Suites green: Core 351, Identity 57, Availability 82, Master 57, Offerings 57, frontend 293 | CMS session message, this session |
|
||||
| 2026-11-07 | CMS session: real favicon.png copied into frontend/themes/asf (placeholder removed, admin build links favicon-theme.png type image/png); logo.png not used (no logo element); radius 0.25rem stays; 3rd local commit, not pushed. Handback-u2 will list below-AA pairs, the U1 percent-encoding correction (/a%3Fb/ now redirects to /a%3Fb), CI Api.Tests result after first CI run. nginx comparison for an encoded path is for web verify (U3) | CMS session message |
|
||||
| 2026-11-07 | U2 hand-back received (`handback-u2.md` in CMS repo; 3 U2 commits, not pushed, nothing deployed). Built: client Api.AndreaSlopFotografie (Identity+Availability, port 5200, StrictSite, NoIndex true), setup token + limiter + event 5007, shared Core change (opt-in ForwardedHeaders:KnownProxies, per-client limiters), theme asf (nl default), CI jobs behind ASF_TEST_DEPLOY_ENABLED. Tests green locally (Core 351, Identity 57, Availability 82, Master 57, Offerings 57, ASF config 5, frontend 293); Api.Tests and ASF HostPipelineTests need MariaDB, CI backend-test will run them. Open risk: CI vulnerability-scan gate fails on pre-existing advisories (System.Security.Cryptography.Xml/Pkcs 10.0.10, 6 pnpm findings), blocks SlpSoftware publish too; decision by Bryan in the CMS session. Awaiting Bryan's Build and Test approval there | CMS session message |
|
||||
| 2026-11-07 | Pi progress (Pi-Main): 19a (dirs, DB, shared/env) and 19b (unit andreaslopfotografie-test.service enabled, not started) executed by Bryan. XDG_RUNTIME_DIR proven not needed (non-interactive ssh systemctl --user works). Next 19c (ufw 5200) and 19d (Gitea vars). 19e (proxy route) only just before the first deploy, Pi-Main wants a heads-up when the code is in the repo and Bryan asks. Pi-Main reminder: serverConfig.ts must carry port 5200 and the forwarded headers (already has the headers) | Pi-Main message |
|
||||
| 2026-11-07 | Pi-Main (back online): 19a-19d done (dirs/DB/shared/env, unit enabled, ufw 5200 from 192.168.1.102, Gitea variables set by Bryan; ASF_TEST_DEPLOY_ENABLED not set). Bryan's real Pi-Entry config confirms the proxy block already sets the forwarded headers; only :5200 on proxy_pass changes. Told Pi-Main: code not on Gitea yet (push when Bryan asks); I send the generated proxy conf after the serverConfig.ts change (U3) | Pi-Main message, this session |
|
||||
| 2026-11-08 | Bryan delegated control of the CMS session to this session (questions and decisions via here; I may check and advise; test deploy allowed as soon as possible, production never). Given to the CMS session: U2 Build and Test approved; small separate dependency bump for the vulnerability gate; push only the feature branch, report CI results, no merge to master / ASF deploy before my explicit go (master push auto-deploys SlpSoftware test). U3 in progress here: serverConfig.ts proxy :5200 (+test), verify-deployment.sh --cms mode, config/printCsp.ts, CI step uses --cms when Gitea variable ASF_TEST_SERVED_BY_CMS=true (needs setup-node in deploy-test) | user, this session |
|
||||
| 2026-11-08 | CMS session: dependency bump done as own commit e37b8f3 (System.Security.Cryptography.Xml 10.0.14, zod ^4.6.6, @tanstack/react-router 1.170.46 -> seroval 1.7.9, no override; dotnet vulnerable clean, pnpm audit --prod clean). It confirms all my --cms checks should match. It does NOT push on a relayed message: Bryan must give the explicit go in the CMS session (its rule, matches Bryan's saved preference). Pending there too: Monitoring Setup questions (operations/plans/monitoring-setup-plan.md, recommended answers A/D). U3 code done here (uncommitted): serverConfig.ts proxy :5200 + test, regenerated proxy conf, verify-deployment.sh --cms, config/printCsp.ts, CI step (ASF_TEST_SERVED_BY_CMS, setup-node), 2 new e2e tests; unit 27/27 and verify e2e 18/18 green | CMS session message, this session |
|
||||
| 2026-11-08 | Pi-Main: Bryan already did 19e on 2026-11-07 (Pi-Entry /etc/nginx/conf.d/andreaslop-test.conf now proxy_pass http://192.168.1.103:5200; restore point /root/andreaslop-test.conf.voor-asf). Consequence: test.andreaslop.nl returns 502 since then (port 5200 not listening, releases/ empty) until the first deploy. 19a-19e done; 19f (ASF_TEST_DEPLOY_ENABLED=true + deploy) waits for code on Gitea and Bryan's go. Live config matches the generator output except nothing else differs | Pi-Main message |
|
||||
| 2026-11-08 | Bryan explicitly approved (in this session's chat) pushing ONLY feature/andreaslop-site-hosting; CMS session pushed it (6 commits). Branch push starts no CI (workflow: push master, pull_request, workflow_dispatch). Bryan chose manual workflow_dispatch in Gitea on that branch, no deploy boxes, no PR, no merge. Monitoring Setup answered by Bryan: Q1 A, Q2 D, Q3 A, Q4 A, Q5 A | user, CMS session message |
|
||||
| 2026-11-08 | Monitoring Setup artifacts done by the CMS session (operations/monitoring/monitoring-plan.md + monitoring-setup.md, local commit e44cf49, not pushed); approved by this session; next stage Production Readiness (test only). Sentry alert rules NOT created yet (shared website Sentry project): to be created from this session after the first successful deploy, with Bryan's go. Waiting for Bryan to start workflow_dispatch on the branch (no deploy boxes) | CMS session message, this session |
|
||||
| 2026-11-08 | Production Readiness (test scope) done by the CMS session (operations/production-readiness-checklist.md, commit b60b313 local): verdict Yes with caveats; appsettings compliance passes. Open: CI proof via Bryan's workflow_dispatch; first test deploy after explicit go; post-deploy verification and hand-back; Sentry alert rules (this session); test DB in backup script (Pi-Main: script reads SHOW DATABASES, expected fine); merging to master auto-deploys the shared Core change to SlpSoftware test; doc commits unpushed; production items listed only | CMS session message |
|
||||
| 2026-11-08 | Bryan asked this session or the CMS session to start the CI run instead of clicking. Dispatched by this session via the Gitea API (credentials from git credential fill, not shown): run 606, workflow_dispatch on feature/andreaslop-site-hosting (head e37b8f3), inputs deploy_test/deploy_production/deploy_asf_test all false. CMS session follows the result | user, this session |
|
||||
| 2026-11-08 | Bryan had already set ASF_TEST_DEPLOY_ENABLED=true (my 'unset' was outdated); explains config-asf running in run 606, so the vars gate works. Deploy of ASF is still blocked in run 606 by deploy_asf_test=false. Consequence: a push to master now deploys ASF test; first ASF deploy possible without merge via workflow_dispatch on the branch with only 'Deploy ASF test' ticked, needs Bryan's go after run 606 is green. Run 606 mid-run: backend-build, vulnerability-scan, frontend-prepare success; backend-test running | user, this session |
|
||||
| 2026-11-08 | CI run 606 (head e37b8f3): FAILURE only on one frontend test (SetupPage.test first test, lazy-route spinner, 292/293; same tests pass 8x locally; frontend-test ~290 s on master too -> suspected cold-start flake). Green: backend-test with MariaDB (ASF.Tests 10/10 incl. 5 HostPipelineTests, Api.Tests 4/4, Core 351, Identity 57, Availability 82, Master 57, Offerings 57), vulnerability-scan, frontend-build, lint. All publish/deploy jobs skipped, nothing deployed. Vars in job-level if works. This session re-dispatched as run 607 (same inputs); if it fails again the CMS session finds the root cause first | CMS session message, this session |
|
||||
| 2026-11-08 | Bryan: 'jullie hebben toestemming de pipeline samen te fixen ... een deploy te doen zodra de pipeline slaagt ... te pushen en als het nodig is een PR te maken'. Relayed to the CMS session with scope: fix pipeline in separate commits, push the feature branch, open a PR if needed, NO merge (master merge also deploys SlpSoftware test, needs separate approval); first ASF TEST deploy via workflow_dispatch with only 'Deploy ASF test' once a branch run is fully green; production never | user, this session |
|
||||
| 2026-11-08 | Run 607 fully green (backend-test incl. Api.Tests + ASF HostPipelineTests, vulnerability-scan, frontend; no deploy job ran; vars in job-level if works). CMS docs updated and pushed (branch at 91f14d5, code identical to e37b8f3); no PR, no merge. First ASF TEST deploy dispatched by the CMS session: run 608, workflow_dispatch on feature/andreaslop-site-hosting, deploy_asf_test=true, others false (before: /health 502 as expected). Expected ~35 min incl. the gate chain | CMS session message |
|
||||
| 2026-11-08 | FIRST ASF TEST DEPLOY DONE: run 608 (dispatch on feature/andreaslop-site-hosting, deploy_asf_test=true): all gates green, publish-asf-test + deploy-asf-test success incl. public /health; live https://test.andreaslop.nl/health Healthy (modules Identity, Availability). CMS session curl checks: / 200, exact CSP, HSTS, nosniff, DENY, Referrer-Policy, X-Robots-Tag, no-cache on pages, immutable on assets, gzip (no br), 301s, /a%3Fb/ -> 301 /a%3Fb, 404 pages with full headers, API 404 empty, robots Disallow, POST with body 405, /admin/ 200 with themed favicon, capabilities without Offerings, Setup/status {initialized:false, tokenRequired:true}. Difference: bare POST without body gets 400 from the HTTP/1.0 proxy hop (Kestrel); verify script now uses -d ''. This session: ran verify --cms from the PC: all header/route checks pass; only byte-equality of pages fails because my local dist (no CI env, different asset hashes) is not the CI build that was deployed (web CI run 605 on master 16b75af deployed it). Rate limit probe: 5x200 then 429 on the 6th; Pi-Main asked to read the journal for the client address (forwarded headers). Open: first administrator + removal of Identity__Setup__Token, Sentry alert rules, Pi timing, admin in Dutch (browser) | CMS session message, this session |
|
||||
| 2026-11-08 | Pi-Main journal check: rate limit works (5x200 then 429 with security event 5005 rate_limit_triggered, login limiter) but the event line holds no client address; Website 301/404 lines present; scheme taken from X-Forwarded-Proto (https) so ForwardedHeaders middleware is active for the trusted proxy; per-client partition not directly proven (second real client needed, e.g. phone on mobile data). U3 committed in the web worktree (41a6e7b code, 288b0e3 docs), pushed feature/cms-api-foundation, PR #17 opened to master for CI (not merged). Local: lint, prettier, 1415 unit tests, verify e2e 18/18 green | Pi-Main message, this session |
|
||||
| 2026-11-08 | BUG found by Bryan on the live ASF test host: /admin shows a blank page. Evidence (curl): /admin/ 200 (SPA fallback index) but every admin file 404s with an empty body (/admin/assets/*.css|js, /admin/favicon-theme.png, /admin/index.html) while the same on SlpSoftware test works; /admin/assets/ -> 200. Console also shows an inline-script CSP violation for the theme-init script, which is identical on SlpSoftware test (pre-existing, harmless). Sent to the CMS session for root cause first (suspects: PrerenderedPages pipeline/static file provider, or admin files missing in the release); HostPipelineTests missed it (only /admin/ fetched). Verify script must also fetch a real admin asset | user, this session |
|
||||
| 2026-11-08 | Root cause of the blank admin (CMS session, reproduced locally): MapCmsWebsiteNotFound's catch-all {*path} (no 'nonfile' constraint, only in PrerenderedPages) gets selected as endpoint before the static file middleware, which skips requests that already have an endpoint; /admin/ works because the admin fallback serves index.html. HostPipelineTests only fetched /admin/. Fix approved with a suggestion to constrain the catch-all away from reserved prefixes instead of clearing the endpoint; tests listed (admin asset + favicon, /admin/dashboard SPA, unknown admin file 404 not HTML, API 404, website unchanged); re-deploy with the permission given. This session: verify --cms now fetches /admin/index.html, /admin/favicon-theme.png, css/js from the served index and an unknown admin file (live host currently fails these 4 checks, as expected); committed and pushed to PR #17 | CMS session message, this session |
|
||||
| 2026-11-08 | Admin bug fixed by the CMS session with a route constraint (NotReservedPathConstraint on the website catch-all; /admin, /api/v1, /health keep SpaFallback behaviour). Core tests 356 green x3 (admin index/css/js/favicon 200, /admin/dashboard + /admin/setup SPA index, missing admin file 404 not HTML, unknown API path empty 404, missing /assets file website 404). ASF HostPipelineTests cannot fetch real admin assets (no built wwwroot/admin in the test host), covered by Core integration tests. Pushed d0c1d26 to feature/andreaslop-site-hosting; ASF deploy re-dispatched: run 610 (~35 min). Inline-script CSP item recorded as open | CMS session message |
|
||||
| 2026-11-08 | Run 610 (head d0c1d26) green: all gates + publish-asf-test + deploy-asf-test; admin files now 200 with correct content types, /admin/dashboard SPA, missing admin file 404 not HTML. This session: verify --cms against the live host: all admin and header/route checks pass; only the 6 byte-equality/hash checks of pages fail because my local dist is not the CI build (expected). Open: first administrator + token removal, forwarded-header per-client proof (phone test), Sentry alert rules, inline theme-init script vs CSP (pre-existing), Pi timing, doc commit unpushed on the CMS branch, PR #17 CI in the web repo | CMS session message, this session |
|
||||
| 2026-11-08 | BUG 2 from Bryan: first admin registration and inviting a user work; invite link https://test.andreaslop.nl/invite/complete?token=... shows the website 404 page. Finding: UsersController builds root-relative links /invite/complete?token=... without the admin base; on ASF the root is the prerendered website; /admin/invite/complete returns 200 on ASF and SlpSoftware (SlpSoftware works at root by accident of its fallback). Sent to the CMS session for root cause first, then fix (links with the admin base from one constant, check other root-relative links, SlpSoftware compatibility), push, re-deploy ASF test; no merge | user, this session |
|
||||
| 2026-11-08 | BUG 2 root cause confirmed by the CMS session: backend returns app-relative /invite/complete?token=...; the frontend builds the shown URL with window.location.origin + inviteLink in 3 places (InviteUserDialog 82 and 166, UsersPage 105), ignoring the router basepath (/admin/ in builds). Fix chosen by the CMS session and agreed here: frontend helper origin + BASE_URL + inviteLink (no Identity change, SlpSoftware unaffected, old links keep working); tests + push + ASF re-deploy | CMS session message, this session |
|
||||
| 2026-11-08 | BUG 2 fix pushed by the CMS session (0908f42, branch only): lib/links.ts buildAppUrl = origin + BASE_URL + path in InviteUserDialog (2x) and UsersPage; tests for bases /admin/, /, /admin, /admin//, path without leading slash, encoded token; frontend 304 tests, eslint, tsc green; no backend change. ASF redeploy dispatched: run 612 (~40-60 min) | CMS session message |
|
||||
| 2026-11-08 | Web PR #17: run 609 (288b0e3) green; run 611 (1a37dc2, verify script only) FAILED in the lighthouse job (Browsertests/Lighthouse steps): the log ends abruptly mid-e2e at 10:35:00Z (all visible tests passed, 18 verify tests incl. new --cms ones green, no error line) -> looks like the job/container was killed (suspect: runner on the PC Podman machine, 4 GiB, while I ran heavy local tests), not a code failure; unproven. Re-ran run 611 via API (rerun endpoint works). If it fails again at a real test, root cause first | this session |
|
||||
| 2026-11-08 | Run 612 (head 0908f42) green: all gates + publish-asf-test + deploy-asf-test. Live: /health version 1.0.0+0908f42; /admin/invite/complete?token=x 200 text/html (checked here too); old /invite/complete 404 website page (acceptable). Existing pending invites also fixed in the UI (URL built client-side). Notification sent to Bryan. This session's verify --cms: all checks pass except the 6 byte/hash checks caused by the local (non-CI) dist | CMS session message, this session |
|
||||
| 2026-11-10 | CMS side approved by Bryan after testing both test environments: CMS PR #11 (identity-email-notifications + the ASF-hosting branch) merged to SlpModularCms master (merge-commit e671078, CI green) and SlpSoftware production deployed (run 639, healthy per Pi-Main journal: mail on, migrations applied, no master-URL warnings). Bryan gave this session the go to merge web PR #17 and close the AI-DLC flow. Required env name on every master host: MasterModule__MasterUrl | user, CMS session, Pi-Main |
|
||||
| pending | U2 Build and Test approval by Bryan (CMS session); CI vulnerability-scan decision; go for U3 | |
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
# Application Design: cms-api-foundation (consolidated)
|
||||
|
||||
Details: [components.md](components.md), [component-methods.md](component-methods.md), [services.md](services.md), [component-dependency.md](component-dependency.md).
|
||||
|
||||
## Summary
|
||||
|
||||
Andrea's site runs from a new client host, `SlpModularCms.Api.AndreaSlopFotografie`, in the CMS repo. The host serves the admin (`/admin`), the API (`/api/v1`) and the prerendered site (`/`) in one process. Additive changes to the shared host give it a prerendered-site mode with the hosting behaviour nginx provides today, and a third code-defined CSP policy, `StrictSite`. The admin gets a per-site theme and default language through build-time variables. The web repo gains a delivery job and an extended deployment check that doubles as the CSP drift guard.
|
||||
|
||||
## Design decisions
|
||||
|
||||
| # | Decision | Consequence |
|
||||
|---|---|---|
|
||||
| D1 | A site's modules = the module projects its client references (existing DLL mechanism). No config filter. | No new filter code. Andrea does not reference `Offerings`; adding the reference later switches it on. Requirements FR-2 updated accordingly. |
|
||||
| D2 | New policy `StrictSite` in `CspPolicyCatalog`. | Admin `Strict` unchanged. Site CSP equals the current nginx one when the origin lists match. |
|
||||
| D3 | CSP drift guard = exact-CSP assertion in the web repo's `verify-deployment.sh`. | Cross-repo coupling stays in one script; drift fails the web deploy. |
|
||||
| D4 | Hosting parity for what the site relies on: canonical redirects, `404.html` with status 404, cache rules, text compression, per-environment `noindex` and `robots.txt`. | The host replaces nginx without changing SEO behaviour; test is not indexed. |
|
||||
| D5 | Serving mode is code (`CmsHostOptions` in the client's `Program.cs`); environment-dependent settings are appsettings. | `SpaFallback` stays the default, so `Api` and `Api.SlpSoftware` do not change. |
|
||||
| D6 | Theme = folder with CSS token overrides and assets, selected with `VITE_THEME`; default language with `VITE_DEFAULT_LANGUAGE`. | One admin source tree, one build per client; no theme API. |
|
||||
| D7 | The brief lives in this repo and a copy is placed in the CMS repo's AIDLC folder. | The location inside the CMS workspace is agreed with the CMS session when handing over. |
|
||||
| D8 | Reserved prefixes (`/admin`, `/api/v1`, `/health`) are never handled by the website middleware. | An unknown API path remains an API 404 instead of the site's 404 page. |
|
||||
|
||||
## Security Baseline compliance (design level)
|
||||
|
||||
| Rule | Status | Note |
|
||||
|---|---|---|
|
||||
| SECURITY-04 headers | Compliant by design | `StrictSite` carries a restrictive CSP (no `unsafe-inline` in `script-src`, no `unsafe-eval`); HSTS, nosniff, DENY and Referrer-Policy come from the existing header writer. To confirm in Functional Design: HSTS is emitted for the website path. `style-src 'unsafe-inline'` is the existing, documented exception (Chakra/Emotion runtime styles). |
|
||||
| SECURITY-05 input validation | Compliant by design | The only new input is the request path: the resolver is total, rejects traversal and never leaves the website root. Property tests (PBT-03 invariants) planned. |
|
||||
| SECURITY-08 access control | Compliant | The site is public by intent; `/admin` and `/api/v1` unchanged. |
|
||||
| SECURITY-09 hardening | To verify | No directory listing (resolver serves files only); generic errors by the existing handler. The first-administrator setup endpoint on the new instance must be protected until the first admin exists (NFR/FR-11), assessed in NFR Requirements. |
|
||||
| SECURITY-10 supply chain | Compliant | No new dependencies (built-in response compression); lock files stay committed. |
|
||||
| SECURITY-11 secure design | Compliant | Security logic stays in dedicated catalog and header components. Misuse case: path traversal and cache poisoning through non-canonical URLs, handled by the resolver. Rate limiting stays on login. |
|
||||
| SECURITY-13 integrity | Compliant | Delivery is by the pipelines; CSP drift guard added. |
|
||||
| SECURITY-15 fail safe | Compliant | Unknown policy names fail startup; missing `404.html` falls back to a plain 404. |
|
||||
| SECURITY-01, 02, 03, 06, 07, 14 | Deferred | Assessed in NFR Requirements and Infrastructure Design (database TLS, proxy access logs, deploy identity, network exposure, alerting). |
|
||||
|
||||
No blocking security findings at this stage.
|
||||
|
||||
## Open items for the next stages
|
||||
|
||||
- Which module projects the new host must reference at minimum (Identity and Availability dependency) is a Functional Design finding of the CMS session.
|
||||
- Exact canonicalisation rules and the file-resolution order are Functional Design, derived from `web/config/canonicalUrls.ts` and the web's BR-HST rules.
|
||||
- Whether the test host's existing reverse proxy (nginx on the Pi) stays in front of the CMS host (TLS, access logs) is decided in Infrastructure Design.
|
||||
- Node/SSR remains undecided and is outside step 0 (requirements Q2).
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
# Component Dependencies: cms-api-foundation
|
||||
|
||||
## Dependency matrix
|
||||
|
||||
Rows depend on columns ("x" = depends on).
|
||||
|
||||
| | C1 host | C2 options | C3 site serving | C4 StrictSite | C5 theme | C6 CMS CI | C7 delivery | C8 verify |
|
||||
|---|---|---|---|---|---|---|---|---|
|
||||
| **C1 Api.AndreaSlopFotografie** | | x | x (via CmsHost) | x (config) | | | | |
|
||||
| **C2 CmsHostOptions** | | | | | | | | |
|
||||
| **C3 Site serving** | | x | | | | | | |
|
||||
| **C4 StrictSite** | | | | | | | | |
|
||||
| **C5 Theme** | | | | | | | | |
|
||||
| **C6 CMS CI** | x | | | | x | | | |
|
||||
| **C7 Site delivery** | x (target) | | | | | x (host exists) | | |
|
||||
| **C8 Verify** | x (live) | | x (behaviour) | x (behaviour) | | | x | |
|
||||
|
||||
## Dependency diagram
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
C2["C2 CmsHostOptions"]
|
||||
C3["C3 Prerendered site serving"]
|
||||
C4["C4 StrictSite policy"]
|
||||
C1["C1 Api.AndreaSlopFotografie"]
|
||||
C5["C5 Admin theme"]
|
||||
C6["C6 CMS CI"]
|
||||
C7["C7 Site delivery (web repo)"]
|
||||
C8["C8 Deployment verification (web repo)"]
|
||||
C3 --> C2
|
||||
C1 --> C2
|
||||
C1 --> C3
|
||||
C1 --> C4
|
||||
C6 --> C1
|
||||
C6 --> C5
|
||||
C7 --> C6
|
||||
C8 --> C7
|
||||
C8 -. checks .-> C3
|
||||
C8 -. checks .-> C4
|
||||
classDef cms fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
|
||||
classDef web fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
|
||||
classDef newc fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
|
||||
class C2,C3,C4,C5,C6 cms;
|
||||
class C7,C8 web;
|
||||
class C1 newc;
|
||||
```
|
||||
|
||||
Text alternative: The new client host depends on the options, site serving and the StrictSite policy; the CMS CI builds the host and theme; the web repo's delivery depends on the CMS CI having deployed the host; verification checks the live behaviour of serving and policy. Blue = CMS repo, green = web repo, yellow = new client host.
|
||||
|
||||
## Communication patterns
|
||||
|
||||
- **Compile time**: the client project references `Core` and its modules (this is also what selects the modules). `CmsHostOptions` is passed in code.
|
||||
- **Configuration**: `SecurityHeaders` and `Website` sections per environment (appsettings; no secrets).
|
||||
- **Build time**: the admin reads `VITE_*` variables; nothing about the theme reaches the API.
|
||||
- **Deploy time**: the CMS CI delivers the release; the web CI delivers site files into `wwwroot/web/`. The two never write into each other's directories.
|
||||
- **Runtime**: the browser calls the host same-origin for everything (site, `/admin`, `/api/v1`); no CORS for the site.
|
||||
|
||||
## Data flow: a request for a site page
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
R["Browser request /over-mij"]
|
||||
H["Security headers (StrictSite)"]
|
||||
RES["PrerenderedPathResolver"]
|
||||
F["Serve over-mij.html"]
|
||||
RD["301 to canonical path"]
|
||||
NF["404.html, status 404"]
|
||||
R --> H --> RES
|
||||
RES -->|file found| F
|
||||
RES -->|non-canonical form| RD
|
||||
RES -->|unknown| NF
|
||||
classDef step fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
|
||||
classDef ok fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
|
||||
classDef bad fill:#fc8181,stroke:#c53030,stroke-width:1px,color:#000;
|
||||
class R,H,RES step;
|
||||
class F,RD ok;
|
||||
class NF bad;
|
||||
```
|
||||
|
||||
Text alternative: A page request gets the security headers, then the path resolver decides between serving the page file, redirecting to the canonical URL or returning the 404 page with status 404.
|
||||
|
||||
## Cross-session dependencies
|
||||
|
||||
- C7 and C8 changes in `web/deploy` and CI are the only web-repo changes; they start after the Testimonials feature has merged or overlap is ruled out.
|
||||
- C1 to C6 are built by the CMS session; their approved design and hand-back are recorded in `construction/cms-host/`.
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
# Component Methods: cms-api-foundation
|
||||
|
||||
High-level signatures only. Business rules (exact canonicalisation, edge cases, error handling) are defined in Functional Design by the CMS session. Names are indicative; the CMS session may rename them.
|
||||
|
||||
## C2. `CmsHostOptions`
|
||||
|
||||
```csharp
|
||||
public enum WebsiteMode { SpaFallback = 0, PrerenderedPages = 1 }
|
||||
|
||||
public sealed class CmsHostOptions
|
||||
{
|
||||
public WebsiteMode WebsiteMode { get; init; } = WebsiteMode.SpaFallback;
|
||||
}
|
||||
```
|
||||
|
||||
## C3a. `PrerenderedPathResolver` (pure)
|
||||
|
||||
```csharp
|
||||
public abstract record SiteResolution;
|
||||
public sealed record ServeFile(string RelativePath, bool IsPage) : SiteResolution; // IsPage drives cache policy
|
||||
public sealed record RedirectTo(string CanonicalPath) : SiteResolution; // 301, query added by caller
|
||||
public sealed record NotFound() : SiteResolution;
|
||||
|
||||
public sealed class PrerenderedPathResolver
|
||||
{
|
||||
public PrerenderedPathResolver(Func<string, bool> fileExists);
|
||||
public SiteResolution Resolve(PathString requestPath); // total: never throws, never escapes the root
|
||||
}
|
||||
```
|
||||
|
||||
## C3b. Middleware wiring
|
||||
|
||||
```csharp
|
||||
public static IApplicationBuilder UseCmsPrerenderedSite(this WebApplication app, CmsHostOptions options);
|
||||
// - registered where UseCmsStaticContent registers the website mount
|
||||
// - skips reserved prefixes: /admin, /api/v1, /health
|
||||
// - NotFound -> serve 404.html with status 404 (plain 404 if 404.html is missing)
|
||||
```
|
||||
|
||||
## C3c. `WebsiteCachePolicy`
|
||||
|
||||
```csharp
|
||||
public static string CacheControlFor(SiteResolution resolution); // pages: "no-cache"; /assets/*: long-lived immutable; other files: short default
|
||||
```
|
||||
|
||||
## C3d. `WebsiteIndexingPolicy`
|
||||
|
||||
```csharp
|
||||
public sealed class WebsiteOptions { public bool NoIndex { get; set; } } // section "Website"
|
||||
public static IEndpointRouteBuilder MapCmsRobots(this IEndpointRouteBuilder app, WebsiteOptions options);
|
||||
// NoIndex: adds X-Robots-Tag header to website responses and answers /robots.txt "User-agent: *\nDisallow: /"
|
||||
```
|
||||
|
||||
## C4. `CspPolicyCatalog`
|
||||
|
||||
```csharp
|
||||
public const string StrictSite = "StrictSite";
|
||||
public static SecurityHeaderSet Build(string policy, IEnumerable<string> scriptOrigins, IEnumerable<string> connectOrigins);
|
||||
// StrictSite: script-src 'self' + scriptOrigins; connect-src 'self' + connectOrigins; FrameOptions "DENY".
|
||||
// Strict and Relaxed unchanged. KnownPolicies includes StrictSite.
|
||||
```
|
||||
|
||||
## C1. `Api.AndreaSlopFotografie/Program.cs`
|
||||
|
||||
```csharp
|
||||
var orchestrator = CmsHost.ConfigureServices(builder, new CmsHostOptions { WebsiteMode = WebsiteMode.PrerenderedPages });
|
||||
var app = builder.Build();
|
||||
CmsHost.ConfigurePipeline(app, orchestrator, new CmsHostOptions { WebsiteMode = WebsiteMode.PrerenderedPages });
|
||||
```
|
||||
|
||||
## C5. Admin theme selection (build time)
|
||||
|
||||
```text
|
||||
VITE_THEME -> frontend/themes/<name>/theme.css (+ logo, favicon); unset = default theme
|
||||
VITE_DEFAULT_LANGUAGE -> "nl" | "en"; unset = current default
|
||||
VITE_APP_TITLE -> existing
|
||||
```
|
||||
|
||||
## C8. Deployment verification (shell, extends the existing script)
|
||||
|
||||
```text
|
||||
verify_csp_equals <url> <expectedCsp> # expectedCsp generated from contentSecurityPolicy('production')
|
||||
verify_status <url> <expectedStatus>
|
||||
verify_redirect <url> <expectedLocation>
|
||||
verify_header <url> <name> <expectedValue|absent>
|
||||
```
|
||||
@@ -0,0 +1,64 @@
|
||||
# Components: cms-api-foundation
|
||||
|
||||
Repository: **CMS** = `K:\Development\Projects\SlpModularCms`, **WEB** = this repo. Components marked "new" do not exist yet; "changed" exist and get an additive change. Everything under CMS is built by the CMS session in its own AIDLC; it may rename types, the responsibilities and interfaces are the contract.
|
||||
|
||||
## CMS repo
|
||||
|
||||
### C1. `SlpModularCms.Api.AndreaSlopFotografie` (new, client host)
|
||||
- **Purpose**: The deployable host for Andrea's site: admin, API and the prerendered website in one process.
|
||||
- **Responsibilities**:
|
||||
- Thin `Program.cs` on the shared `CmsHost`, like `Api.SlpSoftware`.
|
||||
- Module composition: references `Core` and only the module projects Andrea needs. `Offerings` is not referenced. Which other modules are required (Identity, and possibly Availability) is a Functional Design finding of the CMS session.
|
||||
- Sets `CmsHostOptions.WebsiteMode = PrerenderedPages`.
|
||||
- Own appsettings (three-file pattern), own database, own dev port.
|
||||
- Security header configuration: `SecurityHeaders:DefaultPolicy = StrictSite` and `AllowedScriptOrigins` / `AllowedConnectOrigins` for Umami and Sentry.
|
||||
- Website indexing setting (`Website:NoIndex`) per environment.
|
||||
- **Interfaces**: the shared `CmsHost.ConfigureServices` / `ConfigurePipeline` calls; configuration sections `SecurityHeaders`, `Website`.
|
||||
|
||||
### C2. `CmsHostOptions` (changed, in Core)
|
||||
- **Purpose**: The documented extension point for per-client differences.
|
||||
- **Responsibilities**: carries `WebsiteMode` (`SpaFallback` default, `PrerenderedPages`). The default keeps `Api` and `Api.SlpSoftware` unchanged.
|
||||
- **Interface**: `WebsiteMode WebsiteMode { get; init; }`.
|
||||
|
||||
### C3. Prerendered website serving (new, in Core `Hosting`)
|
||||
Four parts, replacing the website half of `UseCmsStaticContent` and `MapCmsSpaFallbacks` when `WebsiteMode = PrerenderedPages`:
|
||||
- **C3a `PrerenderedPathResolver`** (pure function, no I/O beyond a file-existence predicate): maps a request path to one of `Serve(file)`, `Redirect(canonicalPath)`, `NotFound`. Rules: `/` serves `index.html`; `/x` serves `x.html` (also `x/index.html` if present); canonical form is lowercase, without `.html`, without trailing slash, query preserved; paths that look like a file are served as files or 404; traversal attempts never leave the website root; reserved prefixes (`/admin`, `/api/v1`, `/health`) are never handled here.
|
||||
- **C3b `PrerenderedSiteMiddleware`**: applies the resolver, serves files, answers `404.html` with status 404 for unknown paths (never `index.html`), issues canonical 301 redirects, and excludes reserved prefixes so an unknown `/api/v1/x` stays a plain API 404, not the website's 404 page.
|
||||
- **C3c `WebsiteCachePolicy`**: `Cache-Control: no-cache` for pages, long-lived immutable for hashed `/assets`.
|
||||
- **C3d `WebsiteIndexingPolicy`**: when `Website:NoIndex` is true, adds `X-Robots-Tag: noindex, nofollow` and serves `/robots.txt` as "disallow all". Off by default.
|
||||
- **Compression** uses the built-in ASP.NET response compression for the same text types as `web/config/compressibleTypes.ts`; no new dependency.
|
||||
|
||||
### C4. `CspPolicyCatalog.StrictSite` (changed, in Core `Hosting/Security`)
|
||||
- **Purpose**: The third code-defined policy for a strict, script-from-self public site.
|
||||
- **Responsibilities**: `Strict` directives plus configured script origins in `script-src` and configured connect origins in `connect-src`; `X-Frame-Options: DENY`; `frame-ancestors 'none'`. `Strict` and `Relaxed` do not change. `PathPolicyRule` and startup validation accept the new name (unknown names still fail startup).
|
||||
- **Interface**: `CspPolicyCatalog.Build("StrictSite", scriptOrigins, connectOrigins) -> SecurityHeaderSet`.
|
||||
|
||||
### C5. Admin theming (changed, CMS `frontend/`)
|
||||
- **Purpose**: Make the admin match a site's identity without per-site code.
|
||||
- **Responsibilities**:
|
||||
- Default theme = today's tokens in `index.css`.
|
||||
- A theme folder `frontend/themes/<name>/` with a CSS file overriding the tokens (colours, radius, font) and the assets (logo, favicon).
|
||||
- `VITE_THEME` selects the folder at build time; `VITE_APP_TITLE` already names the app; a new build-time `VITE_DEFAULT_LANGUAGE` sets the default admin language (NL for Andrea, EN remains selectable).
|
||||
- First theme: `themes/andreaslop/` from the site's identity (source: `design/andreaslop-static/` and the web theme in this repo).
|
||||
- **Interface**: build-time environment variables only. No API.
|
||||
|
||||
### C6. CMS CI/CD (changed, `.gitea/workflows/continuous_integration.yaml`, `deploy-scp.yaml`)
|
||||
- **Purpose**: Build and deploy Andrea's host.
|
||||
- **Responsibilities**: build the admin once per deployable client with its `VITE_THEME` / `VITE_DEFAULT_LANGUAGE` / `VITE_APP_TITLE`; publish `Api.AndreaSlopFotografie`; deploy to the test host with the existing atomic release switch; keep `wwwroot/web/` outside the swapped release directory.
|
||||
|
||||
## WEB repo (this repo)
|
||||
|
||||
### C7. Site delivery (new)
|
||||
- **Purpose**: Get the prerendered build onto Andrea's CMS host.
|
||||
- **Responsibilities**: a CI job that builds the site and delivers the output (`index.html`, `*.html`, `404.html`, `assets/`, `robots`/sitemap files as built) to `wwwroot/web/` of the test host; keeps the old nginx deployment until the new route passes; afterwards retires the static test site.
|
||||
- **Interface**: file delivery into `wwwroot/web/` (the contract in the CMS repo's `WEBSITE_WORKSPACE.md`).
|
||||
|
||||
### C8. Deployment verification (changed, `web/deploy/verify-deployment.sh`)
|
||||
- **Purpose**: Prove the new host serves the site as the old one did, and guard CSP drift.
|
||||
- **Responsibilities**: assert the exact CSP from `contentSecurityPolicy('production')` (`web/config/securityHeaders.ts`) and the other security headers; assert canonical redirects, `404.html` with status 404, caching and `noindex` on test; assert that `/admin`, `/api/v1/System/capabilities` and `/health` respond.
|
||||
|
||||
## Process component
|
||||
|
||||
### C9. Hand-off (new, documents)
|
||||
- **Purpose**: Moves a feature brief to the CMS session and brings the result back.
|
||||
- **Responsibilities**: the brief is written in this repo's AIDLC folder and a copy is placed in the CMS repo's AIDLC folder (owner decision). The CMS session runs its own AIDLC. The hand-back is a changelog plus the changed contract, verified here by the C8 checks.
|
||||
@@ -0,0 +1,54 @@
|
||||
# Services: cms-api-foundation
|
||||
|
||||
The solution has no new domain services: step 0 adds hosting behaviour (middleware and policy) and build/deploy automation. This document defines the orchestration points.
|
||||
|
||||
## S1. Host composition (`CmsHost`)
|
||||
|
||||
- **Responsibility**: single place where a client host's services and pipeline are composed. `ConfigureServices` and `ConfigurePipeline` keep their signatures; the new behaviour enters through `CmsHostOptions`.
|
||||
- **Orchestration (pipeline order, with the reason)**:
|
||||
1. `MigrateCoreDatabase` (unchanged).
|
||||
2. Exception handler, then security headers, then rate limiter (unchanged). Security headers must stay before static content: static files short-circuit the pipeline, and the website's HTML is almost all the host serves.
|
||||
3. HTTPS redirection (unchanged).
|
||||
4. **Static content**: admin mount first (unchanged). The website mount is either the existing static mount plus SPA fallback (`SpaFallback`) or the prerendered-site middleware (`PrerenderedPages`). Response compression sits before both.
|
||||
5. CORS, modules, authentication, authorization, controllers, health, Sentry tunnel (unchanged).
|
||||
6. The website fallback (`NotFound` -> `404.html`) is the last step, after the API routes, so an unknown API path stays an API 404.
|
||||
- **Invariant**: reserved prefixes `/admin`, `/api/v1`, `/health` are never resolved by the website middleware.
|
||||
|
||||
## S2. Security header resolution (existing `PathPolicyResolver` + `CspPolicyCatalog`)
|
||||
|
||||
- **Responsibility**: path -> policy name (configuration) -> header values (code).
|
||||
- **Change**: the catalog knows `StrictSite`. Andrea's client sets `DefaultPolicy = StrictSite`; the three reserved prefixes stay `Strict`. Startup validation rejects unknown names (unchanged), so a typo cannot produce a weaker policy.
|
||||
|
||||
## S3. Build and deploy service chain (CI)
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
box rgba(246,224,94,0.4) CMS repo
|
||||
participant CC as CMS CI
|
||||
end
|
||||
box rgba(99,179,237,0.4) Web repo
|
||||
participant WC as Web CI
|
||||
end
|
||||
box rgba(154,230,180,0.4) Test host
|
||||
participant H as Andrea CMS host
|
||||
end
|
||||
CC->>CC: build admin with VITE_THEME andreaslop
|
||||
CC->>CC: publish Api.AndreaSlopFotografie
|
||||
CC->>H: deploy release, atomic switch
|
||||
WC->>WC: build prerendered site
|
||||
WC->>H: deliver files to wwwroot/web
|
||||
WC->>H: verify headers, redirects, 404, CSP
|
||||
H-->>WC: results
|
||||
```
|
||||
|
||||
Text alternative: the CMS CI builds and deploys the host with its themed admin; the web CI builds the site, delivers it into the host's website folder and then verifies the host's behaviour.
|
||||
|
||||
- **Ordering rules**: the CMS release switch never touches `wwwroot/web/`; the web delivery is idempotent and can run without a CMS deploy; the old static test site stays up until verification passes.
|
||||
|
||||
## S4. Verification service (`verify-deployment.sh`)
|
||||
|
||||
- **Responsibility**: the contract test between the repositories. It runs from the web repo against the live host and is the CSP drift guard (design decision Q3).
|
||||
|
||||
## S5. Hand-off service (process)
|
||||
|
||||
- **Responsibility**: brief out, hand-back in; see C9. The CMS session's AIDLC outputs (its design summary and its hand-back note) are copied or linked under `construction/cms-host/` in this feature.
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
# Unit of Work Dependencies: cms-api-foundation
|
||||
|
||||
## Dependency matrix
|
||||
|
||||
Rows depend on columns.
|
||||
|
||||
| | U1 core-site-hosting | U2 andreaslop-client | U3 site-delivery |
|
||||
|---|---|---|---|
|
||||
| **U1 core-site-hosting** | | | |
|
||||
| **U2 andreaslop-client** | x (code: `WebsiteMode`, `StrictSite`) | | |
|
||||
| **U3 site-delivery** | | x (a deployed host to deliver into and verify) | |
|
||||
|
||||
## Diagram
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
U1["U1 core-site-hosting<br/>(CMS repo)"]
|
||||
U2["U2 andreaslop-client<br/>(CMS repo)"]
|
||||
U3["U3 site-delivery<br/>(web repo)"]
|
||||
CP1{{"Checkpoint: hand-back after U1"}}
|
||||
U1 --> CP1 --> U2 --> U3
|
||||
classDef cms fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
|
||||
classDef web fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
|
||||
classDef gate fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
|
||||
class U1,U2 cms;
|
||||
class U3 web;
|
||||
class CP1 gate;
|
||||
```
|
||||
|
||||
Text alternative: U1 and U2 are built in the CMS repo, with a hand-back checkpoint after U1; U3 in the web repo follows U2. Blue = CMS repo, green = web repo, yellow = checkpoint.
|
||||
|
||||
## Sequence and coordination
|
||||
|
||||
- **Critical path**: U1, U2, U3. No parallelism between units, because each needs the previous one's result; inside U2 the admin theme can be built in parallel with the host project.
|
||||
- **Checkpoint after U1**: `Api` and `Api.SlpSoftware` tests green and the hand-back note delivered. U2 starts only then (the brief for both units tells the CMS session to report here).
|
||||
- **Coordination points**: the reserved paths and the `wwwroot/web/` contract; the 404 page name (`404.html`) and the page files without folders (`name.html`); the exact CSP value (checked by U3); the host name and database of the test instance (decided in U2 Infrastructure Design).
|
||||
- **External dependency for U3**: the Testimonials feature merged, or overlap ruled out, because U3 touches the web CI and `web/deploy/`.
|
||||
- **Rollback**: U1 is additive and inactive by default (`SpaFallback`); U2 deploys a new host alongside the old test site; U3 retires the static test site only after verification, so every step can be reverted on test without data loss.
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
# Unit of Work Requirement Map: cms-api-foundation
|
||||
|
||||
User Stories were skipped (one persona; see the execution plan). This map assigns each requirement to its unit(s) instead. "Primary" owns the work; "also" contributes or verifies.
|
||||
|
||||
| Requirement | Summary | Primary unit | Also |
|
||||
|---|---|---|---|
|
||||
| FR-1 | Client project `Api.AndreaSlopFotografie` | U2 | |
|
||||
| FR-2 | Module set = referenced module projects | U2 | |
|
||||
| FR-3 | Existing hosts unchanged | U1 | U2 (SlpSoftware still builds and deploys) |
|
||||
| FR-4 | Per-site theme file, selected at build | U2 | |
|
||||
| FR-5 | Admin built per client in CI | U2 | |
|
||||
| FR-6 | Andrea's theme matches the site | U2 | |
|
||||
| FR-7 | Default admin language per site | U2 | |
|
||||
| FR-8 | Prerendered-site serving mode | U1 | |
|
||||
| FR-9 | SPA fallback remains available | U1 | |
|
||||
| FR-10 | CSP for `/` per client, no drift | U1 (policy) | U2 (configuration), U3 (drift check) |
|
||||
| FR-11 | Authentication unchanged, setup flow safe | U2 | |
|
||||
| FR-12 | Site build delivered to `wwwroot/web/` | U3 | U2 (target host) |
|
||||
| FR-13 | Web CI adapted, static test site retired after proof | U3 | |
|
||||
| FR-14 | Proof on test | U3 | Build and Test (phase level) |
|
||||
| FR-15 | Collaboration with the CMS session | Process (this session) | all units |
|
||||
| NFR-1 | Security Baseline | all units | U2 (setup flow, logging), U1 (headers, path input) |
|
||||
| NFR-2 | No security regression | U1 | U3 (exact CSP check) |
|
||||
| NFR-3 | Performance (compression, caching, Lighthouse) | U1 | U3 (Lighthouse comparison) |
|
||||
| NFR-4 | Compatibility with existing hosts | U1 | |
|
||||
| NFR-5 | Deployability on the Pi, atomic switch | U2 | U3 |
|
||||
| NFR-6 | Testing incl. partial PBT | U1 | U2 |
|
||||
| NFR-7 | Per-site differences only in client and theme | U2 | U1 |
|
||||
| NFR-8 | Documentation | U1 | U2 |
|
||||
|
||||
## Validation
|
||||
|
||||
- Every FR (1 to 15) and NFR (1 to 8) is assigned to a unit or to the process.
|
||||
- Every component C1 to C8 belongs to exactly one unit: C2, C3, C4 to U1; C1, C5, C6 to U2; C7, C8 to U3. C9 (hand-off) is the process component.
|
||||
- No unit depends on a later unit.
|
||||
@@ -0,0 +1,37 @@
|
||||
# Units of Work: cms-api-foundation
|
||||
|
||||
Three units. Terminology: a unit is a planning and build unit of one deployable system (the CMS host plus its admin) split into logical chunks; nothing here becomes an independently deployable service. Repository paths: **CMS** = `K:\Development\Projects\SlpModularCms`, **WEB** = this repo.
|
||||
|
||||
## U1 `core-site-hosting` (CMS repo, built by the CMS session)
|
||||
|
||||
- **Purpose**: Teach the shared host to serve a prerendered website the way nginx does today, and give such a site a strict CSP, without changing any existing host.
|
||||
- **Components**: C2 `CmsHostOptions.WebsiteMode`, C3 prerendered site serving (resolver, middleware, cache policy, indexing policy, compression), C4 `StrictSite` policy.
|
||||
- **Requirements**: FR-3, FR-8, FR-9, FR-10 (policy part), NFR-2, NFR-3, NFR-4, NFR-6 (resolver and policy tests), NFR-8 (CMS docs).
|
||||
- **Construction stages**: Functional Design, NFR Requirements, NFR Design, Infrastructure Design (only if the host change touches deployment; expected none), Code Generation.
|
||||
- **Done when**: unit and property-based tests pass; `Api` and `Api.SlpSoftware` behave unchanged (their tests green); `WEBSITE_WORKSPACE.md` and README describe the mode; the hand-back note is written. **Checkpoint**: the CMS session reports back after U1 before starting U2.
|
||||
- **Code location**: `src/SlpModularCms.Core/Hosting` (and `.../Security`) plus `src/SlpModularCms.Core.Tests`.
|
||||
|
||||
## U2 `andreaslop-client` (CMS repo, built by the CMS session)
|
||||
|
||||
- **Purpose**: Andrea's own host with a themed Dutch admin, deployed to test through the CMS CI/CD.
|
||||
- **Components**: C1 `SlpModularCms.Api.AndreaSlopFotografie` (project, appsettings, database, dev port, module references without `Offerings`, `WebsiteMode = PrerenderedPages`, `SecurityHeaders` and `Website` configuration), C5 admin theme `themes/andreaslop/` and `VITE_THEME`/`VITE_DEFAULT_LANGUAGE`, C6 CMS CI/CD (per-client admin build, publish, deploy, `wwwroot/web/` kept outside the swapped release).
|
||||
- **Requirements**: FR-1, FR-2, FR-4, FR-5, FR-6, FR-7, FR-10 (configuration part), FR-11, NFR-1 (setup flow exposure, logging), NFR-5, NFR-6 (client tests), NFR-7.
|
||||
- **Construction stages**: Functional Design (module minimum, setup flow), NFR Requirements, NFR Design, Infrastructure Design (database for the new host, ports, release layout, CI matrix), Code Generation.
|
||||
- **Done when**: the host starts on test with its own database, `/admin` shows Andrea's theme in Dutch and allows first-admin setup and login, `/api/v1/System/capabilities` lists no `Offerings`, `/health` is green, and `Api.SlpSoftware` still builds and deploys unchanged.
|
||||
- **Code location**: `src/SlpModularCms.Api.AndreaSlopFotografie`, `frontend/themes/andreaslop`, `.gitea/workflows`, solution placement under **Clients** per the CMS repo's `AGENTS.md`.
|
||||
|
||||
## U3 `site-delivery` (WEB repo, built by this session)
|
||||
|
||||
- **Purpose**: Get the prerendered site onto Andrea's host and prove it behaves like the old static deployment.
|
||||
- **Components**: C7 delivery job in the web CI, C8 extended `web/deploy/verify-deployment.sh` (exact CSP, canonical redirects, `404.html` status, cache and `noindex` on test, admin and API reachable), retiring the static nginx test site after proof.
|
||||
- **Requirements**: FR-12, FR-13, FR-14, FR-10 (drift guard), NFR-2, NFR-3 (Lighthouse not lower), NFR-5.
|
||||
- **Construction stages**: Infrastructure Design, Code Generation. (Functional Design, NFR Requirements and NFR Design are skipped as planned.)
|
||||
- **Done when**: a web CI run on the target branch delivers the build to the test host; verification passes; the static test site is retired.
|
||||
- **Code location**: this repo's CI workflow and `web/deploy/`. No change to `web/src`. Starts after the Testimonials feature has merged or overlap is ruled out.
|
||||
|
||||
## Cross-cutting
|
||||
|
||||
- **FR-15** (collaboration with the CMS session) spans all units. One brief covers U1 and U2 (owner decision); the CMS session sequences them and reports back after U1. The brief lives in this feature's folder and a copy is placed in the CMS repo's AIDLC folder.
|
||||
- **Build and Test** (phase level) covers the proof across all three units on test.
|
||||
- **Operations** (Deployment, Monitoring, Production Readiness) covers the new host on test.
|
||||
- **Code organisation**: brownfield; no new top-level directories in this repo. Documentation only under `aidlc-docs/features/cms-api-foundation/`; the CMS session records its approved design and hand-back under `construction/cms-host/` here.
|
||||
@@ -0,0 +1,90 @@
|
||||
# Application Design Plan: cms-api-foundation
|
||||
|
||||
Depth: minimal-to-standard, contract level. Detailed business rules are for Functional Design (U1, by the CMS session).
|
||||
|
||||
## What the code reading showed (inputs to the design)
|
||||
|
||||
- **Module discovery** (`ModuleOrchestrator.DiscoverModules`) loads every `SlpModularCms.Modules.*.dll` found next to the host and instantiates each `IModule`. So today "which modules" = which projects the client `.csproj` references. There is no config filter yet. MVC controller discovery is a separate mechanism and must be filtered too, or a disabled module's routes can still answer.
|
||||
- **`CmsHostOptions`** is an empty class, documented as the extension point for per-client differences, passed to both `CmsHost.ConfigureServices` and `ConfigurePipeline`.
|
||||
- **Static content** (`StaticContentExtensions`) mounts `wwwroot/web` at `/` with `UseDefaultFiles` plus an extensionless SPA fallback to `index.html`. It does not map `/over-mij` to `over-mij.html` and does not serve `404.html` with status 404.
|
||||
- **Security headers** are already per path: `SecurityHeadersOptions.PathPolicies` (first match wins) plus a code-defined `CspPolicyCatalog` with exactly two policies, `Strict` and `Relaxed`. `Strict` never gets extra script origins ("the admin SPA must not load script from anywhere but itself").
|
||||
- **The site's CSP** (`web/config/securityHeaders.ts`) is `Strict`-like but needs the Umami script origin in `script-src` and the Umami and Sentry ingest origins in `connect-src`. So neither existing catalog policy matches it.
|
||||
- **The site's build** (TanStack Start prerender) writes `over-mij.html`, `404.html` and `index.html` without folders, and externalizes inline scripts so the strict CSP works.
|
||||
- **The site's current nginx/IIS config** (generated by `web/config/serverConfig.ts`, rules BR-HST-01 to 11) does more than serve files: canonical-URL 301 redirects (uppercase, `.html`, trailing slash), `404.html` with status 404, the header set, `Cache-Control: no-cache` for pages and long caching for hashed `/assets`, gzip for text types, and on test `X-Robots-Tag: noindex` plus a `robots.txt` that disallows everything. The CMS host has to take over what matters of this.
|
||||
- **Admin build** already takes build-time variables (`VITE_APP_TITLE`, `VITE_API_BASE_URL`), so a per-site theme selector (`VITE_THEME`) fits the existing approach.
|
||||
- **CI/CD** in the CMS repo: `.gitea/workflows/continuous_integration.yaml` and `deploy-scp.yaml`.
|
||||
|
||||
## Plan
|
||||
|
||||
- [x] Analyze requirements and read the CMS host code (read-only)
|
||||
- [x] Collect answers to the design questions below
|
||||
- [x] Analyze answers for ambiguity; ask follow-ups if needed (none: Q1 clarified in chat and applied to FR-2)
|
||||
- [x] Generate `application-design/components.md`
|
||||
- [x] Generate `application-design/component-methods.md`
|
||||
- [x] Generate `application-design/services.md`
|
||||
- [x] Generate `application-design/component-dependency.md`
|
||||
- [x] Generate `application-design/application-design.md` (consolidated)
|
||||
- [x] Validate design completeness and consistency (including Security Baseline check)
|
||||
|
||||
## Design questions
|
||||
|
||||
### Question 1: Module switch
|
||||
|
||||
How does a client choose its modules?
|
||||
|
||||
- A) Every client references all module projects; an allowlist in configuration (`Modules:Enabled`) decides which are active. The orchestrator skips the others and a controller filter removes their routes. Hosts without the setting behave as today (everything discovered is active). Enabling a module later is a config change. Recommended: matches the decision "configuration switch per module".
|
||||
- B) Each client references only the modules it needs (what happens now). No new filter code, and unused module code is not on disk, but enabling a module later needs a code change and a new build.
|
||||
- X) Other (describe after the [Answer]: tag below)
|
||||
|
||||
[Answer]: B (owner: a module is on when its DLL is added to the client; no config filter, and not all functionality is built into every client)
|
||||
|
||||
### Question 2: How the site's CSP is realised
|
||||
|
||||
- A) A third, code-defined policy in `CspPolicyCatalog` (working name `StrictSite`): the `Strict` directives plus the configured script and connect origins. `Strict` for the admin stays untouched. Recommended: keeps "code decides what a policy means" and does not loosen the admin.
|
||||
- B) Let `Strict` accept the extra script origins. Fewer lines, but it weakens the admin's policy for every client.
|
||||
- X) Other (describe after the [Answer]: tag below)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
### Question 3: Keeping the two CSP definitions from drifting
|
||||
|
||||
The site's CSP lives in the web repo, the host's in the CMS repo.
|
||||
|
||||
- A) The web repo's existing deployment check (`web/deploy/verify-deployment.sh`) asserts that the deployed host sends exactly `contentSecurityPolicy('production')` from `securityHeaders.ts`. Drift fails the web deploy. Recommended: one extra assertion, no cross-repo coupling.
|
||||
- B) The site build emits a manifest with its CSP, which the host reads at startup. No drift, but the site (not CMS code) then decides its own policy, which goes against the CMS's code-defined policy design.
|
||||
- C) Document it only.
|
||||
- X) Other (describe after the [Answer]: tag below)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
### Question 4: How much of nginx's behaviour does the host take over
|
||||
|
||||
- A) Parity for what the site relies on: canonical-URL 301 redirects, `404.html` with status 404, `Cache-Control` (pages no-cache, `/assets` long), compression of text types, and on test `X-Robots-Tag: noindex` with a disallow-all `robots.txt` (configured per environment, so production does not get it). Recommended: otherwise the switch changes SEO behaviour and the test site could get indexed.
|
||||
- B) Minimal: serve the files, `404.html` with status 404 and the security headers. Redirects, caching and compression follow before production.
|
||||
- X) Other (describe after the [Answer]: tag below)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
### Question 5: Where per-client behaviour is configured
|
||||
|
||||
- A) The serving mode (prerendered pages versus SPA fallback) is a property of `CmsHostOptions`, set in the client's `Program.cs` (a property of the client's code). Environment-dependent things (noindex on test, allowed origins, enabled modules) go in appsettings. Recommended.
|
||||
- B) Everything in appsettings, including the serving mode.
|
||||
- X) Other (describe after the [Answer]: tag below)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
### Question 6: How a theme is applied to the admin
|
||||
|
||||
- A) A theme is a folder in the CMS `frontend/` (for example `themes/andreaslop/`) with a CSS file that overrides the existing tokens, plus logo and favicon. `VITE_THEME` selects it at build time; without it the default look stays. Recommended: smallest change to the current `index.css` tokens.
|
||||
- B) The theme is a JSON file with tokens that a build step turns into CSS.
|
||||
- X) Other (describe after the [Answer]: tag below)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
### Question 7: How the brief reaches the CMS session
|
||||
|
||||
- A) The brief stays in this repo's AIDLC folder (single source). I message the CMS session the path and it reads it; the CMS session decides what to copy into its own AIDLC workspace. Recommended: no writes into the CMS repo's AIDLC files from here.
|
||||
- B) I place a copy of the brief in the CMS repo's AIDLC folder.
|
||||
- X) Other (describe after the [Answer]: tag below)
|
||||
|
||||
[Answer]: B (owner chose a copy in the CMS repo)
|
||||
@@ -0,0 +1,203 @@
|
||||
# Execution Plan: cms-api-foundation
|
||||
|
||||
## Detailed Analysis Summary
|
||||
|
||||
### Transformation Scope (Brownfield Only)
|
||||
- **Transformation Type**: Architectural and infrastructure change across two repositories. The way Andrea's site is hosted changes from a static deployment (nginx on test, IIS on production) to being served by a CMS host. A new client host appears in the CMS repo.
|
||||
- **Primary Changes**:
|
||||
- CMS repo: new client project `Api.AndreaSlopFotografie`; prerendered-site mode plus per-client CSP (no module filter: the client csproj decides its modules) in the shared `CmsHost` (`SlpModularCms.Core`); per-site admin theme and admin build; CI builds the admin per client.
|
||||
- This repo: the deploy of the site build into `wwwroot/web/` of the CMS host on test, and the web CI that does it.
|
||||
- **Related Components**: `SlpModularCms.Core` (CmsHost), `SlpModularCms.Modules.*` (switchable), `SlpModularCms.Api.SlpSoftware` (regression), CMS `frontend/`, CMS Gitea CI/CD, this repo's `web/` build and CI, test host (Pi).
|
||||
|
||||
### Change Impact Assessment
|
||||
- **User-facing changes**: Yes. The admin gets Andrea's look and Dutch default; the public site is served by a different host (URLs and content unchanged).
|
||||
- **Structural changes**: Yes. Shared host gains a prerendered-site mode and per-client headers; new client project; deployment layout changes.
|
||||
- **Data model changes**: Minimal. A new database for the new host with the existing Identity schema. No schema change to existing modules.
|
||||
- **API changes**: No new business endpoints. `/api/v1/System/capabilities` reflects active modules.
|
||||
- **NFR impact**: Yes. Security (CSP must not weaken, setup flow exposure, headers), performance (static serving, compression, caching), deployability.
|
||||
|
||||
### Component Relationships (Brownfield Only)
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
WEB["web/ (this repo)<br/>prerendered site build"]
|
||||
WCI["Web CI (this repo)"]
|
||||
CORE["SlpModularCms.Core<br/>CmsHost (shared)"]
|
||||
CLI["Api.AndreaSlopFotografie<br/>(new client host)"]
|
||||
SLP["Api.SlpSoftware<br/>(regression check)"]
|
||||
FE["CMS frontend/<br/>admin + themes"]
|
||||
CCI["CMS CI/CD (Gitea)"]
|
||||
PI["Test host (Pi)<br/>MariaDB + release dir"]
|
||||
WEB --> WCI
|
||||
WCI --> PI
|
||||
CORE --> CLI
|
||||
CORE --> SLP
|
||||
FE --> CCI
|
||||
CLI --> CCI
|
||||
CCI --> PI
|
||||
classDef changed fill:#FFA726,stroke:#E65100,stroke-width:2px,color:#000;
|
||||
classDef newc fill:#4CAF50,stroke:#1B5E20,stroke-width:2px,color:#fff;
|
||||
classDef guard fill:#BDBDBD,stroke:#424242,stroke-width:2px,color:#000;
|
||||
class WCI,CORE,FE,CCI changed;
|
||||
class CLI newc;
|
||||
class SLP,WEB,PI guard;
|
||||
```
|
||||
|
||||
Text alternative: The web build goes through the web CI to the test host; the shared CmsHost feeds the new Andrea client and the existing SlpSoftware client; the admin frontend and the client are deployed by the CMS CI to the same host. Orange = changed, green = new, grey = unchanged or regression guard.
|
||||
|
||||
| Component | Change type | Reason | Priority |
|
||||
|---|---|---|---|
|
||||
| `SlpModularCms.Core` (CmsHost) | Major | Prerendered mode, per-client CSP policy, hosting parity | Critical |
|
||||
| `Api.AndreaSlopFotografie` | New | Andrea's host | Critical |
|
||||
| CMS `frontend/` | Minor | Theme selection at build, default language | Important |
|
||||
| CMS CI/CD | Minor | Per-client admin build | Important |
|
||||
| `Api.SlpSoftware` | None (regression guard) | Must not change behaviour | Critical |
|
||||
| Web CI and deploy (this repo) | Minor | Deliver the build to `wwwroot/web/` | Important |
|
||||
| `web/` application code | None | Untouched; avoids conflict with Testimonials | n/a |
|
||||
|
||||
### Risk Assessment
|
||||
- **Risk Level**: Medium-High. A shared host is changed (SlpSoftware is in production), the site hosting model changes, and two repositories with two parallel AIDLC workspaces and a parallel session (Testimonials) are involved.
|
||||
- **Rollback Complexity**: Easy on test: nginx keeps serving the site until the new route is proven; the CMS deploy uses an atomic release switch.
|
||||
- **Testing Complexity**: Complex. Needs the Pi, MariaDB, prerendered output and header checks.
|
||||
|
||||
## Workflow Visualization
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
Start(["User Request"])
|
||||
|
||||
subgraph INCEPTION["🔵 INCEPTION PHASE"]
|
||||
WD["Workspace Detection<br/><b>COMPLETED</b>"]
|
||||
RE["Reverse Engineering<br/><b>SKIP</b>"]
|
||||
RA["Requirements Analysis<br/><b>COMPLETED</b>"]
|
||||
US["User Stories<br/><b>SKIP</b>"]
|
||||
WP["Workflow Planning<br/><b>IN PROGRESS</b>"]
|
||||
AD["Application Design<br/><b>EXECUTE</b>"]
|
||||
UG["Units Generation<br/><b>EXECUTE</b>"]
|
||||
end
|
||||
|
||||
subgraph CONSTRUCTION["🟢 CONSTRUCTION PHASE"]
|
||||
FD["Functional Design<br/><b>EXECUTE (CMS unit)</b>"]
|
||||
NFRA["NFR Requirements<br/><b>EXECUTE (CMS unit)</b>"]
|
||||
NFRD["NFR Design<br/><b>EXECUTE (CMS unit)</b>"]
|
||||
ID["Infrastructure Design<br/><b>EXECUTE</b>"]
|
||||
CG["Code Generation<br/>(Planning + Generation)<br/><b>EXECUTE</b>"]
|
||||
BT["Build and Test<br/><b>EXECUTE</b>"]
|
||||
end
|
||||
|
||||
subgraph OPERATIONS["🟡 OPERATIONS PHASE"]
|
||||
DS["Deployment Setup<br/><b>EXECUTE</b>"]
|
||||
MS["Monitoring Setup<br/><b>EXECUTE</b>"]
|
||||
PRV["Production Readiness Validation<br/><b>EXECUTE</b>"]
|
||||
end
|
||||
|
||||
Start --> WD
|
||||
WD --> RA
|
||||
RA --> WP
|
||||
WP --> AD
|
||||
AD --> UG
|
||||
UG --> FD
|
||||
FD --> NFRA
|
||||
NFRA --> NFRD
|
||||
NFRD --> ID
|
||||
ID --> CG
|
||||
CG --> BT
|
||||
BT --> DS
|
||||
DS --> MS
|
||||
MS --> PRV
|
||||
PRV --> End(["Complete"])
|
||||
|
||||
style WD fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
|
||||
style RA fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
|
||||
style WP fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
|
||||
style CG fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
|
||||
style BT fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
|
||||
style RE fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
|
||||
style US fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
|
||||
style AD fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000
|
||||
style UG fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000
|
||||
style FD fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000
|
||||
style NFRA fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000
|
||||
style NFRD fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000
|
||||
style ID fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000
|
||||
style DS fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000
|
||||
style MS fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000
|
||||
style PRV fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000
|
||||
style Start fill:#CE93D8,stroke:#6A1B9A,stroke-width:3px,color:#000
|
||||
style End fill:#CE93D8,stroke:#6A1B9A,stroke-width:3px,color:#000
|
||||
style INCEPTION fill:#BBDEFB,stroke:#1565C0,stroke-width:2px
|
||||
style CONSTRUCTION fill:#C8E6C9,stroke:#2E7D32,stroke-width:2px
|
||||
style OPERATIONS fill:#FFF59D,stroke:#F9A825,stroke-width:2px
|
||||
linkStyle default stroke:#333,stroke-width:2px
|
||||
```
|
||||
|
||||
Text alternative: Inception (detection, requirements, planning, application design, units), then Construction (functional design, NFR requirements and design, infrastructure design, code generation, build and test), then Operations (deployment, monitoring, production readiness). Green = done or always, orange dashed = executes conditionally, grey dashed = skipped.
|
||||
|
||||
## How the two repositories and AIDLC workspaces work together
|
||||
|
||||
- **This workspace** holds the cross-repo decisions, the briefs to the CMS session, the web-side unit, and the verification of the hand-back.
|
||||
- **The CMS repo** has its own AIDLC workspace. For the CMS unit the Construction stages (Functional Design, NFR Requirements, NFR Design, Code Generation, CMS-side Build and Test) are executed **by the CMS session** in that workspace, with a brief from this workspace as input. Here we record the brief, the CMS session's approved design summary and the hand-back in `construction/cms-host/`.
|
||||
- **Approvals** (per the collaboration decision): the owner approves the CMS requirements and design; this session answers web-side questions and escalates CMS-internal, security and data-model questions to the owner.
|
||||
|
||||
## Phases to Execute
|
||||
|
||||
### 🔵 INCEPTION PHASE
|
||||
- [x] Workspace Detection (COMPLETED)
|
||||
- [x] Reverse Engineering (SKIPPED)
|
||||
- **Rationale**: Team agreement: no full refresh per feature; the CMS repo has its own artifacts.
|
||||
- [x] Requirements Analysis (COMPLETED)
|
||||
- [x] User Stories (SKIPPED)
|
||||
- **Rationale**: One persona (the site administrator) and no user-experience design in this step; acceptance criteria are in the requirements (FR-14). Can be added on request.
|
||||
- [x] Execution Plan (IN PROGRESS)
|
||||
- [ ] Application Design - EXECUTE (minimal-to-standard depth)
|
||||
- **Rationale**: New shared-host components (prerendered-site mode, per-client header policy, theme selection) and a client project need defined responsibilities, plus the deployment layout contract between the two repos. Detailed internal design stays with the CMS session.
|
||||
- [ ] Units Planning - SKIP (merged into Units Generation; two units are enough)
|
||||
- [ ] Units Generation - EXECUTE
|
||||
- **Rationale**: Two units with different owners and an order: U1 CMS host (CMS repo), U2 site delivery (this repo).
|
||||
|
||||
### 🟢 CONSTRUCTION PHASE
|
||||
|
||||
Units: **U1 `cms-host`** (CMS repo, built by the CMS session) and **U2 `site-delivery`** (this repo). Order: U1 before U2; the `web/`-adjacent changes in U2 start only when the Testimonials feature has merged or overlap is ruled out.
|
||||
|
||||
- [ ] Functional Design - EXECUTE for U1, SKIP for U2
|
||||
- **Rationale**: U1 has new behaviour (path-to-file resolution, canonical redirects, header policy). U2 is pipeline work with no business logic.
|
||||
- [ ] NFR Requirements - EXECUTE for U1, SKIP for U2
|
||||
- **Rationale**: Security Baseline applies (CSP, setup exposure, error handling, rate limiting) and PBT framework selection (PBT-09). U2's NFRs are covered by the requirements.
|
||||
- [ ] NFR Design - EXECUTE for U1, SKIP for U2
|
||||
- **Rationale**: Patterns for header policy per client, fail-closed behaviour and a drift guard for the CSP.
|
||||
- [ ] Infrastructure Design - EXECUTE for U1 and U2
|
||||
- **Rationale**: Release layout with `wwwroot/web/` outside the swapped directory, per-client admin build in CI, delivery of the site build, database for the new host, ports, and switching off the static nginx site on test.
|
||||
- [ ] Code Generation - EXECUTE (ALWAYS), per unit
|
||||
- **Rationale**: Implementation and tests (including PBT-02, 03, 07, 08 where applicable).
|
||||
- [ ] Build and Test - EXECUTE (ALWAYS)
|
||||
- **Rationale**: Cross-unit proof on test (FR-14), SlpSoftware regression, header and 404-status checks.
|
||||
|
||||
### 🟡 OPERATIONS PHASE
|
||||
- [ ] Deployment Setup, Monitoring Setup, Production Readiness Validation - EXECUTE
|
||||
- **Rationale**: Operations Configuration = Yes (decided at Requirements Analysis). Scope is test only; production readiness records what remains for production.
|
||||
|
||||
## Package Change Sequence (Brownfield Only)
|
||||
|
||||
1. `SlpModularCms.Core` (CmsHost: prerendered mode, per-client header policy, hosting parity) with tests. Critical path.
|
||||
2. `Api.AndreaSlopFotografie` client project, appsettings, database. Depends on 1.
|
||||
3. CMS `frontend/` theme selection and Andrea's theme. Parallel with 2.
|
||||
4. CMS CI/CD: per-client admin build and deploy for the new host. Depends on 2 and 3.
|
||||
5. This repo: web CI delivers the site build to the new host on test. Depends on 4.
|
||||
6. Proof on test, then switch off the static test site.
|
||||
|
||||
## Module Update Strategy
|
||||
- **Update Approach**: Sequential for the critical path (1, 2, 4, 5), parallel for the theme work (3).
|
||||
- **Critical Path**: Core host changes block everything else.
|
||||
- **Coordination Points**: The reserved paths and `wwwroot/web/` contract, the 404 page location, the CSP values, the admin build per client in CI.
|
||||
- **Testing Checkpoints**: After step 1 (SlpSoftware regression, unit and integration tests), after step 4 (deployed admin and `/health`), after step 5 (FR-14 proof).
|
||||
|
||||
## Estimated Timeline
|
||||
- **Total Phases**: 3 (Inception, Construction, Operations).
|
||||
- **Estimated Duration**: Roughly 4 to 6 working sessions across both workspaces, depending on CMS CI complexity and the test host.
|
||||
|
||||
## Success Criteria
|
||||
- **Primary Goal**: Andrea's site and a themed Dutch admin run from one CMS host on test, with `Offerings` off and the existing SlpSoftware host unaffected.
|
||||
- **Key Deliverables**: `Api.AndreaSlopFotografie` (with only the needed module references); prerendered-site mode; per-client CSP; per-site admin theme and build; web delivery pipeline; updated CMS docs; briefs and hand-back records.
|
||||
- **Quality Gates**: Security Baseline compliance (blocking), PBT partial rules, SlpSoftware regression tests green, FR-14 proof on test, site Lighthouse not lower than on nginx.
|
||||
- **Integration Testing**: Site, admin and API served together from one host on test.
|
||||
- **Operational Readiness**: Logging, health and alerting for the new host per the Operations phase.
|
||||
@@ -0,0 +1,42 @@
|
||||
# Unit of Work Plan: cms-api-foundation
|
||||
|
||||
Terminology: the CMS side is a set of modules of one deployable host; "unit of work" is a planning unit, not a deployable service. No user stories exist (skipped), so the story map maps requirements (FR/NFR) to units.
|
||||
|
||||
## Proposed decomposition
|
||||
|
||||
The execution plan named two units (U1 CMS host, U2 site delivery). The application design suggests a split of the CMS side, because the shared-host change (Core) is critical and must not regress `Api.SlpSoftware`, while the client project, theme and CI are new and isolated.
|
||||
|
||||
| Unit | Repo | Contents | Built by |
|
||||
|---|---|---|---|
|
||||
| U1 `core-site-hosting` | CMS | C2 `CmsHostOptions`, C3 prerendered site serving, C4 `StrictSite`, tests, CMS docs (`WEBSITE_WORKSPACE.md`, README) | CMS session |
|
||||
| U2 `andreaslop-client` | CMS | C1 `Api.AndreaSlopFotografie`, C5 admin theme and default language, C6 CMS CI/CD for the new host | CMS session |
|
||||
| U3 `site-delivery` | WEB (this repo) | C7 delivery job, C8 extended `verify-deployment.sh`, retiring the static test site | This session |
|
||||
|
||||
Order: U1, then U2, then U3. U3 starts after the Testimonials feature has merged or overlap is ruled out.
|
||||
|
||||
## Plan
|
||||
|
||||
- [x] Analyze requirements and application design
|
||||
- [x] Collect answers to the questions below
|
||||
- [x] Generate `application-design/unit-of-work.md`
|
||||
- [x] Generate `application-design/unit-of-work-dependency.md`
|
||||
- [x] Generate `application-design/unit-of-work-story-map.md` (requirements to units)
|
||||
- [x] Validate unit boundaries and dependencies; ensure every FR/NFR belongs to a unit
|
||||
|
||||
## Questions
|
||||
|
||||
### Question 1: Splitting the CMS side
|
||||
|
||||
- A) Two units on the CMS side (U1 shared host, U2 Andrea's client), as in the table. Recommended: U1 has its own checkpoint (SlpSoftware regression, unit tests green) before the new client is built on it.
|
||||
- B) One CMS unit covering both.
|
||||
- X) Other (describe after the [Answer]: tag below)
|
||||
|
||||
[Answer]: A (two CMS units). Owner: the client project is named Api.AndreaSlopFotografie instead of Api.AndreaSlop.
|
||||
|
||||
### Question 2: Briefs to the CMS session
|
||||
|
||||
- A) One brief per CMS unit (U1, then U2 when U1 is hand-backed). Recommended: matches "one feature at a time" for the CMS session's AIDLC.
|
||||
- B) One brief for both CMS units; the CMS session sequences them itself.
|
||||
- X) Other (describe after the [Answer]: tag below)
|
||||
|
||||
[Answer]: B (one brief for both CMS units; the CMS session sequences them, with a hand-back checkpoint after U1)
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
# Vragen bij de requirements: cms-api-foundation
|
||||
|
||||
Vul achter elke `[Answer]:` de letter van je keuze in. Past geen enkele optie, kies dan de laatste (Anders) en licht je keuze toe. Bij elke vraag staat welke optie ik aanbeveel en waarom.
|
||||
|
||||
**Wat deze feature is:** de basis waarop Andrea's site straks op de SlpModularCms draait. Dus: een eigen client-project voor Andrea (zoals `Api.SlpSoftware`), een vast thema per site, een instelbare set modules per site, en de CMS-host die zowel de admin als de geprerenderde site serveert. Pakketten, contactformulier, testimonials en shoot-pagina's zijn aparte, latere features.
|
||||
|
||||
**Vaste uitgangspunten, hierover hoef je niets te beslissen** (uit je antwoorden):
|
||||
|
||||
- Meerdere sites = één deployment en één database per site; de modules per site bepaal je met de DLL-referenties van de client (aangepast in het ontwerp).
|
||||
- Het thema staat vast per site en wordt niet in de admin aangepast.
|
||||
- De CMS-host serveert admin (`/admin`), API (`/api/v1`) en de site (`/`); er is maar ruimte voor één website op de host.
|
||||
- Dit werk raakt de bestanden van de Testimonials-sessie niet.
|
||||
|
||||
## Vraag 1
|
||||
|
||||
Wat hoort er in deze feature bij het "de CMS serveert de site" deel aan de kant van deze (web)repo?
|
||||
|
||||
- A) Alleen de CMS-kant: een brief en bewaking van het resultaat. De omschakeling van de huidige hosting (nginx test, IIS productie) en de CI van de site volgt in een eigen feature.
|
||||
- B) CMS-kant én de web-kant: de site-build wordt bij de deploy in `wwwroot/web/` van de CMS-host gezet, de CI van de web-repo wordt daarop aangepast en op test is de omschakeling bewezen. Aanbevolen: de feature is pas af als de keten werkt, en de web-kant is klein.
|
||||
- C) CMS-kant plus web-kant tot en met productie.
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: B
|
||||
|
||||
## Vraag 2
|
||||
|
||||
Hoe moet de CMS-host de geprerenderde pagina's serveren? Nu is er een SPA-fallback: een pad zonder extensie (`/over-mij`) krijgt `index.html`. Onze build maakt per pagina een eigen HTML-bestand, en een onbekend pad moet de echte 404-pagina met status 404 krijgen.
|
||||
|
||||
- A) De host krijgt een "geprerenderde site"-modus: eerst `{pad}.html` of `{pad}/index.html`, anders de 404-pagina met status 404. Aanbevolen: dit geeft de bezoeker de snelle HTML en de SEO-winst van de prerendering echt.
|
||||
- B) De bestaande SPA-fallback blijft: elke pagina laadt `index.html` en React rendert daarna. Dan verdwijnt het voordeel van de prerendering.
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A (prerender-modus nu). User note: wants SSR eventually to be independent of the build pipeline; asked whether Node runs on mijnhostingpartner.nl (unknown, to be checked by the user). Decision: prerender-modus now, SSR vs hybrid decided before the first content feature.
|
||||
|
||||
## Vraag 3
|
||||
|
||||
De site heeft nu strenge beveiligingsheaders (CSP uit `web/config/securityHeaders.ts`). De CMS geeft de site standaard het mildere `Relaxed`-beleid.
|
||||
|
||||
- A) De CMS-host krijgt een instelling waarmee het client-project de CSP voor `/` zelf kan bepalen, en Andrea's client gebruikt dezelfde strenge CSP als nu. Aanbevolen: geen beveiligingsachteruitgang bij de omschakeling.
|
||||
- B) We accepteren het `Relaxed`-beleid voor de site.
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
## Vraag 4
|
||||
|
||||
Hoe wordt het thema per site vastgelegd?
|
||||
|
||||
- A) In het client-project (configuratie of een vast bestand), dat de API aanbiedt; de admin leest het bij het opstarten en zet het als CSS-variabelen. Eén admin-build voor alle sites. Aanbevolen.
|
||||
- B) Een aparte admin-build per site met het thema ingebakken.
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: X: admin build per site where only a theme file is specified (user proposal; styling does not belong in the API). Theme files live in the CMS repo, selected at build time, no theme API.
|
||||
|
||||
## Vraag 5
|
||||
|
||||
Wat moet het thema per site kunnen bepalen?
|
||||
|
||||
- A) Kleuren (de bestaande tokens), hoekafronding, lettertype, logo/app-naam en favicon. Aanbevolen: genoeg om aan te sluiten op Andrea's site, zonder overbodige vrijheid.
|
||||
- B) Alleen kleuren en logo/app-naam.
|
||||
- C) Alles uit A plus eigen CSS per site.
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
## Vraag 6
|
||||
|
||||
Welke modules staan voor Andrea aan in deze feature? (Master is voor het beheren van andere CMS-instanties; Availability hoort bij de master-status.)
|
||||
|
||||
- A) Alleen wat voor een werkende admin nodig is (Identity en wat de CMS-host verplicht stelt); `Offerings` staat uit. Zo bewijst het verschil met SlpSoftware dat de schakelaar werkt. Aanbevolen.
|
||||
- B) Identity plus `Offerings` aan, zodat de pakketten-feature er direct op kan aansluiten.
|
||||
- C) Alles aan, net als de bestaande Api-host.
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A (this feature = step 0; Offerings is switched on in the packages feature)
|
||||
|
||||
## Vraag 7
|
||||
|
||||
Wie zijn de gebruikers van Andrea's CMS in deze feature?
|
||||
|
||||
- A) Zoals nu: een eerste beheerder via de setup-flow en daarna uitnodigingen. Geen nieuwe rollen. Aanbevolen: auth bestaat al en hoeft hier niet opnieuw ontworpen.
|
||||
- B) Er komen rollen bij (bijvoorbeeld beheerder en alleen-lezen).
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
## Vraag 8
|
||||
|
||||
Welke taal heeft de admin standaard voor Andrea? De admin kent NL en EN.
|
||||
|
||||
- A) Nederlands standaard, Engels blijft kiesbaar; de standaardtaal wordt per site vastgelegd. Aanbevolen.
|
||||
- B) Engels standaard, zoals nu.
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
## Vraag 9
|
||||
|
||||
Op welke omgevingen komt Andrea's CMS-instantie in deze feature?
|
||||
|
||||
- A) Eerst alleen test (de Pi, via de bestaande Gitea-deploy van de CMS-repo); productie volgt als de keten bewezen is. Aanbevolen.
|
||||
- B) Test en productie.
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
## Vraag 10
|
||||
|
||||
Hoe werk ik met de CMS-sessie (`AndreaSlopFotografie`) samen?
|
||||
|
||||
- A) Hybride: web-vragen beantwoord ik zelf uit de repo en het design. Beslissingen over CMS-interne zaken, security en datamodel leg ik aan jou voor. Jij keurt de requirements en het ontwerp van de CMS-kant goed. Aanbevolen.
|
||||
- B) Ik beantwoord alles wat ik uit de context kan afleiden, houd een besluitenlijst bij en jij keurt alleen het eindresultaat goed.
|
||||
- C) Alle vragen van de CMS-sessie gaan naar jou.
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
## Vraag 11: Beveiligingsextensies
|
||||
|
||||
Moeten de beveiligingsregels als harde vereisten worden afgedwongen voor dit project?
|
||||
|
||||
- A) Ja: dwing alle BEVEILIGINGSREGELS af als blokkerende vereisten (aanbevolen voor productietoepassingen)
|
||||
- B) Nee: sla alle BEVEILIGINGSREGELS over (geschikt voor PoC's, prototypes en experimentele projecten)
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
## Vraag 12: Property-Based Testing Extensie
|
||||
|
||||
Moeten de property-based testing (PBT) regels worden afgedwongen voor dit project?
|
||||
|
||||
- A) Ja: dwing alle PBT-regels af als blokkerende vereisten (aanbevolen voor projecten met bedrijfslogica, datatransformaties, serialisatie of stateful componenten)
|
||||
- B) Gedeeltelijk: dwing PBT-regels alleen af voor pure functies en serialisatie round-trips (geschikt voor projecten met beperkte algoritmische complexiteit)
|
||||
- C) Nee: sla alle PBT-regels over (geschikt voor eenvoudige CRUD-applicaties, UI-only projecten of dunne integratielagen zonder significante bedrijfslogica)
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: B
|
||||
|
||||
## Vraag 13: Operations-fase
|
||||
|
||||
Moet deze feature na de Construction-fase door de Operations-fase (deployment en monitoring inrichten)?
|
||||
|
||||
- A) Ja: voer de Operations-fase uit na Construction (deployment en monitoring)
|
||||
- B) Nee: stop na Build and Test (deployment en monitoring vallen buiten deze feature)
|
||||
- C) Nog niet zeker: vraag het me opnieuw na de Construction-fase
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A
|
||||
@@ -0,0 +1,97 @@
|
||||
# Requirements: cms-api-foundation ("step 0")
|
||||
|
||||
## Intent analysis
|
||||
|
||||
- **User request**: Start the API and CMS for the Andrea Slop Fotografie website on top of the owner's existing modular CMS (`SlpModularCms`, separate repo), feature by feature. This feature is **step 0**: a working CMS plus API host for the site, with per-site theming and a per-site module set (chosen by the DLLs the client references), serving both the admin and the prerendered website from one host. Packages, contact form, testimonials and shoot pages are later features.
|
||||
- **Request type**: New feature (cross-repo): extension of an existing system.
|
||||
- **Scope estimate**: Cross-system. CMS repo (new client host, shared host composition, admin frontend theming, CI) and this web repo (deploy pipeline, site build output).
|
||||
- **Complexity estimate**: Complex. Hosting model change, security headers, shared-host change that must not regress the existing SlpSoftware client.
|
||||
- **Requirements depth**: Comprehensive. Security-relevant (CSP, auth host), two repos, two AIDLC workspaces.
|
||||
- **Clarity**: Clear after the 13 clarification questions (answers in `requirement-verification-questions.md`).
|
||||
|
||||
## Context (verified by reading the CMS repo, read-only)
|
||||
|
||||
- SlpModularCms is a .NET 10 modular monolith on MariaDB. Modules: `Identity` (login, refresh, revoke, invitations, setup, users), `Master`, `Availability`, `Offerings`. Admin: Vite + React 19 + TypeScript + Tailwind v4 (primary `#ac0000`) + shadcn-style components, NL/EN.
|
||||
- Multi-site pattern today: one deployable client project per site (`Api.SlpSoftware`), a thin `Program.cs` over the shared `CmsHost` composition in `SlpModularCms.Core`, with its own database.
|
||||
- Single-host serving: one process serves `/` (site from `wwwroot/web/`), `/admin`, `/api/v1`. Reserved paths: `/admin`, `/api/v1`, `/health`. Extensionless paths currently fall back to `wwwroot/web/index.html`. The site gets the `Relaxed` CSP, the reserved paths `Strict`.
|
||||
- No theming exists; only CSS variables in the admin `index.css`.
|
||||
- This web repo: a prerendered React SPA (one HTML file per page), currently deployed as static files behind nginx (test) and IIS (production), with a strict CSP from `web/config/securityHeaders.ts`.
|
||||
|
||||
## Decisions taken in clarification
|
||||
|
||||
| # | Decision |
|
||||
|---|---|
|
||||
| Q1 | Scope covers the CMS side and the web side, proven on **test**. |
|
||||
| Q2 | The host gets a prerendered-site mode now. SSR (the owner wants it eventually, to be independent of the build pipeline) versus a hybrid (CMS blocks loaded at runtime) is decided before the first content feature. The owner checks whether the hosting partner allows a Node process. |
|
||||
| Q3 | The client project determines the CSP for `/`; Andrea's client uses the same strict CSP as the site has today. |
|
||||
| Q4 | Admin is built per site; a per-site theme file is selected at build time. No theme in the API. |
|
||||
| Q5 | The theme covers colours (existing tokens), radius, font, logo/app name and favicon. |
|
||||
| Q6 | `Offerings` is **off** for Andrea in step 0; it is switched on in the packages feature. |
|
||||
| Q7 | Users as today: first admin through the setup flow, then invitations; no new roles. |
|
||||
| Q8 | Admin default language per site; Dutch for Andrea, English remains selectable. |
|
||||
| Q9 | Only the test environment in step 0. |
|
||||
| Q10 | Hybrid collaboration with the CMS session (see Process requirements). |
|
||||
| Q11 | Security Baseline extension enforced. |
|
||||
| Q12 | Property-based testing: partial (PBT-02, 03, 07, 08, 09). |
|
||||
| Q13 | Operations phase included. |
|
||||
|
||||
## Functional requirements
|
||||
|
||||
### Client host (CMS repo)
|
||||
|
||||
- **FR-1** A new client project `SlpModularCms.Api.AndreaSlopFotografie` exists in the CMS repo, following the `Api.SlpSoftware` pattern: a thin `Program.cs` on the shared `CmsHost`, its own database, its own local dev port, the three-file appsettings pattern, and solution placement per the CMS repo's `AGENTS.md`.
|
||||
- **FR-2** The active module set of a site is the set of module projects its client host references (the existing mechanism: a module DLL that ships with the host is a module that is on). Andrea's client references only the modules the admin needs and not `Offerings`; a module that is not referenced registers nothing (no controllers or routes, no database context or migrations, no admin navigation entry) and `/api/v1/System/capabilities` lists only the referenced modules. Switching a module on later means adding its reference to the client project. No configuration filter is added to the shared host (owner decision, design stage, 2026-11-06, which supersedes the earlier "configuration switch per module" assumption).
|
||||
- **FR-3** Existing hosts (`Api`, `Api.SlpSoftware`) keep their current behaviour: same modules, same endpoints, same look, same tests passing.
|
||||
|
||||
### Theming (CMS repo, admin frontend)
|
||||
|
||||
- **FR-4** A theme is a per-site theme file (CSS tokens: colours, radius, font) plus logo, app name and favicon, stored in the CMS repo and selected when the admin is built. Without a selection, the admin keeps today's look.
|
||||
- **FR-5** The CI builds the admin once per deployable client with that client's theme. The API exposes no theme.
|
||||
- **FR-6** Andrea's theme matches the site's visual identity (source: this repo's design reference `design/andreaslop-static/` and the web theme).
|
||||
- **FR-7** The default admin language is configurable per site; Andrea's default is Dutch.
|
||||
|
||||
### Serving the site (CMS repo, shared host)
|
||||
|
||||
- **FR-8** The host has a prerendered-site mode: for a request path without a file extension it serves `{path}.html`, else `{path}/index.html`; for an unknown path it serves the site's 404 page with HTTP status 404. URLs have no trailing slash, query strings are preserved, and the reserved paths `/admin`, `/api/v1` and `/health` always win.
|
||||
- **FR-9** Existing behaviour (SPA fallback) remains available for sites that do not use the prerendered mode, so SlpSoftware is unaffected.
|
||||
- **FR-10** The CSP (and the other security headers) for `/` is set per client project. Andrea's client reproduces the strict policy of `web/config/securityHeaders.ts`. A mechanism keeps the two from drifting apart (decided in design).
|
||||
|
||||
### Authentication
|
||||
|
||||
- **FR-11** Authentication is the existing Identity module, unchanged: first administrator via the setup flow, then invitations, no new roles. For Andrea's instance the setup flow must not be reachable by anyone else once the first administrator exists.
|
||||
|
||||
### Web repo (this repo)
|
||||
|
||||
- **FR-12** The site build output (prerendered pages, assets, 404 page) can be delivered to `wwwroot/web/` of Andrea's CMS host on test as part of the deploy, without a manual step.
|
||||
- **FR-13** The web CI is adapted for that delivery. Removing the static nginx deployment of the test site is part of the switch, but only after the new route works.
|
||||
- **FR-14** Proof on test: the home page and at least one sub page are served prerendered, an unknown path returns the 404 page with status 404, `/admin` shows Andrea's theme and allows login, `/health` and `/api/v1/System/capabilities` respond and show `Offerings` off.
|
||||
|
||||
### Process
|
||||
|
||||
- **FR-15** The CMS work is handed to the CMS session (`AndreaSlopFotografie`, `dbb9e4`) as a feature brief per feature; the CMS session runs its own AIDLC. This session answers web-side questions; CMS-internal, security and data-model decisions go to the owner, who approves the CMS requirements and design. The result is handed back as an artifact (changed contract and changelog) which this session verifies by integrating it.
|
||||
|
||||
## Non-functional requirements
|
||||
|
||||
- **NFR-1 Security (Security Baseline enforced).** Applicable rules for step 0: SECURITY-03 (structured logging, no secrets in logs), SECURITY-04 (security headers on all HTML endpoints; no `unsafe-inline` or `unsafe-eval` without documented justification), SECURITY-05 (input validation, existing endpoints), SECURITY-08 (deny by default, CORS only for allowed origins, server-side token validation), SECURITY-09 (no default credentials, generic production errors, no directory listing, no sample content), SECURITY-10 (lock files, vulnerability scan step, pinned CI versions), SECURITY-11 (rate limiting on login, misuse case for the setup flow), SECURITY-12 (credential and session handling as existing; no committed secrets), SECURITY-13 (build integrity), SECURITY-15 (global error handler, fail closed). SECURITY-01, 02, 06, 07 and 14 are assessed per stage (database TLS and encryption at rest, access logging on the reverse proxy, least privilege of the deploy identity, network exposure of the Pi, alerting). Non-compliance is a blocking finding.
|
||||
- **NFR-2 No security regression.** Moving the site behind the CMS host must not weaken the headers the site has today (see FR-10).
|
||||
- **NFR-3 Performance.** Prerendered pages are served as static files with compression and long-lived caching for hashed assets, and the site's Lighthouse targets (see the open follow-ups) must not drop compared to the nginx deployment.
|
||||
- **NFR-4 Compatibility.** Existing hosts and tests keep working (FR-3); the shared `CmsHost` change is backward compatible by default.
|
||||
- **NFR-5 Deployability.** Runs on the test Pi (ARM64, MariaDB) through the existing Gitea CI/CD with its atomic release switch. `wwwroot/web/` stays outside the swapped release directory so a CMS deploy does not remove the site.
|
||||
- **NFR-6 Testing.** Unit and integration tests for module composition (a client without a module exposes none of its routes), prerendered-site serving (including 404 status and reserved paths) and header configuration. Property-based tests (partial mode, PBT-02, 03, 07, 08, 09) for pure functions and round-trips, for example path-to-file resolution and configuration parsing.
|
||||
- **NFR-7 Maintainability.** Per-site differences live in the client project and the theme file; the shared host contains no site names.
|
||||
- **NFR-8 Documentation.** CMS repo docs (`WEBSITE_WORKSPACE.md`, README) are updated for the prerendered mode, module composition per client and themes.
|
||||
|
||||
## Out of scope for step 0
|
||||
|
||||
Offerings/packages, contact form, testimonials, shoot pages and media upload; SSR or the hybrid runtime content loading (decided before the first content feature); production cutover and the IIS hosting; the `Master` module for Andrea; roles; a theme editor in the admin; changes to files owned by the Testimonials session.
|
||||
|
||||
## Open items and risks
|
||||
|
||||
- **Hosting partner**: whether a Node process (SSR) is possible on `mijnhostingpartner.nl`, and whether the production host runs .NET, is unknown. The owner checks this; it does not block step 0.
|
||||
- **CSP source of truth**: the site's policy lives in `web/config/securityHeaders.ts`. How the CMS client project gets the same values without drifting (generated artifact, shared file, or test that compares) is a design decision.
|
||||
- **Parallel work**: the Testimonials session edits `aidlc-docs/active-features.md` (row-level merge conflict expected) and web components. This feature touches `web/` only for the deploy pipeline, and only after the Testimonials feature has merged or confirmed no overlap.
|
||||
- **Dev ports and databases**: Andrea's client needs its own dev port and local database, as `Api.SlpSoftware` has.
|
||||
|
||||
## Direction note (owner, 2026-11-06, tracked by the website session)
|
||||
|
||||
More and more of the website will become dynamic (CMS-driven), so the share of purely prerendered, static serving is expected to shrink over time. This is not a change to step 0: the prerendered-site mode stays as designed. It is an input to the decision on SSR versus a hybrid (CMS blocks loaded at runtime), which must be taken before the first content feature (packages), together with the answer to whether the hosting partner allows a Node process. Design consequence to keep in mind: the host's prerendered mode and its nginx-parity rules must stay usable next to dynamic content (for example as the fallback for pages that are not CMS-driven).
|
||||
@@ -0,0 +1,8 @@
|
||||
// Schrijft de productie-CSP van de site naar stdout, zonder regeleinde. De
|
||||
// controle na deploy (deploy/verify-deployment.sh --cms) vergelijkt hiermee
|
||||
// de header van de CMS-host, zodat die niet van config/securityHeaders.ts
|
||||
// kan afwijken.
|
||||
|
||||
import { contentSecurityPolicy } from './securityHeaders.ts';
|
||||
|
||||
process.stdout.write(contentSecurityPolicy('production'));
|
||||
@@ -83,6 +83,20 @@ describe('serverconfiguratie', () => {
|
||||
expect(proxy).not.toContain('add_header');
|
||||
});
|
||||
|
||||
it('de proxy stuurt naar de CMS-host op poort 5200 met de forwarded headers', () => {
|
||||
// De CMS-host vertrouwt alleen de proxy-Pi (ForwardedHeaders:KnownProxies)
|
||||
// en haalt het bezoekersadres uit deze headers voor de rate limiter
|
||||
const proxy = nginxProxyConf();
|
||||
expect(proxy).toMatch(
|
||||
/^\s*proxy_pass http:\/\/192\.168\.1\.103:5200;/m,
|
||||
);
|
||||
expect(proxy).toContain(
|
||||
'proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;',
|
||||
);
|
||||
expect(proxy).toContain('proxy_set_header X-Forwarded-Proto $scheme;');
|
||||
expect(proxy).toContain('proxy_set_header X-Real-IP $remote_addr;');
|
||||
});
|
||||
|
||||
it('proxy en testblok gebruiken dezelfde hostname', () => {
|
||||
// Alleen echte config-regels, geen commentaar
|
||||
const name = /^\s*server_name ([^;]+);/m;
|
||||
|
||||
@@ -292,23 +292,28 @@ ${block(' ', noCache)}
|
||||
|
||||
// nginx op de reverse-proxy-Pi (test): alleen HTTP. certbot voegt daarna
|
||||
// HTTPS en de redirect toe (certbot --nginx -d test.andreaslop.nl). Geen
|
||||
// security headers hier: die zet de hosting-Pi al, dubbel geeft dubbele headers.
|
||||
// Intern adres van de hosting-Pi (waar het testblok en WordPress draaien)
|
||||
// security headers hier: de CMS-host zet ze al, dubbel geeft dubbele headers.
|
||||
// Intern adres van de hosting-Pi (waar de CMS-host en WordPress draaien)
|
||||
const hostingPiAddress = '192.168.1.103';
|
||||
// Poort van de CMS-host Api.AndreaSlopFotografie (test) op de hosting-Pi. De
|
||||
// host serveert /admin, /api/v1 en de voorgerenderde site zelf; nginx op de
|
||||
// hosting-Pi (poort 80, andreaslop-test.conf) blijft als terugvaloptie staan.
|
||||
const cmsHostPort = 5200;
|
||||
|
||||
export function nginxProxyConf(): string {
|
||||
return `# ${generatedNotice}
|
||||
# Reverse proxy voor de testsite naar de hosting-Pi. certbot past dit bestand
|
||||
# aan voor HTTPS; kopieer het daarna dus niet opnieuw zonder certbot opnieuw te
|
||||
# draaien.
|
||||
# Reverse proxy voor de testsite naar de CMS-host op de hosting-Pi. certbot
|
||||
# past dit bestand aan voor HTTPS; kopieer het daarna dus niet opnieuw zonder
|
||||
# certbot opnieuw te draaien. Terugvallen op nginx van de hosting-Pi: haal
|
||||
# :${cmsHostPort} weg achter proxy_pass.
|
||||
server {
|
||||
listen 80;
|
||||
server_name test.andreaslop.nl;
|
||||
|
||||
location / {
|
||||
proxy_pass http://${hostingPiAddress};
|
||||
# Verplicht: de hosting-Pi kiest op basis van de hostname tussen het
|
||||
# testblok en WordPress
|
||||
proxy_pass http://${hostingPiAddress}:${cmsHostPort};
|
||||
# De CMS-host gebruikt Host niet om een site te kiezen, maar de
|
||||
# terugvaloptie (nginx op de hosting-Pi) wel: daarom blijft hij staan
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
# Gegenereerd door web/config/serverConfig.ts (pnpm server-config). Niet handmatig aanpassen.
|
||||
# Reverse proxy voor de testsite naar de hosting-Pi. certbot past dit bestand
|
||||
# aan voor HTTPS; kopieer het daarna dus niet opnieuw zonder certbot opnieuw te
|
||||
# draaien.
|
||||
# Reverse proxy voor de testsite naar de CMS-host op de hosting-Pi. certbot
|
||||
# past dit bestand aan voor HTTPS; kopieer het daarna dus niet opnieuw zonder
|
||||
# certbot opnieuw te draaien. Terugvallen op nginx van de hosting-Pi: haal
|
||||
# :5200 weg achter proxy_pass.
|
||||
server {
|
||||
listen 80;
|
||||
server_name test.andreaslop.nl;
|
||||
|
||||
location / {
|
||||
proxy_pass http://192.168.1.103;
|
||||
# Verplicht: de hosting-Pi kiest op basis van de hostname tussen het
|
||||
# testblok en WordPress
|
||||
proxy_pass http://192.168.1.103:5200;
|
||||
# De CMS-host gebruikt Host niet om een site te kiezen, maar de
|
||||
# terugvaloptie (nginx op de hosting-Pi) wel: daarom blijft hij staan
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
@@ -2,24 +2,40 @@
|
||||
# Controle na een deploy (BR-HST-18): wat de server teruggeeft moet gelijk zijn
|
||||
# aan wat in dist staat. Een oude nginx-config die voor elk pad de homepage
|
||||
# geeft (SPA-fallback) valt hier door de mand.
|
||||
# Gebruik: verify-deployment.sh <basis-url> <dist-map> [--test]
|
||||
# Gebruik: verify-deployment.sh <basis-url> <dist-map> [--test] [--cms]
|
||||
# --test: ook X-Robots-Tag, en gzip op de JavaScript is verplicht
|
||||
# (zonder --test geeft ontbrekende gzip alleen een waarschuwing)
|
||||
# --cms: de site wordt geserveerd door de CMS-host (Api.AndreaSlopFotografie)
|
||||
# in plaats van nginx. Dan geldt ook: de CSP is exact gelijk aan
|
||||
# $EXPECTED_CSP (verplicht, zie config/printCsp.ts), alle security
|
||||
# headers staan met de exacte waarde op elk antwoord (pagina, asset,
|
||||
# 301, 404, robots.txt), cachebeleid, alleen gzip (nooit br), een
|
||||
# procentgecodeerd pad blijft gecodeerd, en /admin, /health en
|
||||
# /api/v1/System/capabilities (zonder Offerings) antwoorden.
|
||||
set -euo pipefail
|
||||
|
||||
if [ "$#" -lt 2 ] || [ "$#" -gt 3 ]; then
|
||||
echo "Gebruik: $0 <basis-url> <dist-map> [--test]" >&2
|
||||
if [ "$#" -lt 2 ] || [ "$#" -gt 4 ]; then
|
||||
echo "Gebruik: $0 <basis-url> <dist-map> [--test] [--cms]" >&2
|
||||
exit 2
|
||||
fi
|
||||
base="$1"
|
||||
dist="$2"
|
||||
test_mode=0
|
||||
if [ "$#" -eq 3 ]; then
|
||||
if [ "$3" != "--test" ]; then
|
||||
echo "Onbekende optie: $3" >&2
|
||||
exit 2
|
||||
fi
|
||||
test_mode=1
|
||||
cms_mode=0
|
||||
shift 2
|
||||
for option in "$@"; do
|
||||
case "$option" in
|
||||
--test) test_mode=1 ;;
|
||||
--cms) cms_mode=1 ;;
|
||||
*)
|
||||
echo "Onbekende optie: $option" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if [ "$cms_mode" -eq 1 ] && [ -z "${EXPECTED_CSP:-}" ]; then
|
||||
echo "--cms vraagt om EXPECTED_CSP (node config/printCsp.ts)" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if ! [[ "$base" =~ ^https?://[^[:space:]]+$ ]]; then
|
||||
@@ -72,6 +88,31 @@ check_security_headers() {
|
||||
fail "$label: header $name ontbreekt"
|
||||
fi
|
||||
done
|
||||
if [ "$cms_mode" -eq 1 ]; then check_exact_headers "$label"; fi
|
||||
}
|
||||
|
||||
# Alleen met --cms: de CMS-host moet exact de waarden van de site sturen
|
||||
# (geen drift tussen config/securityHeaders.ts en de host)
|
||||
check_exact_headers() {
|
||||
local label="$1"
|
||||
local -A expected=(
|
||||
[Content-Security-Policy]="$EXPECTED_CSP"
|
||||
[Strict-Transport-Security]="max-age=31536000; includeSubDomains"
|
||||
[X-Content-Type-Options]="nosniff"
|
||||
[X-Frame-Options]="DENY"
|
||||
[Referrer-Policy]="strict-origin-when-cross-origin"
|
||||
)
|
||||
local name actual
|
||||
for name in "${!expected[@]}"; do
|
||||
actual="$(header "$name")"
|
||||
# Ontbrekend is hierboven al gemeld
|
||||
if [ -n "$actual" ] && [ "$actual" != "${expected[$name]}" ]; then
|
||||
fail "$label: header $name is '$actual', verwacht '${expected[$name]}'"
|
||||
fi
|
||||
done
|
||||
if [ "$test_mode" -eq 1 ] && [ -n "$(header X-Robots-Tag)" ] && [ "$(header X-Robots-Tag)" != "noindex, nofollow" ]; then
|
||||
fail "$label: header X-Robots-Tag is '$(header X-Robots-Tag)', verwacht 'noindex, nofollow'"
|
||||
fi
|
||||
}
|
||||
|
||||
# Een 200 met de bytes van het verwachte bestand uit dist
|
||||
@@ -150,6 +191,115 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
# Een 200 met het verwachte content type voor een bestand van de admin
|
||||
expect_admin_file() {
|
||||
local path="$1" type="$2"
|
||||
fetch "$path"
|
||||
if [ "$status" != "200" ]; then
|
||||
fail "$path: status $status, verwacht 200"
|
||||
elif [[ "$(header Content-Type)" != "$type"* ]]; then
|
||||
fail "$path: Content-Type '$(header Content-Type)', verwacht $type"
|
||||
fi
|
||||
}
|
||||
|
||||
# Alleen met --cms: gedrag van de CMS-host zelf
|
||||
if [ "$cms_mode" -eq 1 ]; then
|
||||
# Cachebeleid: pagina's no-cache, assets onveranderlijk
|
||||
fetch /
|
||||
case "$(header Cache-Control)" in
|
||||
*no-cache*) ;;
|
||||
*) fail "/: Cache-Control '$(header Cache-Control)', verwacht no-cache" ;;
|
||||
esac
|
||||
if [ -n "$script" ]; then
|
||||
fetch "$script"
|
||||
check_security_headers "$script"
|
||||
case "$(header Cache-Control)" in
|
||||
*immutable*) ;;
|
||||
*) fail "$script: Cache-Control '$(header Cache-Control)', verwacht immutable" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Alleen gzip: nooit brotli, ook niet als de client erom vraagt
|
||||
fetch / -H 'Accept-Encoding: br, gzip'
|
||||
if [ "$(header Content-Encoding)" = "br" ]; then
|
||||
fail "/: Content-Encoding br, de CMS-host spreekt alleen gzip"
|
||||
fi
|
||||
|
||||
# robots.txt: volledige headerset, en op test alles uitsluiten
|
||||
fetch /robots.txt
|
||||
if [ "$status" != "200" ]; then
|
||||
fail "/robots.txt: status $status, verwacht 200"
|
||||
elif [ "$test_mode" -eq 1 ] && ! grep -q '^Disallow: /$' "$work/body"; then
|
||||
fail "/robots.txt: 'Disallow: /' ontbreekt op test"
|
||||
fi
|
||||
check_security_headers /robots.txt
|
||||
|
||||
# 404.html zelf geeft ook status 404 en de 404-pagina
|
||||
fetch /404.html
|
||||
if [ "$status" != "404" ]; then
|
||||
fail "/404.html: status $status, verwacht 404"
|
||||
fi
|
||||
check_security_headers /404.html
|
||||
|
||||
# Een procentgecodeerd pad met slash blijft gecodeerd (zou anders een
|
||||
# andere resource worden: /a?b)
|
||||
fetch '/a%3Fb/'
|
||||
if [ "$status" != "301" ]; then
|
||||
fail "/a%3Fb/: status $status, verwacht 301"
|
||||
elif [ "$(header Location)" != "/a%3Fb" ]; then
|
||||
fail "/a%3Fb/: Location '$(header Location)', verwacht /a%3Fb"
|
||||
fi
|
||||
|
||||
# Niet-GET op een websitepad. Met een lege body (-d ''): een POST zonder
|
||||
# body en zonder Content-Length via de HTTP/1.0-proxy weigert Kestrel met
|
||||
# 400 voordat de middleware het ziet
|
||||
fetch / -X POST -d ''
|
||||
if [ "$status" != "405" ]; then
|
||||
fail "POST /: status $status, verwacht 405"
|
||||
fi
|
||||
|
||||
# De CMS-routes: health, admin, API (zonder Offerings), onbekend API-pad
|
||||
fetch /health
|
||||
if [ "$status" != "200" ]; then fail "/health: status $status, verwacht 200"; fi
|
||||
|
||||
fetch /admin/
|
||||
if [ "$status" != "200" ]; then fail "/admin/: status $status, verwacht 200"; fi
|
||||
# De bestanden van de admin zelf, niet alleen de index: zonder die laadt
|
||||
# de pagina blanco (een catch-all route mag de static files niet afvangen)
|
||||
admin_css="$(grep -o '/admin/assets/[A-Za-z0-9_.-]*\.css' "$work/body" | head -n 1 || true)"
|
||||
admin_js="$(grep -o '/admin/assets/[A-Za-z0-9_.-]*\.js' "$work/body" | head -n 1 || true)"
|
||||
expect_admin_file /admin/index.html "text/html"
|
||||
expect_admin_file /admin/favicon-theme.png "image/png"
|
||||
if [ -z "$admin_css" ] || [ -z "$admin_js" ]; then
|
||||
fail "/admin/: geen css of js in de index gevonden"
|
||||
else
|
||||
expect_admin_file "$admin_css" "text/css"
|
||||
expect_admin_file "$admin_js" "text/javascript"
|
||||
fi
|
||||
# Een onbekend bestand onder /admin is een kale 404, geen HTML
|
||||
fetch /admin/assets/bestaat-niet.js
|
||||
if [ "$status" != "404" ]; then
|
||||
fail "/admin/assets/bestaat-niet.js: status $status, verwacht 404"
|
||||
elif grep -qi '<html' "$work/body"; then
|
||||
fail "/admin/assets/bestaat-niet.js: antwoordt met HTML"
|
||||
fi
|
||||
|
||||
fetch /api/v1/System/capabilities
|
||||
if [ "$status" != "200" ]; then
|
||||
fail "/api/v1/System/capabilities: status $status, verwacht 200"
|
||||
elif grep -qi 'offerings' "$work/body"; then
|
||||
fail "/api/v1/System/capabilities noemt Offerings; die module hoort voor ASF uit te staan"
|
||||
fi
|
||||
|
||||
# Een onbekend API-pad is een API-404, nooit de website
|
||||
fetch /api/v1/onbekend-pad-voor-controle
|
||||
if [ "$status" != "404" ]; then
|
||||
fail "/api/v1/onbekend-pad-voor-controle: status $status, verwacht 404"
|
||||
elif grep -qi '<html' "$work/body"; then
|
||||
fail "/api/v1/onbekend-pad-voor-controle: antwoordt met HTML (SPA-fallback?)"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$failures" -gt 0 ]; then
|
||||
echo "Controle mislukt ($failures fout(en)) voor $base" >&2
|
||||
exit 1
|
||||
|
||||
@@ -429,6 +429,37 @@ describe.skipIf(toolsMissing)('verify-deployment.sh', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('met --cms: weigert te starten zonder EXPECTED_CSP', async () => {
|
||||
const run = await runScript(
|
||||
'verify-deployment.sh',
|
||||
['http://127.0.0.1:9', dist, '--test', '--cms'],
|
||||
{ EXPECTED_CSP: '' },
|
||||
);
|
||||
expect(run.code).toBe(2);
|
||||
expect(run.stderr).toContain('EXPECTED_CSP');
|
||||
});
|
||||
|
||||
it('met --cms: meldt een afwijkende CSP en de ontbrekende CMS-routes', async () => {
|
||||
// De gewone stub is een nginx-achtige server: geen /health, /admin/
|
||||
// of API, en een andere CSP dan hier verwacht
|
||||
await withStub(
|
||||
{ behaviour: 'new', robots: true, gzip: true },
|
||||
async (origin) => {
|
||||
const run = await runScript(
|
||||
'verify-deployment.sh',
|
||||
[origin, dist, '--test', '--cms'],
|
||||
{ EXPECTED_CSP: "default-src 'none'" },
|
||||
);
|
||||
expect(run.code).toBe(1);
|
||||
expect(run.stderr).toContain(
|
||||
"header Content-Security-Policy is '",
|
||||
);
|
||||
expect(run.stderr).toContain('/health: status 404');
|
||||
expect(run.stderr).toContain('/admin/: status 301');
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('telt een verbroken verbinding als fout en eindigt met de samenvatting', async () => {
|
||||
await withStub(
|
||||
{ behaviour: 'new', drop: '/over-mij' },
|
||||
|
||||
Reference in New Issue
Block a user