Commit Graph
71 Commits
Author SHA1 Message Date
Arnaud Dartois f800103239 feat: remplacer Gotify par ntfy — push notifications multi-utilisateur avec isolation par topic
- Nouveau NtfyService: topic isolé par user (heimdall_{userId})
- Configuration globale Ntfy:BaseUrl + Ntfy:Token (plus de token par user)
- Renommage UserNotificationConfig: Gotify* → Ntfy*
- Migration des colonnes DB: gotify_enabled/url/token → ntfy_enabled/url
- Ajout service ntfy dans docker-compose (binwiederhier/ntfy)
- Mise à jour .env.example avec NTFY__BASE_URL et NTFY__TOKEN
- Suppression GotifyService et IGotifyService
2026-07-27 04:56:16 +00:00
Arnaud Dartois f9be0f1e0d feat: implémenter SignalR hubs (Monitoring, Notifications, Admin) + système de notifications complet
SignalR Hubs:
- MonitoringHub (/hubs/monitoring) — statuts agents/caméras/stockage/GPU jobs
- NotificationsHub (/hubs/notifications) — notifications in-app badge temps réel
- AdminHub (/hubs/admin) — broadcast changements config (Admin only)

Notification System:
- Nouvelles entités: Notification, NotificationTemplate, UserNotificationConfig
- CQRS/MediatR: 6 handlers (list, unread, mark-read, mark-all, config get/update)
- Infrastructure: NotificationService orchestrator + EmailService + GotifyService
- Rate limiter IMemoryCache (20 events/min/camera/type)
- Hangfire jobs: SendNotification, DailyDigest, WeeklyDigest
- NotificationsController API (6 endpoints)
- Blazor UI: NotificationsPage + NotificationBadge
- Migration AddNotifications (3 nouvelles tables)
- 644 nouveaux tests (Domain: 131, Application: 321, Infra: 151, Integration: 120, +autres)
2026-07-26 20:45:35 +00:00
Arnaud Dartois ef3ea9d1ca fix: resolve 7 code quality issues from audit
- Add CancellationTokenSource timeout to DB migration loop (5 min)
- Make seed admin password configurable via env/config
- Improve ExceptionFilter with typed exception handling (409/499/500)
- Document Hangfire.PostgreSql CS0618 pragma with upgrade link
- Narrow CredentialProtector fallback catch to non-empty ciphertext
- Fix ApiBaseUrl in appsettings.json (:5000 -> :8080) for Docker consistency
- Improve HTTPS reverse proxy comment in middleware config

Build: 0 errors, 0 warnings | Tests: 799/799 passed
2026-07-26 19:49:42 +00:00
Arnaud Dartois 810900cd3e fix(auth): add JWT__RefreshKey config and env var fallback in JwtService
- Add JWT__RefreshKey to .env.example with documentation
- Add JWT__RefreshKey to docker-compose.yml and docker-compose.prod.yml
- Fix JwtService to check both IConfiguration and env vars (JWT__REFRESHKEY)
  for access token key and refresh token key, matching Program.cs pattern
