56 lines
8.5 KiB
Markdown
56 lines
8.5 KiB
Markdown
# Hand-back U2 - andreaslop-client
|
|
|
|
Branch `feature/andreaslop-site-hosting` (3 U2 commits on top of the U1 ones, **not pushed**, nothing deployed). Code summary: `construction/andreaslop-client/code/code-summary.md`. Test deploy status: **not done**, it needs Bryan's explicit go in this session and the Pi steps (`construction/andreaslop-client/infrastructure-design/manual-steps-for-bryan.md`, final).
|
|
|
|
## 1. What was built
|
|
- New client `SlpModularCms.Api.AndreaSlopFotografie` (Identity + Availability; no Master, no Offerings), `WebsiteMode.PrerenderedPages`, port 5200, `StrictSite` default policy with the website's Umami/Sentry origins, `Website:NoIndex=true` committed, tests project.
|
|
- Optional first-admin setup token (`Identity:Setup:Token`, `X-Setup-Token`, 401 identical for missing/wrong, `tokenRequired` in `GET Setup/status`, both setup endpoints under the `login` limiter, security event `setup_token_rejected` 5007).
|
|
- Shared Core change (option B): opt-in `ForwardedHeaders:KnownProxies` and per-client-address rate-limit partitions for `login`, `refresh`, sentry-tunnel, `offerings-public`. Without configuration the old behaviour applies to `Api`, `Api.SlpSoftware`, `Api.Slave`.
|
|
- Admin theme `asf` (`VITE_THEME=asf`, website palette exactly, Marcellus/Jost self-hosted, the website's real `favicon.png`), `VITE_DEFAULT_LANGUAGE=nl` (stored choice still wins), token field on the setup page.
|
|
- CI: `config-asf`, `publish-asf-test`, `deploy-asf-test` behind Gitea variable `ASF_TEST_DEPLOY_ENABLED == 'true'`, manual box "Deploy ASF test"; existing jobs, env block and `deploy-scp.yaml` unchanged (diff = additions only).
|
|
|
|
## 2. Names (for U3 and Pi-Main)
|
|
Gitea variables `ASF_TEST_DEPLOY_ENABLED`, `DEPLOY_PATH_ASF_TEST`, `SERVICE_NAME_ASF_TEST` (same form as `SERVICE_NAME_TEST`), `HEALTH_CHECK_URL_ASF_TEST`, `VITE_SENTRY_DSN_ASF` (DSN of the ASF **website** Sentry project); jobs `publish-asf-test`/`deploy-asf-test`; theme `frontend/themes/asf`; unit `andreaslopfotografie-test`; folder `apps/andreaslopfotografie/test`; DB `AndreaSlopFotografieTest` / user `AndreaSlopFotografie`; port 5200; shared/env variables listed in `infrastructure-design.md`.
|
|
|
|
## 3. U1 correction found during U2
|
|
The 301 `Location` was built from the decoded path without re-encoding: `/a%3Fb/` redirected to `/a?b` (another resource), `#` would start a fragment, non-ASCII ended up raw in a header value. Found by the existing property test (flaky about 1 in 15 runs), fixed with `PathString.ToUriComponent` plus regression tests. Normal paths are unchanged. The host is never worse than before for such paths; whether nginx encodes identically is for the web verify (one encoded path), I cannot run nginx here.
|
|
|
|
## 4. Test results
|
|
- Green locally: Core 351, Identity 57, Availability 82, Master 57, Offerings 57, ASF host configuration 5, frontend 293 (Vitest), ESLint and `tsc -b` clean, frontend builds for default and `asf` verified.
|
|
- **Not run here (no MariaDB on this machine): `Api.Tests` and `Api.AndreaSlopFotografie.Tests/HostPipelineTests`.** The CI job `backend-test` starts MariaDB and runs them; the result will be reported after the first push and CI run.
|
|
- **CI proof (branch `feature/andreaslop-site-hosting`, head e37b8f3, `workflow_dispatch`, all deploy inputs false)**: run 606 failed on one frontend test (first test of `SetupPage.test`, lazy-route spinner still shown after 8 s on the slow runner; CI frontend-test takes ~290 s, also on master); run 607 on the same commit is **fully green**: backend-test with MariaDB (Api.Tests 4/4, ASF host tests 10/10 incl. HostPipelineTests, Core 351, Identity 57, Availability 82, Master 57, Offerings 57), vulnerability-scan, frontend build/test/lint. Conclusion: cold-start timing flake of the first lazy-loaded test, not a defect; hardening is optional. No deploy job ran (all publish/deploy jobs skipped). `config-asf` ran because `ASF_TEST_DEPLOY_ENABLED=true` was set, which shows that `vars` in a job-level `if:` works on this Gitea.
|
|
- Not yet observed, only possible on the first test deploy: forwarded headers and HTTP/1.0 behind the proxy Pi, `vars` in a job-level `if:` on this Gitea, per-request file lookup timing on the Pi.
|
|
|
|
## 5. Information, no action needed
|
|
- Contrast pairs below WCAG AA (decision Q5 = B, colours exactly as the website): border on background 1.30:1 (decorative line colour) and ink-3 `#8a827a` on paper 3.54:1 (not used as a text colour by the theme). All text and button pairs pass AA, in light mode with the website palette. Dark mode is derived (the website has none; button accent lightened to `#8a9681` for 5.16:1).
|
|
- Radius `0.25rem` is a choice; the website defines no radius token.
|
|
- `logo.png` is not used: the admin has no logo element and the scope is tokens + favicon.
|
|
- The admin favicon is `themes/asf/favicon.png` (copied read-only from the website; the website repo was not touched).
|
|
|
|
## 6. Open items and risks
|
|
1. **Vulnerability gate (pre-existing advisories) - resolved with Bryan's go (option A)**: `System.Security.Cryptography.Xml` pin 10.0.10 -> 10.0.14 in `Core` and the Availability/Master/Offerings test projects (transitive `Pkcs` follows); frontend `zod` ^4.6.6 and `@tanstack/react-router` 1.170.46 (pulls `seroval` 1.7.9). `dotnet list package --vulnerable` is clean and `pnpm audit --prod` finds nothing; all suites rerun green. Shared packages changed: SlpSoftware and the other hosts get these patched versions too (DataProtection uses the Xml package), so watch the first SlpSoftware test deploy after merge.
|
|
2. Setup token must be removed from `shared/env` after the first administrator exists (step 17).
|
|
3. The proxy block change is only the `proxy_pass` target (port 5200); the website repo generator is updated in U3.
|
|
4. Production for ASF is out of scope.
|
|
|
|
## 7. Addendum 2026-11-09: what happened after this hand-back (all on ASF test; nothing on production)
|
|
After the first test deploy (run 608) the feature was used on `test.andreaslop.nl` and a series of defects and requests came back through the "CMS & API" session. Each has its own record under `aidlc-docs/bugs/` (cause, fix, test) and the deploys are in `audit.md`.
|
|
|
|
| Item | Record / where | Shared-code consequence for SlpSoftware |
|
|
|---|---|---|
|
|
| Admin files gave 404 in PrerenderedPages mode (catch-all route won over the admin static files) | audit.md, run 610; `notreserved` route constraint | none |
|
|
| Invitation link pointed at the website root instead of `/admin/...` | audit.md, run 612; `buildAppUrl` | none (frontend only) |
|
|
| Nine CMS points: invited name not stored, labels, Administrator may use site settings, deactivated or deleted users refused at once (JWT active check), re-inviting a deleted address, setup title, brand logo | `bugs/cms-admin-nine-points` | deactivation takes effect immediately; two additive nullable fields later; Administrator can switch availability |
|
|
| Pending/expired invitations cannot be removed; invitation lifetime configurable | `bugs/invitation-delete-and-lifetime` | expired invitations now listed; `Identity:Invitation:ExpiryHours` |
|
|
| Role hierarchy enforced in the API (Administrator only manages Users, never hands out Owner) | same record, follow-up decisions | stricter API |
|
|
| Owner got 403 when promoting an Administrator to Owner (caller identified by a null name claim) | `bugs/owner-cannot-promote-requester-identity` | fixes the user-management API on every host |
|
|
| Availability gate stopped the website and `/admin` of a disabled CMS (503) | `bugs/availability-gate-blocks-website-and-admin` | gate now covers `/api/` only |
|
|
| Setup page shown when the setup status could not be read (429 from the strict login limiter) | `bugs/setup-page-after-failed-status-read` | status read moved to the `refresh` limiter |
|
|
| Website log level cannot be set through a systemd EnvironmentFile (dot in the variable name) | `Website__LogLevel` (README, infra docs) | none |
|
|
| Admin layout: the whole page scrolled and the sidebar moved with it | audit/commit `f242da8` | shared layout |
|
|
| Flaky CI frontend test (redirect timers left running after unmount) | commit `892c548`, hook `useDelayedAction` | shared pages |
|
|
|
|
Also built on top of this feature, as its own feature branch: **identity-email-notifications** (mail for invitations, new links, notices and password reset; per-site sender in the site settings; three additive migrations). See `aidlc-docs/features/identity-email-notifications/handback.md`.
|
|
|
|
ASF test currently runs the branch `feature/identity-email-notifications` (it contains this whole feature plus the e-mail feature). Still not done for this feature: merge to master (needs Bryan's explicit go and the watched SlpSoftware test deploy), production.
|