Heimdall.Api controllers/hubs/filters were exact duplicates of
files already in Heimdall.Web (same namespace, same content).
The Api project was a leftover from before the single-image merge.
Changes:
- Add missing registrations to Web/Program.cs (JWT Bearer auth,
rate limiting, controllers with ExceptionFilter, FluentValidation,
SignalR + broadcast services, OpenAPI/Scalar, CORS, hub mappings)
- Add FluentValidation.AspNetCore, Scalar.AspNetCore,
Microsoft.AspNetCore.OpenApi NuGet packages to Web.csproj
- Remove Heimdall.Api from solution and delete the project
- All routes continue working at their existing paths
Add ILogger<AuthService> with log events at every step:
register, login, 2FA, refresh token, password change,
logout, admin registration. All error paths now log
the exact failure reason (validation, Identity errors,
public registration disabled, etc.).
Previously all errors were silently swallowed by the
HeimdallApiClient returning null on non-success responses.
The HeimdallApiClient calls the API via HTTP on localhost.
Inside Docker, the app listens on port 8080 (ASPNETCORE_URLS),
but the default was 5000 (host-mapped port) — causing connection
refused on all API calls from Blazor Server UI.
Fix: change default from localhost:5000 to localhost:8080.
- Remove `using var` from dpCert so the cert stays alive for
ProtectKeysWithCertificate (was disposed, causing
CryptographicException)
- Add query filter on DiscoveredStreamUrl for model warning #10622
- Simplify migration retry: call Migrate() directly instead of
GetPendingMigrations()+Migrate() to reduce transient startup noise
Combine Heimdall.Web and Heimdall.Workers into one process/image.
Hangfire background jobs now run inside the web process.
- Move job classes to Infrastructure/Jobs/ (no Worker SDK dependency)
- Add Hangfire server + recurring jobs to Web/Program.cs
- Add missing AddInfrastructure/AddApplication DI registrations to Web
- Rename image: heimdall (was heimdall-web / heimdall-workers)
- Remove src/Heimdall.Workers project entirely
- Remove tests/Heimdall.Workers.Tests (placeholder)
- Simplify Dockerfile: single build target, no workers publish
- Update docker-compose files: one service heimdall, no workers
- Update Makefile, .env.example
- Remove redundant antiforgery check from /_auth/signin and
/_auth/signout
(JWT validation is sufficient security; antiforgery tokens
fail silently because the JS caller never includes one)
- Add ILogger structured logging to both endpoints
- Make AuthHelper.SignInAsync return bool so Blazor pages
can detect failure
- Show user-friendly error messages in Login.razor and
Register.razor when cookie creation fails
The self-signed certificate auto-bootstrap for DataProtection key
encryption ran unconditionally, causing integration tests to crash
with CryptographicException (m_safeCertContext is an invalid handle)
when Identity token providers tried to use the certificate encryptor.
The test environment has no /var/lib/heimdall/dp-keys/ directory, and
loading a PFX with empty password is fragile on Linux — the X509
certificate handle becomes invalid.
Wrap the certificate + file persistence code in the same if (isTesting)
guard already used for the DbContext setup. Tests now use ephemeral
DataProtection keys without certificate encryption.
Generates a self-signed X.509 certificate on first run and stores it
alongside DP keys in the persistent volume. Uses ProtectKeysWithCertificate
to encrypt data protection keys at rest. Prevents the 'No XML encryptor
configured' startup warning.
Mounts heimdall_data volume at /var/lib/heimdall for heimdall-web
and heimdall-workers services. Prevents loss of DP keys on container
destroy, which would permanently break credential decryption.
Prevents 'Cannot load library libgssapi_krb5.so.2' error on startup.
Npgsql attempts to load GSSAPI for PostgreSQL authentication; krb5
provides the required shared library on Alpine.
Adds ValueComparer<float[]> with element-by-element comparison and
snapshot copy. Prevents EF Core warning 10620 about collection types
with value converters but no value comparer.
Adds HasQueryFilter for CameraAssignment (→Agent), CameraDiscoveryResult
(→Site), and CameraEvent (→Camera) to match existing pattern.
Prevents EF Core warning 10622 about required ends with global query
filters.
The TimeZoneNotFoundException catch was unconditionally accepting all
values, which made timezone validation a no-op on systems WITH tzdata.
Restore the lazy _hasTzData detection: when tzdata is available, reject
invalid IANA timezone ids; when tzdata is missing, accept all values.
Fixes InvalidTimezone_FailsValidation test.
Previously the API (heimdall-central) and Blazor UI (heimdall-web) ran as
separate containers with the Blazor Server making internal HTTP calls to
the API. This caused the Blazor circuit to disconnect when the API was
unreachable (network error → "Une erreur réseau est survenue").
Now both serve from the same .NET process on the same port:
- All 16 API controllers, ExceptionFilter, and SignalR hubs integrated
into Heimdall.Web
- JWT auth, CORS, rate limiting configured in the unified Program.cs
- Dockerfile.central entrypoint runs web/Heimdall.Web.dll
- docker-compose simplified: heimdall-central service removed
- CI publishes heimdall-web image instead of heimdall-central
Also fixes timezone validation on Alpine/tzdata-less environments
and enables FluentValidation auto-validation in the API project.
Static files are served from /app/wwwroot but the web publish
output is at /app/web/. Copying wwwroot to the expected location
so StaticFileMiddleware can find CSS, JS, and other static assets.
Content root was /app/ but published files are at /app/web/,
causing StaticFileMiddleware to look for wwwroot at /app/wwwroot/
which doesn't exist. Add working_dir to set correct content root.
API keys used by camera agents were missing 'permission' claims,
causing all endpoints with ApiKey + Policy to return 403 Forbidden
(e.g. POST /api/events, POST /api/events/{id}/snapshot).
Add CameraWrite, CameraRead, CameraLive, SiteRead, EventRead
permissions — matching agent operational needs (Supervisor minus
Person permissions).
- First registered user is auto-assigned Admin role (empty DB)
- Add auth.public-registration.enabled setting to disable public
registration (only admins can create users via POST /api/users)
- Add DELETE /api/users/{id} endpoint (Admin only) with guards:
- Cannot delete own account
- Cannot delete the last administrator
- Guard AssignRolesAsync to prevent removing Admin from last admin
- Add AuthSettings constants class for well-known setting keys
- Fix docker-compose.prod.yml: agent image ref
(heimdall-central→heimdall-agent) and env var naming
(HEIMDALL_* → Agent__*)
- Add missing SENTRY_DSN env vars to central, workers,
web, and agent services
- Add agent_state volume for agent identity persistence
- Update README with accurate test counts (34→225),
env var reference table, troubleshooting guide,
and proper docker documentation
- Update docker-compose.yml header and add
Agent__StateDirectory/Agent__RegistrationMaxRetries
Changed BoundedChannelFullMode from DropOldest to DropWrite.
With DropOldest, the oldest queued job is silently removed when the
channel is full, but its TaskCompletionSource is never completed —
causing the caller to hang indefinitely.
DropWrite rejects new writes when full, returning TryWrite=false,
which triggers the existing graceful fallback (tcs.TrySetResult(null)).
The returnUrl query parameter is now validated as a local/relative URL
(starts with '/' and does not contain '://') before being used as a
redirect target after login.
Both Login and Register pages had identical JsRuntime.InvokeVoidAsync calls
with the same anonymous object shape. Extracted to a shared AuthHelper
static class with SignInAsync(IJSRuntime, object) and CreateSignInPayload(UserInfo).
- New file: Services/AuthHelper.cs
- Login.razor and Register.razor now call AuthHelper.SignInAsync
- Pre-existing fix: Person.cs IAuditableEntity setters made public
Define --auth-* variables on .auth-page for all colors, shadows, and
backgrounds. Dark mode now only overrides variables on .auth-page —
zero selector duplication, single source of truth for theme values.
NU1510 fires because System.Threading.Channels is a transitive dependency
of Microsoft.AspNetCore.SignalR.Client but is already part of the
.NET 10 framework. Safe to suppress.
- Disable auth-card entrance animation when user prefers reduced motion
- Disable auth-footer link color transition
- Respects WCAG accessibility guidelines for vestibular disorders
- Light mode: .auth-header p and .auth-footer p #64748b → #475569 (~6.5:1 contrast)
- Dark mode: .auth-header p and .auth-footer p #94a3b8 → #cbd5e1
Both pass WCAG AA and now approach AAA (7:1) for small text readability.