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
@@ -22,8 +22,20 @@ public static class PrerenderedSiteExtensions
{
services.AddOptions<WebsiteOptions>()
.Bind(configuration.GetSection(WebsiteOptions.SectionName))
.Validate(o => WebsiteOptions.IsValidLogLevel(o.LogLevel),
"Website:LogLevel must be a log level name (Trace, Debug, Information, Warning, Error, Critical, None) or empty.")
.ValidateOnStart();
// Website:LogLevel (env: Website__LogLevel) sets the level of the website's logger category. It exists
// because Logging__LogLevel__SlpModularCms.Website has a dot in its name, which systemd's
// EnvironmentFile does not accept.
var configuredLevel = configuration[$"{WebsiteOptions.SectionName}:LogLevel"];
if (!string.IsNullOrWhiteSpace(configuredLevel)
&& Enum.TryParse<LogLevel>(configuredLevel.Trim(), ignoreCase: true, out var level))
{
services.AddLogging(logging => logging.AddFilter(PrerenderedSiteMiddleware.LoggerCategory, level));
}
// Presence of the marker switches on the full security-header set for website responses.
services.AddSingleton<WebsiteHostingMarker>();