Fase B1: Website:Mode via configuratie (ASF kiest in appsettings), Api = alle-modules-compositie; flaky SMTP-test gerepareerd

- CmsHostOptions.ResolveWebsiteMode: Website:Mode wint van de code, default SpaFallback, onbekende waarde stopt de host.
- ASF: Website:Mode=PrerenderedPages in appsettings.json, Program.cs zonder eigen modus.
- SlpModularCms.Api verwijst nu ook naar Offerings en Contact met generieke default-config (Website/Email/App/Contact/RateLimiting).
- SmtpFailureTests: '535' als los getal, niet als substring van een willekeurige poort.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-15 15:00:56 +01:00
co-authored by Claude Sonnet 5.5
parent d1f833b556
commit 24168c68a1
8 changed files with 160 additions and 10 deletions
@@ -20,8 +20,10 @@
<ItemGroup>
<ProjectReference Include="..\SlpModularCms.Core\SlpModularCms.Core.csproj" />
<ProjectReference Include="..\SlpModularCms.Modules.Availability\SlpModularCms.Modules.Availability.csproj" />
<ProjectReference Include="..\SlpModularCms.Modules.Contact\SlpModularCms.Modules.Contact.csproj" />
<ProjectReference Include="..\SlpModularCms.Modules.Identity\SlpModularCms.Modules.Identity.csproj" />
<ProjectReference Include="..\SlpModularCms.Modules.Master\SlpModularCms.Modules.Master.csproj" />
<ProjectReference Include="..\SlpModularCms.Modules.Offerings\SlpModularCms.Modules.Offerings.csproj" />
</ItemGroup>
<!--
+64
View File
@@ -33,9 +33,57 @@
"FailOpenAfterMinutes": 5,
"HttpTimeoutSeconds": 5
},
"Website": {
// Secure default: every response carries noindex and /robots.txt disallows all. A site sets its own
// Website section (PublicBaseUrl, AuthoredBaseUrl, Sitemap, KnownPaths, Mode) in its appsettings.json.
"NoIndex": true
},
// Mail (invitations, password reset, notices). Mail is OFF while Email:Smtp:Host is empty and every
// flow then works as before (copy the link). Enable per environment with environment variables:
// Email__Smtp__Host, Email__Smtp__Port, Email__Smtp__EnableSsl, Email__Smtp__Username,
// Email__Smtp__Password (secrets only there, never in this file) and App__PublicBaseUrl.
// Extra sender addresses a site may choose in its settings go in Email:AllowedFromAddresses.
"Email": {
"FromAddress": "no-reply@cms.invalid",
"FromName": "SlpModularCms",
"AllowedFromAddresses": [],
"LogoUrl": "",
"BrandColor": "#ac0000",
"Smtp": {
"Host": "",
"Port": 587,
"EnableSsl": true,
"Username": "",
"Password": "",
"TimeoutSeconds": 10
}
},
"App": {
// Public https address of this site, used for links in mails, e.g. https://test.andreaslop.nl
"PublicBaseUrl": "",
"DefaultLanguage": "nl"
},
"Cors": {
"AllowedOrigins": []
},
"Contact": {
// OFF by default. The contact rate limits are per visitor (see ContactRateLimitPartition), but that only
// works with the real client address: behind a reverse proxy (IIS) set ForwardedHeaders__KnownProxies__0 to the
// proxy's address first, otherwise all visitors share ONE bucket. Release conditions, in order: that setting;
// Contact__RecipientEmail and working mail (environment only); captcha (recommended); then Contact__Enabled=true.
// The full list is in the Contact section of the Api.AndreaSlopFotografie appsettings.json.
"Enabled": false,
"SiteId": "cms",
"MinSeconds": 3,
"TokenLifetimeMinutes": 120,
"RetentionMonths": 12,
"SpamRetentionDays": 30,
"MaxSpamRowsPerDay": 200,
"MaxBodyBytes": 16384,
"Captcha": {
"Enabled": false
}
},
"RateLimiting": {
"Login": {
"PermitLimit": 5,
@@ -48,6 +96,22 @@
"SentryTunnel": {
"PermitLimit": 60,
"WindowSeconds": 60
},
"OfferingsPublic": {
"PermitLimit": 120,
"WindowSeconds": 60
},
"ContactForm": {
"PermitLimit": 5,
"WindowSeconds": 600
},
"ContactToken": {
"PermitLimit": 20,
"WindowSeconds": 600
},
"ContactResend": {
"PermitLimit": 5,
"WindowSeconds": 600
}
},
"SecurityHeaders": {