- Fixes 'Jwt:RefreshKey is not configured' 500 error on register/login
2026-07-25 18:02:43 +00:00
Arnaud Dartois 550c621f35 fix(auth): move ConfigureApplicationCookie to Program.cs to override Identity defaults
Move ConfigureApplicationCookie configuration from DependencyInjection.cs
to Program.cs, ensuring it's called AFTER AddAuthentication().AddCookie().
This prevents Identity default paths (/Account/Login) from overriding
custom login paths (/login).
2026-07-24 18:15:56 +00:00
Arnaud Dartois e5fb13632f fix(auth): configure Identity cookie paths to use custom login page
Add ConfigureApplicationCookie to override Identity default paths
(/Account/Login) with custom paths (/login). This fixes the 404 error
when unauthenticated users are redirected to the login page.
2026-07-24 17:55:23 +00:00
Arnaud Dartois 6978d2e9ab fix(cqrs): implement missing auth service interfaces and fix tests
- Create RolePermissionService (delegates to AppPermissions)
- Create AuthSignInService (wraps SignInManager)
- Create AuthDataService (handles settings, first-user, token revocation)
- Register all new services in Infrastructure DI
- Fix AuthDataService RevokedRefreshToken constructor usage
- All 226 tests passing
2026-07-22 20:05:59 +00:00
Arnaud Dartois d67cbd64cc refactor(cqrs): cleanup old service layer, preserve discovery/assignment services for handlers
- Remove 13 old service interfaces from Application/Services
- Remove 13 old service implementations from Infrastructure/Services
- Remove old SnapshotService (no CQRS replacement needed)
- Update Infrastructure DI to register only CQRS-compatible services
- Preserve CameraEventService + PersonService for existing tests
- Clean up duplicate IUserRepository registration
2026-07-22 20:00:49 +00:00
Arnaud Dartois 1d1ac8387e feat(cqrs): update controllers, add AutoMapper profiles, SignalR notifications, Hangfire config
- 13 controllers migrated from service DI to IMediator dispatch
- 11 AutoMapper mapping profiles (Sites, Cameras, Auth, Users, Agents, Events, Assignments, Settings, Groups, Persons, Discovery)
- SignalR notifications bridged via MediatR INotificationHandler
- Hangfire config moved from Program.cs to Infrastructure/BackgroundJobs
- 0 build errors, 0 warnings
2026-07-22 19:54:55 +00:00
Arnaud Dartois 11f7fd8d20 feat(cqrs): migrate Sites, Auth, Users, Cameras to CQRS
- Sites: CreateSite, UpdateSite, DeleteSite, GenerateToken commands + handlers
- Auth: Login, Register, RefreshToken, 2FA, ChangePassword, Logout commands
- Users: CRUD, roles, sites, lock/unlock, reset-password commands + queries
- Cameras: CRUD, SetCredentials commands + queries
- Add IApplicationDbContext abstraction for Clean Architecture
- Add ICredentialProtector, IJwtService interfaces to Application layer
- 0 build errors, 0 warnings
2026-07-22 19:43:13 +00:00
Arnaud Dartois 53e0d4c199 fix: resolve CI test failures after InMemory->Testcontainers migration
Three issues fixed:
- Camera.AssignAgent(Guid.Empty) violated FK constraint; changed to
  nullable Guid? and pass null on camera release
- Test fixtures now check DATABASE_URL env var first, falling back to
  Testcontainers locally (CI has no Docker socket)
- Added database truncation before each test via IAsyncLifetime to
  prevent shared state between test methods (InMemory was fresh per test,
  real PostgreSQL persists data)
