Files
SlpSoftware/aidlc-docs/features/redesign-modern-timetravel/construction/contact-form/infrastructure-design/infrastructure-design.md
T
SluijsensandClaude Sonnet 5.5 aa843a5675 Contactformulier: cms-client (validatie, reducer, client, hook), formulier in stijl B en beschikbaarheid
Headless pakket src/cms-client met importgrens, formulier dat pas verschijnt als de API antwoordt
(anders blijft de mailto-knop), honeypot, idempotentie, token-vernieuwing en property-based tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 13:13:24 +01:00

4.5 KiB

Infrastructure Design — contact-form (U4)

The frontend introduces no new infrastructure. The form needs only the same-origin API prefix that the offerings call already uses.

Confirmed

  • The example nginx configs in aidlc-docs/features/react-frontend/operations/deployment/nginx/ only show / to the web server and /sentry-tunnel; they contain no /api/v1/ location and no security-header directives. That repository documentation may be outdated compared with the real Pi configuration.
  • The user: SLP Software already has an API that does not have to move.
  • The session "CMS & API" (2026-11-10): the release going to production now contains no contact routes; they arrive with the contact feature and are switched on in production only after Bryan's go.

Confirmed later the same day (via "CMS & API", from Pi-Main and the CMS code at 2818b74)

  • The SLP .NET apps listen on Pi-Main: test :5100, production :5101 (0.0.0.0, ufw only allows 192.168.1.102, the proxy Pi "Pi-Entry"). TLS ends on Pi-Entry; the app sees http with Host: test.slpsoftware.nl / slpsoftware.nl.
  • Pi-Main's journal shows requests under both /api/v1 and / reaching the same .NET app, so /api/v1/ evidently reaches the app on test; the real Pi-Entry config is not visible to the AI sessions.
  • Pi-Main's nginx sets no security headers for the SLP sites (only Cache-Control: public on static assets). The CMS host sets them itself (SecurityHeadersMiddleware, options SecurityHeaders: Enabled, DefaultPolicy Relaxed, PathPolicies with /admin, /api/v1, /health = Strict, AllowedScriptOrigins, AllowedConnectOrigins; CSP definitions in code; TryAdd, so headers set earlier by nginx win). Pi-Entry may set headers too (unknown).
  • Api.SlpSoftware serves / only as SPA fallback from wwwroot/web when present (WebsiteMode SpaFallback); only the Andrea host runs PrerenderedPages.

Still unconfirmed (do not treat as fact)

  • Which application delivers the public pages of slpsoftware.nl today (the CMS wwwroot/web fallback or a separate static web server) and therefore which header policy applies to the HTML of this site; the site CSP below applies to that delivering server (for the CMS host: SecurityHeaders:DefaultPolicy and AllowedScriptOrigins/AllowedConnectOrigins must allow the Umami host).
  • The Pi-Entry configuration (routing of /api/v1/ vs /, headers). To be confirmed by the user; the form itself only needs connect-src 'self' because /api/v1 is on the same host.

Required configuration (for deployment / Operations list)

  1. Reverse proxy: /api/v1/ must be forwarded as a prefix to the existing SLP API (no new route if that is already the case), preserving Host, X-Forwarded-For, X-Forwarded-Proto; request body limit of at least 32 KB; no response caching for /api/v1/offerings and /api/v1/contact-messages*. The API needs the real client IP for per-client rate limiting (ForwardedHeaders:KnownProxies on the API host).
  2. Security headers (SECURITY-04) on HTML responses, if not present yet: Content-Security-Policy (e.g. default-src 'self'; script-src 'self' <umami-host>; connect-src 'self' <umami-host>; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self'; frame-ancestors 'none'), Strict-Transport-Security: max-age=31536000; includeSubDomains, X-Content-Type-Options: nosniff, X-Frame-Options: DENY, Referrer-Policy: strict-origin-when-cross-origin. The form itself needs only connect-src 'self'; fonts are self-hosted; /theme-init.js is same-origin. style-src 'unsafe-inline' is needed for inline style attributes (progress bars) and is an accepted, documented exception until those are replaced.
  3. Environment: no new variables. VITE_API_BASE_URL stays a local-development override only.
  4. Switches: the form appears only when the CMS host switch Contact:Enabled and the CMS switch are both on (token route answers 200); enabling is an Operations step after per-client rate limiting is on the API host.
  5. Observability: Umami events contact-sent / contact-failed (no data); Sentry without bodies; reverse-proxy access logging is an Operations item (SECURITY-02).

Security Baseline — Infrastructure scope

SECURITY-04: open until confirmed (unknown whether the real servers set the headers; the repository examples do not). Tracked for Operations (still undecided) and flagged to the user. SECURITY-07: only 80/443 exposed by the reverse proxy; the API upstream stays internal. Other rules N/A for this unit.