Files
slp-modular-cms/aidlc-docs/features/andreaslop-site-hosting/inception/plans/application-design-plan.md
T

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.AllowedConnectOrigins is applied to both Strict and Relaxed. If the Umami and Sentry origins were put there for Andrea's site, the admin (/admin, /api/v1, under Strict) would get them too. AllowedScriptOrigins is only used by Relaxed today.
  • Linux file systems are case-sensitive, and all page files are lowercase. A request /Over-Mij therefore resolves to a known page exactly when over-mij.html exists. A cached "known page set" is not strictly needed: a file-exists predicate on the lowercased name gives the same nginx behaviour.
  • UseHttpsRedirection is 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 in CmsHost today. 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 example AllowedSiteScriptOrigins, AllowedSiteConnectOrigins) used only by StrictSite; the admin policies stay exactly as strict as today (recommended)
  • B) Reuse the existing AllowedScriptOrigins / AllowedConnectOrigins; accept that Strict (admin and API) then also lists the Sentry ingest origin in connect-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/status returns tokenRequired); 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)