3.5 KiB
3.5 KiB
Application Design Plan - andreaslop-site-hosting
Steps
- Analyse requirements and host code (done: CmsHost, StaticContentExtensions, CspPolicyCatalog, SecurityHeadersOptions, SetupController)
- Collect answers to the design questions below
- Generate components.md
- Generate component-methods.md
- Generate services.md
- Generate component-dependency.md
- Generate application-design.md (consolidated)
- Validate completeness and consistency (security baseline / PBT applicability)
Facts from the code that shape the questions
SecurityHeadersOptions.AllowedConnectOriginsis applied to bothStrictandRelaxed. If the Umami and Sentry origins were put there for Andrea's site, the admin (/admin,/api/v1, underStrict) would get them too.AllowedScriptOriginsis only used byRelaxedtoday.- Linux file systems are case-sensitive, and all page files are lowercase. A request
/Over-Mijtherefore resolves to a known page exactly whenover-mij.htmlexists. A cached "known page set" is not strictly needed: a file-exists predicate on the lowercased name gives the same nginx behaviour. UseHttpsRedirectionis a no-op when the host listens on plain HTTP only without an HTTPS port configured; the proxy Pi talks HTTP to the app. There is no forwarded-headers handling inCmsHosttoday. To be verified in NFR Design against the SlpSoftware deployment.SetupController(GET /Setup/status,POST /Setup/owner) has no protection other than "system not yet initialised". The admin setup page posts to it.
Design Questions
Question 1: Origins for the StrictSite policy
Where do the Umami script origin and the Sentry connect origins for the website live?
- A) New separate lists in
SecurityHeaders(for exampleAllowedSiteScriptOrigins,AllowedSiteConnectOrigins) used only byStrictSite; the admin policies stay exactly as strict as today (recommended) - B) Reuse the existing
AllowedScriptOrigins/AllowedConnectOrigins; accept thatStrict(admin and API) then also lists the Sentry ingest origin inconnect-src - X) Other (please describe after Answer: tag below)
Question 2: How the host decides a page is "known"
nginx canonicalises (301) only known pages. How should the host decide this?
- A) Per request, a file-exists check on the lowercased name (
<name>.html, or<name>/index.html); no cache, so a site delivered in place (symlink variant, rsync) is always current. The pure resolver takes the check as a predicate (recommended) - B) A snapshot of the known pages built at startup and refreshed on a short timer or file watcher
- X) Other (please describe after Answer: tag below)
Question 3: First-admin setup token in the admin
The setup token protects POST /Setup/owner. How does the person doing the first setup supply it?
- A) The setup page shows a "setup token" field, but only when the server says one is required (
GET /Setup/statusreturnstokenRequired); the token is sent in a request header; small frontend change, no change when no token is configured (recommended) - B) No frontend change: the token is sent only as a header by a direct API call (for example curl), the setup page stays as it is
- X) Other (please describe after Answer: tag below)