2026-07-21 17:46:32 +00:00
Arnaud Dartois 58a3ce5b1b chore: vire toute trace d'InMemory, remplace par Testcontainers PostgreSQL
- Supprime InMemory de tous les .csproj (Infrastructure, Domain.Tests, IntegrationTests)\n- Supprime le branchement Database:Provider=InMemory de DependencyInjection.cs\n  (plus que du PostgreSQL natif)\n- Infrastructure.Tests: CameraAssignment + CameraEvent tests -> Testcontainers\n- PostgreSqlContainerFixture ajoute aux Infrastructure.Tests\n- appsettings.Testing.json: retire Database:Provider et Hangfire:Enabled\n- 4 tests echouent encore: bugs pre-existants masques par InMemory\n  (FK non respectees, donnees de test erronees)\n\nTests: 222/226 passed (4 pre-existants lies aux FK)
2026-07-21 12:19:43 +00:00
Arnaud Dartois 7be5d42e85 fix(identity): DB refresh tokens, auto-refresh handler, 2FA endpoints, JWT fix
- DB-backed RevokedRefreshToken entity + migration (remplace ConcurrentDictionary\n  en memoire, fonctionne en multi-instance et survive aux redemarrages)\n- TokenRefreshHandler: auto-refresh des JWT 401 via DelegatingHandler\n  (avec SemaphoreSlim pour eviter les refresh storms)\n- Fix: GenerateRefreshToken genere maintenant un JWT valide au lieu de\n  bytes aleatoires (ValidateRefreshToken attendait un JWT - flux casse)\n- Fix: Login.razor gere Requires2fa correctement (affiche champ code 2FA)\n- Ajout: endpoints POST /api/auth/2fa/enable et /2fa/disable\n- Ajout: Disable2faAsync dans IAuthService\n- Fix: GenerateTemporaryPassword garantit les 4 categories de charactere\n  (uppercase, lowercase, digit, non-alphanumeric)\n- Fix: TestFactory ajoute Jwt:RefreshKey manquant\n\nBuild: 0 errors, 0 warnings\nTests: 226/226 passed
2026-07-21 08:57:53 +00:00
Arnaud Dartois 940e826865 fix(identity): corrige JWT role claims, password policy, et consistency
- JWT role claims: string.Join -> ClaimTypes.Role individuels (debloque [Authorize(Roles)])\n- Password policy: RequireUppercase=true, RequireNonAlphanumeric=true\n- JWT validation params extraits en methode partagee (anti-duplication)\n- Retours 401 uniformises avec body structure\n- Champ Langue ajoute dans le dialog d'edition utilisateur\n\nBuild: 0 errors, 0 warnings\nTests: 226/226 passed
2026-07-21 08:47:24 +00:00
Arnaud Dartois 81b8e6aacf refactor: replace isTesting hacks with appsettings.Testing.json
The entire 'if (isTesting)' pattern is removed. Instead:
- Add appsettings.Testing.json: Database:Provider=InMemory,
  DataProtection:Mode=Ephemeral, Hangfire:Enabled=false,
  Database:MigrateOnStartup=false
- DependencyInjection reads configuration keys instead of
  environment name
- Program.cs uses Hangfire:Enabled and Database:MigrateOnStartup
  config booleans instead of IsEnvironment("Testing") checks
- Test fixture persists (UseEnvironment + UseSetting for
  unique InMemoryDbName per instance)

No functional change — still 54/61 integration tests passing.
The 7 remaining failures are pre-existing 'expected 401 got 400'
auth middleware differences.
2026-07-21 07:23:33 +00:00
Arnaud Dartois 81da09c110 feat(auth): add structured logging throughout auth module
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.
2026-07-20 20:16:58 +00:00
Arnaud Dartois 34037c20bf fix(dp): keep X509Certificate2 alive for DataProtection key ring
- 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
2026-07-20 19:58:32 +00:00
Arnaud Dartois 630e7987fe refactor(docker): merge worker and web into single heimdall image
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
2026-07-20 17:22:56 +00:00
Arnaud Dartois c8c93e3d87 fix(dp): guard data protection certificate bootstrap with isTesting check
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.
2026-07-20 15:44:20 +00:00
Arnaud Dartois 8278c75cf4 fix(dp): auto-bootstrap self-signed certificate for data protection key 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.
2026-07-20 14:07:27 +00:00
Arnaud Dartois e74995f088 fix(db): add value comparer for KnownFace.Embedding float array
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.
2026-07-20 14:03:40 +00:00
Arnaud Dartois 262d13ee0c fix(db): add matching query filters for required navigations to soft-deletable entities
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.
2026-07-20 14:02:07 +00:00
Arnaud Dartois 892ca88de8 fix(efcore): adopt SaveChangesWithRetryAsync across all infrastructure services 2026-07-20 10:15:39 +00:00
Arnaud Dartois 8dedee5d86 perf(infra): replace .Result with await after Task.WhenAll in camera discovery 2026-07-20 10:13:51 +00:00
Arnaud Dartois a33a436c26 chore: apply auto-fixes and code improvements
- AuthService: fix public registration logic revert
- JwtService: add ILogger dependency
- SoftDeleteInterceptor removed (merged)
- XML doc comments on all services
- Error boundary + error page in Blazor
- Optimize StatsService queries
- ApiClient error handling improvements
2026-07-20 09:50:43 +00:00
Arnaud Dartois ba968a5f23 fix(security): harden Docker, CSRF, EventsHub scoping, secret logging, tests
- Docker: remove default passwords from prod compose (required env vars)
- CSRF: validate antiforgery tokens on /_auth/signin and /_auth/signout
- EventsHub: broadcast to site-scoped Group() instead of Clients.All
- SettingsController: redact secret values in logs
- Create SetAgentSettingValidator + UpdateAppSettingValidator classes
- Replace 3 placeholder test projects with meaningful tests
- Remove FluentValidation auto-validation (incompatible with .NET 10)
2026-07-19 20:53:48 +00:00
Arnaud Dartois 153be535d4 fix(multiple): auth, workers, EF Core, MudTheme fixes
- Auth: AssignmentsController auth bug, ReleaseCamera result, logout endpoint
- Security: open redirect fix
- Workers: AgentState thread-safety, CameraStreamService async, HttpClientFactory
- EF Core: AddCameraDiscoveryFields migration, DI interceptors, retry helper
- UI: MudTheme palette config, aria-labels on icon buttons
2026-07-19 19:58:45 +00:00
Arnaud Dartois 4b83e35df0 fix(infra): persist Data Protection keys for Docker resilience
- Add PersistKeysToFileSystem with SetApplicationName so camera
  credential decryption survives container restarts
