feat: härtung für den öffentlichen betrieb

- Security-Header (CSP, nosniff, X-Frame-Options, Referrer-/Permissions-Policy)
- HSTS nur bei HTTPS und ohne includeSubDomains
- echtes 404 für dateiartige Pfade wie /.env statt SPA-Fallback
- API-Doku nur mit ENABLE_API_DOCS=true
- API-Requests über 1 MiB werden mit 413 abgelehnt, auch bei Chunked-Upload

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dbildhauerandClaude Opus 5.5 committed 2026-10-25 11:04:33 +01:00
1 parent dc4b804ccf
commit 66fe8feea4
4 files changed
+201 -4

No files matched your search

+2
View File
@@ -10,6 +10,8 @@ class Settings(BaseSettings):
data_dir: Path = Path("/data")
static_dir: Path = Path("/app/static")
log_level: str = "info"
enable_api_docs: bool = False
max_request_bytes: int = 1024 * 1024
# Comma-separated list of origins allowed for state-changing requests and WebSockets
allowed_origins: str = "https://clip.webbildhauer.com"