Adds the AI-DLC documents of the CMS and API foundation feature
Continuous Integration / check (pull_request) Successful in 1m50s
Continuous Integration / deploy-test (pull_request) Skipped
Continuous Integration / lighthouse (pull_request) Successful in 8m50s
Continuous Integration / deploy-production (pull_request) Skipped

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-08 02:06:00 +01:00
co-authored by Claude Sonnet 5.5
parent 41a6e7be5a
commit 288b0e3838
19 changed files with 1901 additions and 0 deletions
@@ -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,54 @@
# 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 |
| pending | U2 Build and Test approval by Bryan (CMS session); CI vulnerability-scan decision; go for U3 | |