- Move connection string resolution inside else block to fix
  integration tests (was evaluating connection string eagerly
  before Testing environment check)
- Remove hardcoded connection string fallback, throw instead
- Add Microsoft.AspNetCore.DataProtection.Extensions dependency
2026-07-19 19:34:58 +00:00
Arnaud Dartois 32025eae67 fix(infra): persist Data Protection keys to filesystem for Docker
- Add PersistKeysToFileSystem to /var/lib/heimdall/dp-keys so camera
  credential decryption survives container restarts
- Remove hardcoded connection string fallback, throw instead
- Add Microsoft.AspNetCore.DataProtection.Extensions dependency
2026-07-19 19:33:10 +00:00
Arnaud Dartois a6f37b8e9d fix(auth): add permission claims to ApiKeyAuthenticationHandler
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).
2026-07-19 16:46:32 +00:00
Arnaud Dartois a50a567f8c feat(auth): improve authentication security rules
- 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
2026-07-19 16:39:35 +00:00
Arnaud Dartois d9f5224e21 fix: resolve review findings — SignalR JWT, enum serialization, TCS leak, thread safety 2026-07-19 15:54:13 +00:00
Arnaud Dartois 70176124cb refactor(css): merge duplicate dark mode media blocks into one
- Single @media (prefers-color-scheme: dark) block containing both
  auth-specific rules and general (body, blazor-error-ui) rules
- Removes duplicate @media query, simplifies maintenance
2026-07-19 15:49:46 +00:00
Arnaud Dartois 129a6148f5 feat(persons): add person manager with known face registry and CRUD API 2026-07-19 15:28:38 +00:00
Arnaud Dartois c5728fa810 feat(events): add SignalR real-time event broadcasting to web UI 2026-07-19 15:24:52 +00:00
Arnaud Dartois 76b261378c fix: resolve review findings — thread safety, N+1, DTO layering, sentry, S3 retry 2026-07-19 13:43:48 +00:00
Arnaud Dartois 8ac8baf20a feat(storage): add S3 snapshot service and comprehensive tests for phases 2-3
Adds S3-compatible snapshot storage (Alarik) with AWS Signature V4,
upload, thumbnail, and delete operations. Backfills Phase 2 & 3 with
27 new tests covering camera assignment strategies, event CRUD with
filtering, snapshot attachment, and API contract validation.

