Commit Graph
34 Commits
Author SHA1 Message Date
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 0d2f0574c9 feat(ui): add snapshot gallery with lightbox and search filter 2026-07-19 15:19:33 +00:00
Arnaud Dartois 2d65f273c6 feat(ui): enrich dashboard with event data, camera status, and agent workload 2026-07-19 13:30:03 +00:00
Arnaud Dartois add9ebf462 feat(ui): add events page and event timeline on camera detail 2026-07-19 13:21:25 +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 9113191547 feat(ui): modernize all pages — auto-refresh, skeleton loading, tooltips, filters 2026-07-19 07:12:40 +00:00
Arnaud Dartois 2ff355e567 feat(auth): add default groups, claims-based authorization and update spec 2026-07-19 07:04:25 +00:00
Arnaud Dartois 57b51f403c feat(web): add profile, roles, groups and claims pages 2026-07-19 06:49:17 +00:00
Arnaud Dartois 3056452b9e fix(web): repair design on users page, settings page and audit logs 2026-07-19 06:34:32 +00:00
Arnaud Dartois ca693a2ed0 fix(web): repair home page design — invalid CSS, dead code, missing form wrappers 2026-07-19 06:28:13 +00:00
Arnaud Dartois 8c6b2610a0 fix(web): register HeimdallAuthStateProvider concrete type in DI
The service was registered only as AuthenticationStateProvider (base class),
but Login.razor, Register.razor, and MainLayout.razor inject the concrete
@inject HeimdallAuthStateProvider. Blazor's DI could not resolve it,
causing InvalidOperationException on page render.

Fix: register the concrete type first, then make the base class
registration resolve to the same instance via GetRequiredService.
2026-07-18 21:08:08 +00:00
Arnaud Dartois 39f08e39ed fix(web): add cookie authentication to fix IAuthenticationService missing error 2026-07-18 20:59:38 +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 cc52214404 feat: add Sentry (GlitchTip) client to Api, Agent, Web
Add Sentry.AspNetCore v6.7.0 with hardcoded DSN constant
(not overridable by env) pointing to GlitchTip instance at
https://glitchtip.tordais.cc/6.

Same DSN configured across all three entry-point projects:
- Heimdall.Api
- Heimdall.Agent
- Heimdall.Web
2026-07-18 19:41:57 +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
Arnaud Dartois c2837af089 feat(mvp): complete MVP hardening — API, Web, config system, SignalR, tests 2026-07-18 18:58:20 +00:00
Arnaud Dartois 12a1ff2737 fix(ui): implement token generation in SitesPage.CopyToken
Replaces the no-op CopyToken method with actual API call.
Adds a dialog showing the generated token with expiry warning.
2026-07-17 20:04:52 +00:00
Arnaud Dartois 20e2a235ad chore: remove stale NavMenu.razor template boilerplate
NavMenu.razor contained Counter/Weather links from the default Blazor
template and was never used (MainLayout.razor has its own navigation).
Removed the associated scoped CSS file to fix BLAZOR102 build error.
2026-07-17 19:26:27 +00:00
Arnaud Dartois 015711e156 fix(build): keep UseAppHost=false global for Alpine compatibility
Reverts per-project scoping from previous commit — Alpine build env
needs this globally because even Debug mode tries to create a native
host. The 4 Docker-published projects also inherit it from the global
Directory.Build.props.

Proper long-term fix: build CI on non-Alpine image, or set
UseAppHost=false only in Dockerfile publish args via /p flag.
2026-07-17 19:24:00 +00:00
Arnaud Dartois 3060f38979 fix(build): scope UseAppHost=false to Docker-published projects in Release only
The Alpine workaround was applied globally via Directory.Build.props,
preventing native host generation even for local dev builds. Moved to
only the 4 Docker-published projects (Api, Web, Workers, Agent) with
Condition='==Release'. Dev builds still get native
executables.
2026-07-17 19:22:05 +00:00
Arnaud Dartois 8c7ec4d279 feat(ui): pages détail Caméra + Agent
- CameraDetail: vue modifiable (nom, RTSP), infos fabricant/modèle/statut
- AgentDetail: infos hostname/version/heartbeat + capacités CPU/GPU/mémoire
- CamerasPage: nom cliquable vers le détail
- AgentsPage: nom cliquable vers le détail
- ApiClient: GetCameraAsync, UpdateCameraAsync, GetAgentAsync
2026-07-17 19:08:17 +00:00
Arnaud Dartois b816446f72 feat(audit): journal d'audit consultable dans l'UI
- IAuditLogService + AuditLogService avec pagination et filtres
- AuditLogsController: GET /api/audit-logs (resourceType, action, page)
- AuditLogsPage Blazor: liste paginée avec filtres + coloration par action
- Lien vers le journal dans le menu Admin (visible pour les Admins)
2026-07-17 18:14:41 +00:00
Arnaud Dartois c6450ad50d feat(api): dedicated /api/stats endpoint
- StatsController: aggregates sites, cameras, agents counts in one DB query
- Dashboard: now uses stats endpoint (2 API calls instead of N*2+1)
- ApiClient: GetStatsAsync + StatsResult DTO
2026-07-17 17:22:33 +00:00
Arnaud Dartois 1fd3f8f003 feat(dashboard): real stats with parallel API calls
- Dashboard now shows: total sites, total cameras, online agents, active sites
- Stats loaded in parallel with Task.WhenAll for performance
- Falls back gracefully if cameras/agents endpoints return no data
2026-07-17 15:10:14 +00:00
Arnaud Dartois 3be0993fb5 feat(ui): multi-role selection with checkboxes
- Users: replace single MudSelect role picker with MudCheckBox multi-select
- Users: users can now have multiple roles (Admin + Supervisor, etc.)
- Users: edit dialog validates at least one role is selected
- Build: suppress MudBlazor analyzer MUD0002 (false positive on Checked bind)
2026-07-17 13:26:15 +00:00
Arnaud Dartois cb855f83b8 feat(ui): login redirect + configurable API URL
- Login: redirect to original page after auth via returnUrl query param
- RedirectToLogin: encodes current URL as ?returnUrl=/path
- API URL: configurable via appsettings.json ApiBaseUrl or API_BASE_URL env
- NotFound page: preserved from template
2026-07-17 13:22:02 +00:00
Arnaud Dartois da123ec544 fix(tests): InMemory DB isolation + refactor test helpers
- Fix: InMemory database name now unique per test factory instance
  (was using process-wide env var, now per-host config via UseSetting)
