Opstart zonder mailconfiguratie getest voor alle hosts, Website__LogLevel zonder punt in de naam

Oorzaak 502 op ASF test: Email__Smtp__Host stond al in de omgeving maar App__PublicBaseUrl nog niet;
de startvalidatie weigert zo'n halve mailconfiguratie. Een host zonder enige mailinstelling start
gewoon: nu voor master, slave, SlpSoftware en ASF getest. Website__LogLevel vervangt de
Logging__LogLevel__SlpModularCms.Website-variabele, waarvan systemd de naam met punt negeert.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-08 20:40:50 +01:00
co-authored by Claude Sonnet 5.5
parent 57e77edcf9
commit 142815a3ab
8 changed files with 171 additions and 4 deletions
@@ -45,7 +45,7 @@ apps/andreaslopfotografie/test/
| `Observability__SentryDsn` | the website's existing Sentry DSN (backend; the admin reports through the same-origin `/sentry-tunnel`) |
| `Observability__Environment` | `test` |
| `ForwardedHeaders__KnownProxies__0` | `192.168.1.102` |
| `Logging__LogLevel__SlpModularCms.Website` | `Information` (test only) |
| `Website__LogLevel` | `Information` (test only). Replaces `Logging__LogLevel__SlpModularCms.Website`: a variable name containing a dot is ignored by a systemd `EnvironmentFile`. (The committed default log level is already `Information`, so the website logs 301/404 at that level without it.) |
Committed defaults (in the client's `appsettings.json`, no secrets): `SecurityHeaders` with `DefaultPolicy=StrictSite`, the site's Umami and Sentry origins, `Website:NoIndex=true` (secure default; a later production setup must set it to `false` explicitly), JWT issuer/audience, rate limiting values.
@@ -48,3 +48,9 @@ Read-only checks done from the developer PC (by "CMS & API"): `mail.andreaslop.n
2. Port and TLS: not yet confirmed that the server offers STARTTLS on 587 (`Email__Smtp__EnableSsl=true`); if it needs implicit TLS (465) or none, the sender must be adapted (it supports STARTTLS or plain today) and a plain connection would not be acceptable beyond a private network.
3. DKIM: a `dkim._domainkey.andreaslop.nl` record exists; confirm the server signs with that key. DMARC is `p=none` (monitoring only).
4. Credentials for that account go into the ASF test unit's `shared/env` by whoever manages the host (not by this feature's code or by chat).
## Release notes for the host manager (required environment variables per release)
- **This release adds NO required environment variable.** A host without any mail setting starts exactly as before; this is tested for every deployed host configuration (master, slave, SlpSoftware, ASF).
- Mail is switched on only by setting `Email__Smtp__Host`. **Once a host is set, all of these must be set too, or the host refuses to start** (502 behind the proxy) with a message naming the missing setting: `App__PublicBaseUrl` (https, no path), `Email__FromAddress`/`Email__FromName` (have committed defaults), and `Email__Smtp__Username` together with `Email__Smtp__Password`. Set `App__PublicBaseUrl` BEFORE or together with `Email__Smtp__Host`.
- Optional: `Identity__Invitation__ExpiryHours` (24), `Identity__PasswordReset__TokenLifetimeMinutes` (60), `Identity__PasswordReset__CooldownMinutes` (5), `App__DefaultLanguage` (nl), `Email__AllowedFromAddresses__0..n`, `Website__LogLevel`.
- Incident 2026-11-08: ASF test returned 502 after a restart because `Email__Smtp__Host` was set but `App__PublicBaseUrl` was not (start-up validation, by design: a half-configured mail setup is refused rather than silently ignored). Not a deploy without mail configuration. A softer behaviour (start with mail switched off and an error log) is a possible change, see the open question to Bryan.