Add CDN layer, harden admin unlock UI, scrub credentials from git

SOR.Cdn (new project):
- ICdnClient / HttpCdnClient — POST /upload?folder= + DELETE /files/{path}
- Typed HttpClient, X-Api-Key auth, 100 MB stream support
- CdnOptions: PublicBaseUrl, UploadBaseUrl, ApiKey (all via k8s env vars)

CardEditor (Assets tab):
- Upload button per asset/animation — streams file through Blazor Server SignalR
  to CDN; auto-fills CdnUrl + MimeType on success
- SignalR MaximumReceiveMessageSize raised to 100 MB for large 3D model uploads
- accept="image/*" for Art2D, ".glb,.gltf,.fbx" for Model3D and animations

AccountDetail:
- Distinguish auto-lockout (≤ 1 h, yellow badge) from admin ban (> 1 h, red badge)
- "Force Unlock" clears lockout immediately + resets failed-attempt counter
- "Unban" for admin-set bans; both call SetLockoutEndDateAsync(null)

Auth lockout: 15 min → 30 min (SOR.Auth + SOR.Admin both updated)

Credentials:
- Removed hardcoded Postgres/Redis creds from all committed appsettings.json
- Production values come from k8s secret env vars (ASP.NET Core env override)
- Added appsettings.Development.json + appsettings.*.Local.json to .gitignore

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-02-25 09:42:30 -05:00
co-authored by Claude Happy
parent 1974dffdb6
commit ee4ec43a57
15 changed files with 439 additions and 29 deletions
+11 -1
View File
@@ -1,11 +1,21 @@
{
// In production, all credentials are injected by k8s secret as env vars — never committed.
// Local dev: copy to appsettings.Development.json (gitignored) and fill in real values.
// ConnectionStrings__Redis → host:port,password=…,ssl=True
// ConnectionStrings__Default → Host=…;Port=5432;Database=sor;Username=…;Password=…
// Cdn__PublicBaseUrl, Cdn__UploadBaseUrl, Cdn__ApiKey
"ConnectionStrings": {
"Redis": "localhost:6379",
"Default": "Host=172.10.1.127;Port=5432;Database=sor;Username=SOR-DBA;Password=G073gxq7VtQaOfnITcxDh3bsibcipe6D"
"Default": "Host=localhost;Port=5432;Database=sor;Username=sor_admin;Password=CHANGEME"
},
"Nats": {
"Url": "nats://localhost:4222"
},
"Cdn": {
"PublicBaseUrl": "",
"UploadBaseUrl": "",
"ApiKey": ""
},
"WebSocket": {
"Path": "/ws",
"PingIntervalMs": 30000,