- Refactor: all integration tests use shared TestHelpers.CreateAdminClientAsync
- New: register-admin endpoint (test/dev only) creates Admin users directly
- New: TestHelpers.cs with extension method for admin client creation
- Cleanup: removed bootstrap template files, old Counter/Weather pages
- Cleanup: simplified app.css with MudBlazor-only styles
- Seed: demo admin + demo site created in Development mode
2026-07-17 13:15:25 +00:00
Arnaud Dartois 129bcfa9d7 feat(ui): Blazor auth redirect + CascadingAuthenticationState
- Routes: wrap with CascadingAuthenticationState + AuthorizeRouteView
- RedirectToLogin: component that redirects unauthenticated users to /login
- HeimdallAuthStateProvider: NotifyLogin/NotifyLogout methods
- Login/Register/MainLayout: use AuthStateProvider.NotifyLogin/Logout
  instead of direct AuthState mutation (triggers Blazor auth cascade)
- _Imports: add Microsoft.AspNetCore.Components.Authorization
2026-07-17 07:05:07 +00:00
Arnaud Dartois d4a86b8c7f feat(mvp): docker-compose snippet in UI, agent flow tests
- Site detail: generate registration token with copy/paste docker-compose snippet
- Docker snippet: pre-filled with token + agent hostname, ready to copy
- Agents integration tests: register with valid token, heartbeat with API key,
  invalid token rejection (3 new tests)
- TokenResult DTO for API client
- IJSRuntime clipboard copy for docker-compose snippet
2026-07-17 07:00:58 +00:00
Arnaud Dartois 2ea82504d7 feat(mvp): rate limiting, agents page, site detail navigation
- Rate limiting: Microsoft.AspNetCore.RateLimiting AddFixedWindowLimiter
  (Auth: 10 req/min, Api: 200 req/min, returns 429 when exceeded)
- Agents Blazor: new page listing agents per site with status/heartbeat
- Site detail: camera and agent navigation cards
- ApiClient: GetAgentsBySiteAsync, AgentItem DTO
- Removed custom middleware (replaced by proper built-in rate limiter)
2026-07-17 06:57:00 +00:00
Arnaud Dartois dfc888db94 feat(mvp): agent auth, cameras UI, rate limiting attempt
- Agent: fix heartbeat auth — set API Key header after registration
- Cameras Blazor: full page with create/delete/list by site
- ApiClient: cameras CRUD endpoints + CameraItem DTO
- Rate limiting: attempted but deferred (System.Threading.RateLimiting package issue)
- Security: refresh token rotation now enforced server-side
2026-07-17 06:30:09 +00:00
Arnaud Dartois 38816aec8a feat(mvp): complete Blazor UI + User Management + integration tests 2026-07-16 21:19:16 +00:00
Arnaud Dartois b217c932e8 feat(mvp): implement MVP multi-site platform
Complete MVP implementation (Étape 1) covering:
- Domain: primitives (Entity<TId>, ValueObject), 10 entities, 6 enums
- EF Core: AppDbContext + Identity, 8 EntityTypeConfigurations, audit/soft-delete interceptors, initial migration
- Application: service interfaces, DTOs, FluentValidation, ServiceResult pattern
- Security: Identity + JWT + API Key multi-auth, role-based permissions, constant-time key validation
- API: Auth/Sites/Agents controllers with explicit auth scheme policies
- Workers: Hangfire PostgreSQL setup with schema isolation, HeartbeatMonitorJob
- Agent: registration service + 30s heartbeat loop
- Docker: multi-stage Dockerfiles for central + agent, docker-compose.yml
- CI/CD: GitHub Actions pipeline with build+test and Docker build
- Tests: 13 domain tests (Site, Agent, Camera entities)

Architecture decisions per deliberation council:
- API Key via AuthenticationHandler<T> (not middleware)
- Explicit [Authorize(AuthenticationSchemes)] on all endpoints
- Event/Recording/Person/Vehicle deferred from initial migration
- Hangfire compatible with .NET 10 (v1.8.17)
2026-07-16 20:53:56 +00:00
Arnaud Dartois bfb3e06bc1 feat: initialize .NET 10 Clean Architecture solution
Create Heimdall solution with 17 projects following Clean
Architecture for a maintainable and loosely coupled codebase.

src/ (9 projects):
- Domain, Domain.Primitives, Contracts (core layer, no deps)
- Application (ref. Domain) — CQRS/MediatR ready
- Infrastructure (ref. Application + Domain) — EF Core
  PostgreSQL ready
- Api, Web (Blazor), Agent, Workers (hosts, ref. Application +
  Infrastructure)

tests/ (8 projects):
- xUnit + Shouldly + NSubstitute + bUnit (Web.Tests)
- One test project per source project (Domain -> IntegrationTests)

Config: Directory.Build.props (Nullable, ImplicitUsings,
TreatWarningsAsErrors)
2026-07-16 19:09:28 +00:00