- SnapshotService with S3 REST API via HttpClient + SigV4 signing
- 10 unit tests for CameraAssignmentService (assign, release, failover, history)
- 9 unit tests for CameraEventService (create, query, filter, delete, snapshot)
- 8 integration tests for AssignmentsController + EventsController
- SnapshotService registration with 5-min timeout HTTP client
2026-07-19 13:14:05 +00:00
Arnaud Dartois 358443ff1a feat(events): implement camera event pipeline with AI detection storage
Adds the foundation for AI-powered detection events storage, query,
and snapshot management. Agents can POST detection events (motion,
person, vehicle, face, etc.) with confidence scores and metadata;
users can query, filter, and view event history.

- CameraEvent entity with EF Core configuration + migration
- ICameraEventService / CameraEventService with paged query + filters
- EventsController: 5 REST endpoints (create, get, query, attach snapshot, delete)
- Agent-side CameraStreamService: FFmpeg-based RTSP frame capture (foundation)
- Supports both ApiKey (agent) and JWT (user) authentication
2026-07-19 12:55:05 +00:00
Arnaud Dartois 159da2ca26 feat(assign): implement camera-to-agent assignment with failover and strategy support
Multi-agent sites need automatic camera distribution, failover when
an agent goes offline, and rebalancing when new agents join.

Adds CameraAssignment entity with audit trail, 4 assignment strategies
(RoundRobin, GpuPriority, LeastCameras, Failover), a Hangfire failover
job that checks for stale heartbeats every 60s, a discovery coordinator
for leader election, 6 REST endpoints, EF migration, and DI registration.
2026-07-19 12:20:07 +00:00
Arnaud Dartois 2152fca3c6 feat(discovery): implement camera detection and dedup pipeline
Manual camera configuration does not scale beyond a few devices.
Automated discovery is needed to support deployments with 50+
cameras across heterogeneous protocols (ONVIF, mDNS, HTTP, ARP).

Phase 1 introduces 5 network probe services, a stream tester, an
orchestrating discovery service with IP+MAC deduplication, 11 REST
endpoints, a pre-verification endpoint, 57 tests, and DI registration.
2026-07-19 12:00:16 +00:00
Arnaud Dartois 31f2056d48 feat(agents): add global agents page, reusable components, KPIs, admin-only security 2026-07-19 07:25:27 +00:00
Arnaud Dartois 57b51f403c feat(web): add profile, roles, groups and claims pages 2026-07-19 06:49:17 +00:00
Arnaud Dartois 7e66bb4fbb feat(discovery): add camera detection pipeline inspired by Strix
Add complete camera discovery and stream testing specification,
Domain entities, enums, DTOs, Application interfaces, and EF Core
configurations for automated ONVIF/mDNS/HTTP/ARP camera detection.

- 4 new enums: CameraDiscoveryMethod, DetectedCameraType,
  StreamProtocol, CameraCapability (flags)
- Camera entity extended with 15+ discovery/test fields
- New entities: CameraDiscoveryResult, DiscoveredStreamUrl
- DTOs: ProbeRequest/Response, StreamTestRequest/Session, etc.
- Interface: ICameraDiscoveryService (8 methods)
- EF Core configurations for all new tables + columns
- Full spec doc: docs/specifications/detection-camera.md (16 sections)
- 145 tests pass, 0 warnings

Inspiré de Strix (github.com/eduard256/Strix) — moteur de
découverte de flux IP supportant 3600+ marques, 100K+ patterns.
2026-07-18 21:15:05 +00:00
Arnaud Dartois fdfd506977 fix: resolve GlitchTip anomalies — DB retry, query filters, Sentry DSN, Workers tracking
- 🔴 Fix startup crash when DB is temporarily unavailable: add 5x retry
  with exponential backoff to Database.MigrateAsync() in API and Workers
- 🔴 Fix EF Core 'required navigation with query filter' warnings:
  add matching soft-delete query filters to AgentSetting, CameraCredentials,
  CameraDetectionProfile, UserSite
