Commit Graph
3 Commits
Author SHA1 Message Date
8d85f76180 Fix: unique CDN URLs per upload to bust browser + disk model cache
Uploading a replacement GLB with changed animation names to the same
folder/fileName path silently overwrote the S3 object but left the URL
unchanged.  ModelCache keyed its disk cache and in-memory cache by URL,
so all clients continued loading the stale model indefinitely.

Fix (CardEditor.razor):
- Asset uploads: append _yyyyMMddHHmmss timestamp to the filename stem
  before calling UploadAsync, e.g. merlock_20260316_143022.glb.
- Animation uploads: same treatment.
- Result: every upload produces a unique URL; the card asset record is
  updated to that URL; ModelCache sees a new key and fetches fresh bytes.

Fix (HttpCdnClient.cs):
- Set Cache-Control: public, max-age=31536000, immutable on uploaded
  objects.  Since keys are now unique-per-upload, aggressive caching is
  safe and avoids unnecessary re-downloads of unchanged assets.

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>
2026-03-16 12:05:28 -04:00
b6ac58bada Switch CDN to S3-compatible Ceph RadosGW (AWSSDK.S3)
Replace custom HttpCdnClient (proprietary upload API) with S3CdnClient
backed by AWSSDK.S3 using ForcePathStyle for Ceph RadosGW compatibility.
CdnOptions gains EndpointUrl/AccessKey/SecretKey/BucketName; removes
UploadBaseUrl/ApiKey. K8s deployments and secrets template updated to
match new config keys.

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>
2026-02-27 00:57:15 -05:00
ee4ec43a57 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>
2026-02-25 09:42:30 -05:00