diff --git a/aidlc-docs/active-features.md b/aidlc-docs/active-features.md index 3c7dc2b..96b7fd8 100644 --- a/aidlc-docs/active-features.md +++ b/aidlc-docs/active-features.md @@ -9,4 +9,4 @@ | Local Dev Master/Slave Setup (local-dev-master-slave-setup) | ✅ Complete | unknown | Modules.Master, Api, Frontend | 2026-07-02 | | Gitea Deployment Workflow (gitea-deployment-workflow) | 🟡 Operations | feature/gitea-deployment-workflow | CI/CD, Api (hosting/config), Core, Modules, Frontend (build), Docs | 2026-07-27 | | SlpSoftware Production API (slpsoftware-api) | ✅ Complete | feature/slpsoftware-api | Clients (new Api.SlpSoftware), Modules (new Offerings module + Tests), Core (CmsHost), CI/CD (retargeted to Api.SlpSoftware) | 2026-08-02 | -| Andrea's site hosting (andreaslop-site-hosting) | 🔵 Inception | feature/andreaslop-site-hosting | Core (CmsHost, CSP, static content), Clients (new Api.AndreaSlopFotografie), Frontend (theme), CI/CD | 2026-11-06 | +| Andrea's site hosting (andreaslop-site-hosting) | 🟢 Construction | feature/andreaslop-site-hosting | Core (CmsHost, CSP, static content), Clients (new Api.AndreaSlopFotografie), Frontend (theme), CI/CD | 2026-11-06 | diff --git a/aidlc-docs/features/andreaslop-site-hosting/aidlc-state.md b/aidlc-docs/features/andreaslop-site-hosting/aidlc-state.md index fc6cfa6..570623c 100644 --- a/aidlc-docs/features/andreaslop-site-hosting/aidlc-state.md +++ b/aidlc-docs/features/andreaslop-site-hosting/aidlc-state.md @@ -5,7 +5,7 @@ - **Feature Slug**: andreaslop-site-hosting - **Project Type**: Brownfield - **Start Date**: 2026-11-06T00:06:13Z -- **Current Stage**: CONSTRUCTION - U1 Code Generation (generation) +- **Current Stage**: CONSTRUCTION - U1 complete; waiting for the requester go before U2 - **Branch**: feature/andreaslop-site-hosting - **Request Type**: Feature (two units: U1 core-site-hosting, U2 andreaslop-client) diff --git a/aidlc-docs/features/andreaslop-site-hosting/audit.md b/aidlc-docs/features/andreaslop-site-hosting/audit.md index 31a3f53..12cab5d 100644 --- a/aidlc-docs/features/andreaslop-site-hosting/audit.md +++ b/aidlc-docs/features/andreaslop-site-hosting/audit.md @@ -271,3 +271,25 @@ **Context**: Construction, U1 Code Generation. --- + +## Code Generation U1 - generated, built and tested + +**Timestamp**: 2026-11-06T13:30:00Z + +**AI Response**: "Plan steps 1-13 done. Build succeeded. Core.Tests 330 passed; Identity 37, Master 57, Offerings 57, Availability 82 passed; Api.Tests could not run (no MariaDB reachable: socket errors, same precondition as before). Committed locally on feature/andreaslop-site-hosting (2 commits), not pushed. Awaiting approval." + +**Context**: Construction, U1 Code Generation Part 2. + +--- + +## Code Generation U1 - approved; hand-back written + +**Timestamp**: 2026-11-06T14:00:00Z + +**User Response**: "Ga verder" + +**Status**: Approved. Hand-back note written at `handback-u1.md`; sent to CMS & API. Waiting for their "go" before U2. + +**Context**: Construction, U1 complete. + +--- diff --git a/aidlc-docs/features/andreaslop-site-hosting/handback-u1.md b/aidlc-docs/features/andreaslop-site-hosting/handback-u1.md new file mode 100644 index 0000000..9e2a640 --- /dev/null +++ b/aidlc-docs/features/andreaslop-site-hosting/handback-u1.md @@ -0,0 +1,36 @@ +# Hand-back U1 - core-site-hosting + +Branch `feature/andreaslop-site-hosting` (2 local commits, not pushed). Code summary: `construction/core-site-hosting/code/code-summary.md`. + +## 1. What was built +- `CmsHostOptions.WebsiteMode` (`SpaFallback` default, `PrerenderedPages`); existing clients unchanged. +- Pure `WebsitePathResolver` (rules R1-R14), `PrerenderedSiteMiddleware`, final 404 fallback, gzip-only compression, `Website:NoIndex` (X-Robots-Tag + robots.txt), `WebsiteFileAccess` (per-request file lookup, no cache, no restart after delivery). +- `StrictSite` policy with `SecurityHeaders:AllowedSiteScriptOrigins` / `AllowedSiteConnectOrigins` (used only by StrictSite); CSP is byte-identical to the nginx value (asserted in a test with the Umami and Sentry origins). +- Full header set on every website response (page, asset, 301, 404, robots.txt) via a flag on the security-header writer; API and admin keep the HTML-only rule. +- Docs: `WEBSITE_WORKSPACE.md`, `README.md`. + +Deviations from the brief (reasons in code-summary.md): none in behaviour. Behaviour choices you reviewed: R11 nginx parity (301 on every trailing slash), dot segments refused except `/.well-known/`, full headers everywhere, gzip only, logging category `SlpModularCms.Website`. + +Behaviour notes for the verify script: 405 (`Allow: GET, HEAD`) for non-GET/HEAD on non-reserved paths that no endpoint claims; `HEAD` is supported; `Location` is always relative; `/404` and `/404.html` answer the 404 page with status 404; a directory without a page file is 404; unknown `/api/v1/...` is an empty API 404. + +## 2. Test results +- Build: success. `Core.Tests`: 330 passed (resolver examples, FsCheck properties, StrictSite policy, 25 in-memory integration scenarios). `Modules.Identity.Tests` 37, `Master` 57, `Offerings` 57, `Availability` 82: all passed. +- Property-based: FsCheck.Xunit 3.4.0 (test-only), 2000 generated paths per property, a new random seed each run; a failure prints the replay seed and the shrunk counterexample, which is then pinned as a plain example test (PBT-08). Properties: resolver never throws, ServeFile paths safe and existing, Redirect targets relative and never ending in `/` (except `/`), a redirect target never redirects again, reserved prefixes never resolved, at most 2 file checks; CSP origin round trip. +- Regression `Api` / `Api.SlpSoftware`: `Api.Tests` (the only host test project; SlpSoftware has none) **could not run here**: it needs a reachable MariaDB and failed with socket errors at the startup migration. Not a code failure, but also not proven green. `Api` and `Api.SlpSoftware` build, default to `SpaFallback`, and a SpaFallback-mode integration test shows unchanged behaviour. Please run `Api.Tests` where a database exists (or I run it on the Pi in U2). +- Local timing: 500 `GET /over-mij` on an in-memory server = 0.72 ms per request (not a Pi measurement). + +## 3. Configuration values for the website repo +- Client opt-in: `new CmsHostOptions { WebsiteMode = WebsiteMode.PrerenderedPages }` (done in U2 in `Api.AndreaSlopFotografie`). +- `SecurityHeaders:DefaultPolicy = StrictSite`; `AllowedSiteScriptOrigins = [https://analytics.slpsoftware.nl]`; `AllowedSiteConnectOrigins = [https://analytics.slpsoftware.nl, https://o4511795618185216.ingest.de.sentry.io]`. +- `Website:NoIndex = true` on test. +- Headers sent on every website response: CSP (exact nginx string), `Strict-Transport-Security: max-age=31536000; includeSubDomains` (not in Development), `X-Content-Type-Options: nosniff`, `X-Frame-Options: DENY`, `Referrer-Policy: strict-origin-when-cross-origin`; plus `X-Robots-Tag: noindex, nofollow` when NoIndex. +- Cache-Control: `no-cache` for pages/root files, `public, max-age=31536000, immutable` under `/assets/`. HTML content type `text/html; charset=utf-8`. +- Delivery path: `wwwroot/web/` of the published app (U2 decides whether CI writes there or a symlink to `/mnt/storage1/www/html/...`; both work without restart). Hostname, ports (5200 test) and the test deploy come with U2. +- Logging: `Logging:LogLevel:SlpModularCms.Website = Information` on test (301/404 lines), Warning elsewhere. + +## 4. Open questions and risks +1. `Api.Tests` not run (no database); see section 2. +2. HSTS is not sent when the host runs in `Development`; irrelevant on the Pi, relevant for local verify runs. +3. Behind the proxy Pi the host sees plain HTTP; redirects are relative and `UseHttpsRedirection` stays a no-op, covered by a test, not yet observed on the Pi. +4. No forwarded-headers handling was added; nothing in U1 needs the original scheme or host. +5. Per-request file lookup is not measured on the Pi SD card / `/mnt/storage1`; I expect it to be fine, a measurement can follow in U2.