- 🔴 Add Sentry error tracking to Workers (Hangfire background jobs)
- 🟡 Make Sentry/GlitchTip DSN configurable via SENTRY_DSN env var
  (applies to API, Web, Agent, Workers)
- 🟡 Suppress EF Core RedundantIndexRemoved informational messages

Closes GlitchTip #538
2026-07-18 20:31:37 +00:00
Arnaud Dartois abf8162824 fix(db): fix index filter casing in all migration snapshots
Fix the filtered index column name casing in ALL .Designer.cs files
and AppDbContextModelSnapshot.cs:
  - "status" → "Status" (Agent.LastHeartbeat index)
  - "is_deleted" → "IsDeleted" (Site.IsDeleted index)

These must match the actual column names (PascalCase) since
PostgreSQL quoted identifiers are case-sensitive.

Also fix the InitialCreate migration .cs file directly.
All 10 references across 5 snapshot files corrected.
2026-07-18 20:11:19 +00:00
Arnaud Dartois 3978f64f93 fix(workers): use IDbContextFactory for HeartbeatMonitorJob thread safety
Pattern #4 from cross-project learning analysis: HeartbeatMonitorJob
injected AppDbContext directly (not thread-safe). Changed to
IDbContextFactory<AppDbContext> + registered factory in DI.

Other patterns verified already in place:
- CancellationToken on all async methods ✅ (100% controller adoption)
- N+1 per-entity loops ✅ (all services use bulk-loading)
- AsNoTracking ✅ (explicit on read-only queries)
- Global QueryTrackingBehavior.NoTracking deferred: safe for
  new projects but requires write-path audit on existing codebase
2026-07-18 20:05:22 +00:00
Arnaud Dartois 0f22a60fbc fix(db): correct Site index filter column casing ("is_deleted" → "IsDeleted")
The filtered index IX_sites_IsDeleted uses a WHERE clause
referencing "is_deleted" (lowercase underscore) but the column
is "IsDeleted" (PascalCase). PostgreSQL quoted identifiers are
case-sensitive, causing Npgsql.PostgresException on migration.

Fixes remaining HEIMDALL issues on GlitchTip.
2026-07-18 20:01:31 +00:00
Arnaud Dartois ba9678f192 fix(db): correct Agent index filter column casing ("status" → "Status")
The filtered index IX_agents_LastHeartbeat uses a WHERE clause
referencing "status" (lowercase) but the column is "Status"
(PascalCase). PostgreSQL quoted identifiers are case-sensitive,
causing Npgsql.PostgresException 42703 on migration.

Fixes HEIMDALL-2 on GlitchTip.
2026-07-18 19:59:07 +00:00
Arnaud Dartois cb1e4d61b8 fix(db): migrate DB inline before seeding to prevent startup crash
Replace the background MigrationHostedService with inline
db.Database.MigrateAsync() before Identity role seeding. The
IHostedService started after app.Run(), but seeding ran synchronously
before app.Run() — causing 42P01 when RoleManager queried the roles
table that didn't exist yet.

- Add await db.Database.MigrateAsync() with 120s timeout before seeding
- Add structured logging (ILogger) and error handling around migration
- Remove MigrationHostedService.cs (dead code — inline migration makes
  it permanently no-op)
- Remove unused using Heimdall.Infrastructure.Services
- Unify using style (using var instead of using block)
2026-07-18 19:28:16 +00:00
Arnaud Dartois cca6ab6f46 feat(mvp): agent settings UI + migration orchestrator
Agent settings UI:
- Add settings section to AgentDetail page showing per-agent overrides
- Add/edit/delete agent settings with confirmation dialogs
- Add settings API methods + DTOs to HeimdallApiClient
- Real-time SignalR notification shown in UI feedback

Migration orchestrator:
- Replace inline db.Database.Migrate() with MigrationHostedService
- Runs migrations in background at startup (non-blocking)
- 60-second timeout with critical logging on failure
- Preserves Testing environment exclusion
- Clear migration progress logging
2026-07-18 19:07:01 +00:00