6.2 KiB
6.2 KiB
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.cson the sharedCmsHost, likeApi.SlpSoftware. - Module composition: references
Coreand only the module projects Andrea needs.Offeringsis 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 = StrictSiteandAllowedScriptOrigins/AllowedConnectOriginsfor Umami and Sentry. - Website indexing setting (
Website:NoIndex) per environment.
- Thin
- Interfaces: the shared
CmsHost.ConfigureServices/ConfigurePipelinecalls; configuration sectionsSecurityHeaders,Website.
C2. CmsHostOptions (changed, in Core)
- Purpose: The documented extension point for per-client differences.
- Responsibilities: carries
WebsiteMode(SpaFallbackdefault,PrerenderedPages). The default keepsApiandApi.SlpSoftwareunchanged. - 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 ofServe(file),Redirect(canonicalPath),NotFound. Rules:/servesindex.html;/xservesx.html(alsox/index.htmlif 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, answers404.htmlwith status 404 for unknown paths (neverindex.html), issues canonical 301 redirects, and excludes reserved prefixes so an unknown/api/v1/xstays a plain API 404, not the website's 404 page. - C3c
WebsiteCachePolicy:Cache-Control: no-cachefor pages, long-lived immutable for hashed/assets. - C3d
WebsiteIndexingPolicy: whenWebsite:NoIndexis true, addsX-Robots-Tag: noindex, nofollowand serves/robots.txtas "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:
Strictdirectives plus configured script origins inscript-srcand configured connect origins inconnect-src;X-Frame-Options: DENY;frame-ancestors 'none'.StrictandRelaxeddo not change.PathPolicyRuleand 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_THEMEselects the folder at build time;VITE_APP_TITLEalready names the app; a new build-timeVITE_DEFAULT_LANGUAGEsets 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).
- Default theme = today's tokens in
- 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; publishApi.AndreaSlopFotografie; deploy to the test host with the existing atomic release switch; keepwwwroot/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) towwwroot/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'sWEBSITE_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.htmlwith status 404, caching andnoindexon test; assert that/admin,/api/v1/System/capabilitiesand/healthrespond.
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.