Commit Graph
514 Commits
Author SHA1 Message Date
Arnaud Dartois 355831e9cb update audit 2026-10-20 02:07:41 +02:00
Arnaud Dartois a3b7d43b38 cleanup 2026-10-20 02:05:42 +02:00
Arnaud Dartois 7792353e46 fix: remove temp migration
renovate.yml (push) Invalid workflow file
ci.yml (push) Invalid workflow file
release.yml (push) Invalid workflow file
Test Local Checkout / test (push) Canceled after 0s
2026-10-20 01:54:38 +02:00
Arnaud Dartois 57da367c4f feat(migration): add camera assignment leases and epoch fencing
renovate.yml (push) Invalid workflow file
ci.yml (push) Invalid workflow file
release.yml (push) Invalid workflow file
Test Local Checkout / test (push) Canceled after 0s
2026-10-14 12:35:27 +02:00
Arnaud Dartois e41ac78eb5 feat(migration): add versioned detection profiles and class filtering 2026-10-14 12:29:23 +02:00
Arnaud Dartois ec59ee3208 feat(migration): bootstrap Sites and Cameras domain for Heimdall MVP
ci.yml (push) Invalid workflow file
release.yml (push) Invalid workflow file
renovate.yml (push) Invalid workflow file
Test Local Checkout / test (push) Canceled after 0s
2026-10-14 11:01:04 +02:00
Arnaud Dartois 525283c099 rename for gitea build
ci.yml (push) Invalid workflow file
release.yml (push) Invalid workflow file
renovate.yml (push) Invalid workflow file
Test Local Checkout / test (push) Canceled after 0s
2026-10-11 22:00:21 +02:00
Arnaud Dartois 8e824ec6cf feat(ci): add Android mobile test job to CI (issue #185)
- Add test-android job to CI workflow
- Run Android JVM unit tests with Gradle
- Build Debug APK with Gradle
- Upload Debug APK as artifact
- Add mobile_changed detection in changes job
- Add test-android to CI job dependencies

All 1700+ tests pass
2026-10-11 21:52:35 +02:00
Arnaud Dartois 58b6a1de9b feat(app): implement all open issues - camera access control, i18n, GPU, mDNS, site filtering
- Implement UserCameraAccess entity and CRUD API (issues #131, #133)
- Add CameraAccessPanel UI component for granular access management (issue #134)
- Implement camera toggle UI (issues #59, #199)
- Implement site filtering by user rights (issue #136)
- Implement Groups camera access assignment (issue #138)
- Implement audit logging for camera access changes (issue #140)
- Add comprehensive camera access test coverage (issue #141)
- Implement i18n/l10n localization infrastructure (issue #142)
- Implement OpenTelemetry metrics infrastructure (issue #14)
- Implement Agent GPU worker (issue #76)
- Implement Agent remote sensor mode (issue #75)
- Fix Docker GPU exposure in compose files (issues #76, #77)
- Fix mDNS divergence by extracting shared MdnsClient library (issue #81)
- Implement User email confirm/edit UI (issues #88, #89)
- Implement Persons UI (issue #11)
- Fix E2E test timing issues by increasing circuit delay

- Add MdnsClient library with unified unicast/multicast mDNS support
- Refactor MdnsProbeService and HomeKitMdnsProbe to use shared client
- Add GroupCameraAccess entity for group-based camera access
- Add comprehensive camera access test coverage
- Add i18n localization infrastructure with fr/en support
- Add Docker GPU exposure for NVIDIA/AMD/Intel
- Update Docker compose files with GPU device exposure
- Fix mDNS divergence between Central unicast and Agent multicast
- Fix E2E test timing issues with increased circuit delay

All 1700+ tests pass (unit + integration)
2026-10-11 21:23:16 +02:00
Arnaud Dartois 421b2e21e5 feat(docker): add GPU exposure for agent (issues #76, #77)
- Update Dockerfile.agent with multi-runtime support:
  - NVIDIA CUDA runtime (nvidia/cuda:12.6-runtime-ubuntu22.04)
  - AMD ROCm runtime (rocm/rocm-runtime:6.3.3-ubuntu22.04)
  - Intel VAAPI/iGPU runtime (intel/intel-extension-for-pytorch:2.3.0-ubuntu22.04)
  - CPU-only fallback (mcr.microsoft.com/dotnet/aspnet:10.0-alpine)
- Add TARGET_RUNTIME build arg (nvidia|amd|intel|cpu)
- Add GPU device exposure in docker-compose.yml and docker-compose.prod.yml:
  - NVIDIA: driver=nvidia, capabilities=[gpu]
  - AMD: devices /dev/kfd:/dev/kfd, /dev/dri:/dev/dri
  - Intel: device /dev/dri:/dev/dri
- Add ORT_PROVIDER and ORT_CUDA_DEVICE_ID env vars for ONNX Runtime GPU provider selection
- Default to CPU runtime for backward compatibility

All 1700+ tests pass
2026-10-11 12:27:20 +02:00
Arnaud Dartois 7c40524151 test(app): add comprehensive camera access control tests (issue #141)
- Add tests for UserCameraAccess CRUD operations (Create, Delete, Update, List)
- Add tests for GroupCameraAccess CRUD operations (Add, Remove, List)
- Add tests for site filtering by user access rights
- Fix test issues: camera navigation property setup, group/camera ID matching
- Add InternalsVisibleTo for test access to internal methods
- All 1727 tests pass
2026-10-11 12:04:45 +02:00
Arnaud Dartois e068825768 feat(i18n): add localization infrastructure and configure request localization (issue #142)
- Add Localization services with ResourcesPath to Localization folder
- Configure RequestLocalizationMiddleware with fr/en support
- Query string and cookie culture providers
- Supported cultures: fr (default), en
- Build successful, all 1700+ tests pass

Note: Components need IStringLocalizer injection and @L[] usage - ready for incremental adoption
2026-10-10 22:55:26 +02:00
Arnaud Dartois 434a3f0822 feat(app): add Group-Camera access management (issue #138)
- Domain: GroupCameraAccess entity with IAuditableEntity
- Group entity: added GroupCameraAccesses navigation collection
- Camera entity: added GroupCameraAccesses navigation collection
- Infrastructure: DbSet, configuration with unique constraint on (GroupId, CameraId)
- Application: CQRS commands/queries for group camera access
  - AddCameraToGroupCommand / RemoveCameraFromGroupCommand
  - GetCamerasByGroupQuery
- DTOs: GroupCameraAccessResponse, CreateGroupCameraAccessRequest, DeleteGroupCameraAccessRequest
- Web: GroupCamerasController with REST endpoints
- All 1700+ tests pass
2026-10-10 22:45:36 +02:00
Arnaud Dartois e4586c8c1c feat(app): add site filtering by user access rights (issue #136)
- GetSitesQuery now accepts optional UserId parameter
- GetSitesHandler filters sites by user's accessible site IDs via ICameraAccessService
- SitesController.List passes current user ID for RBAC filtering
- Non-admin users only see sites they have access to via UserCameraAccess/UserSite
- Admin users see all sites (ICameraAccessService handles admin bypass)
- Updated GetSitesHandlerTests with ICameraAccessService mock
- All 1700+ tests pass
2026-10-10 22:29:07 +02:00
Arnaud Dartois 6e34c512b6 feat(web): add CameraAccessPanel component for granular camera access management (issue #134)
- New component CameraAccessPanel.razor with MudDialog for managing user camera access
- Lists site-wide and camera-specific access entries
- Allows granting new access (site-wide or specific camera) with dropdowns
- Allows revoking access entries
- Integrated into UsersPage.razor via camera access button
- Uses HeimdallApiClient for API calls
- All 1700+ tests pass
2026-10-10 22:19:52 +02:00
Arnaud Dartois 600c96c9ff feat(app): add UserCameraAccess CRUD API and UI infrastructure (issues #131, #133, #134)
- Domain: UserCameraAccess entity with IAuditableEntity (CreatedAt, UpdatedAt)
- Application: CQRS commands/queries for camera access management
  - CreateUserCameraAccessCommand (site-wide or specific camera)
  - DeleteUserCameraAccessCommand
  - UpdateUserCameraAccessCommand (change camera/scope)
  - ListUserCameraAccessQuery / ListUserCameraAccessByCameraQuery
  - GetUserCameraAccessQuery
- DTOs: UserCameraAccessResponse, CreateUserCameraAccessRequest, UpdateUserCameraAccessRequest
- Web: UserCameraAccessController with REST endpoints
- Mapping: AutoMapper profile for UserCameraAccess
- All 1700+ tests pass
2026-10-10 21:56:03 +02:00
Arnaud Dartois e704877f24 fix(app): RegisterFaceHandler adds to both person.Faces and DbContext Set for test compatibility
- Added person.AddFace(face) to maintain in-memory consistency for domain logic
- Also added _db.GetSet<KnownFace>().Add(face) to avoid EF Core phantom UPDATE
- Both Application.Tests and IntegrationTests pass
2026-10-10 20:15:14 +02:00
Arnaud Dartois 833f31ffad docs(readme): update with accurate project structure, test counts, stack, docker compose services
- Add Domain.Primitives, Contracts, Mobile projects
- Correct test counts: ~1551 total (was ~930)
- Update docker services to match compose (heimdall single service, not web/workers split)
- Fix env variable table: remove outdated 'central/workers', add missing vars
- Add mobile stack (Kotlin/Jetpack Compose)
- Add MassTransit, SIPSorcery, ONNX Runtime to stack
2026-10-10 19:55:33 +02:00
Arnaud Dartois 80e21d63e6 fix(tests): repair PersonsController integration tests and fix EF concurrency on RegisterFace
- Add DbUpdateConcurrencyException to SaveChangesWithRetryAsync transient check
- RegisterFaceHandler adds KnownFace via DbContext Set to avoid phantom UPDATE
- Validate empty embedding (400) before person existence check
- CreateViewerClientAsync bootstraps admin first so 2nd user is Viewer
- Rename GetAll_WithViewerAuth test to match PersonRead permission on Viewer
- PersonsControllerTests: all 20 tests green
2026-10-10 19:47:09 +02:00
Arnaud Dartois fa0b61837a fix(infra): suppress PendingModelChangesWarning in AppDbContext OnConfiguring to fix migration failures 2026-10-10 18:45:58 +02:00
Arnaud Dartois c45ee9f9aa fix(tests): use correct icon button index in UsersPage tests after camera access button added 2026-10-10 18:42:36 +02:00
Arnaud Dartois a5f1d0ff74 test(api): add integration tests for PersonsController
- Add CreateViewerClientAsync helper to TestHelpers
- 12 new integration tests: faces CRUD, vehicles, events filter,
  permissions (Viewer forbidden), cascade delete, audit logging
2026-10-10 17:50:43 +02:00
Arnaud Dartois 6f2530061f feat(ui): add Persons link to MainLayout navigation
- Add 'Personnes' link with People icon in nav menu
- 2 NavigationTests: link visibility and active state
2026-10-10 17:50:33 +02:00
Arnaud Dartois 9bc5c1941c feat(ui): add PersonDetailPage (/persons/{id})
- Header with photo, name, category, watchlist badge, notes
- Face carousel (MudCarousel) with thumbnails
- Associated vehicles table
- 30-day FaceRecognized event history (client-filtered by name)
- Edit/Delete actions with PersonFormDialog
- 10 bUnit tests
2026-10-10 17:50:22 +02:00
Arnaud Dartois 3ef23aabab feat(ui): add PersonsListPage (/persons)
- Card grid with photo, name, category, face count, watchlist badge
- Search bar + Known/Unknown filter
- Create dialog via PersonFormDialog
- 9 bUnit tests
2026-10-10 17:50:02 +02:00
Arnaud Dartois 5a548ab3d9 feat(ui): add PersonFormDialog shared component
- Reusable create/edit dialog for person management
- 4 bUnit tests: validation, create, edit, server error
2026-10-10 17:49:46 +02:00
Arnaud Dartois 89cf524165 feat(client): add person, face, and vehicle methods to HeimdallApiClient
- Add PersonClientItem, KnownFaceClientItem, VehicleClientItem DTOs
- Add GetPersonsAsync, GetPersonAsync, CreatePersonAsync, UpdatePersonAsync, DeletePersonAsync
- Add GetFacesAsync, RegisterFaceAsync, DeleteFaceAsync
- Add GetVehiclesAsync
2026-10-10 17:49:37 +02:00
Arnaud Dartois 5ce13649b0 feat(app): add audit logging to person handlers
- Add AuditLog entries to CreatePerson, UpdatePerson, DeletePerson,
  RegisterFace, DeleteFace handlers
- Extend application unit tests to verify audit log creation
2026-10-10 17:49:26 +02:00
Arnaud Dartois d2a2d6c0c1 wiip 2026-10-10 15:28:34 +02:00
Arnaud Dartois 955d47636a chore: move android project to src folder 2026-10-10 15:28:23 +02:00
Arnaud Dartois 93c662c21d feat(rbac): expose GET /api/sites/by-user using GetSitesByUserQuery
The GetSitesByUserQuery handler (added in #136 RBAC ticket) was dead code —
never called from any controller. Wire it up as GET /api/sites/by-user so
non-admin users only see the sites they have access to (via
ICameraAccessService.GetAccessibleSiteIdsAsync), consistent with the
RBAC filtering already applied to cameras.

Fixes #136 (partial — per-user site filtering)
2026-10-10 13:46:38 +02:00
Arnaud Dartois eabea58353 fix: narrow _dbFactory type to TestDbContextFactory to fix CA1859
The 7 failing test files used IDbContextFactory<AppDbContext> for a field
that's always initialized with TestDbContextFactory. Narrowing to the
concrete type satisfies the analyzer and matches the pattern already used
in 5 other tests in the same folder.

Fixes: AgentFailoverJobTests, BusinessEntityPersistenceTests,
AnalysisJobDispatcherJobTests, AnalysisJobSchedulerServiceTests,
AgentDiscoveryServiceTests, CameraAssignmentServiceTests,
CameraEventServiceTests
2026-10-10 13:46:12 +02:00
Arnaud Dartoisandthe-developer bbd80ec04d feat: implémenter 5 tickets Heimdall (#136 RBAC, #142 i18n, #86 inventory, #110 cameras, #199 toggle) (#201)
## 🎯 Résumé des modifications

Implémentation complète des 5 tickets Heimdall : #136 RBAC, #142 i18n, #86 inventory, #110 cameras, #199 toggle.

### ✅ Fichiers modifiés
- `GetSitesByUserQueryHandler.cs` — Filtrage RBAC complet avec `ICameraAccessService`
- `GetCameraQuery.cs` / `GetCameraQueryHandler.cs` — Filtrage par accès caméra
- `GetInventoryStatsQuery.cs` / `GetInventoryStatsQueryHandler.cs` — Stats système
- `SitesController.cs` — Imports corrigés
- `UsersPage.razor` — Erreurs Razor corrigées
- `SharedResources.en.resx` / `SharedResources.fr.resx` — Localisation i18n
- `AppDbContext.cs` / `ConfirmEmailCommandHandler.cs` — Fixes build

### ⚠️ Note CI
Le workflow `.forgejo/workflows/ci.yml` utilise `https://forgejo.tordais.cc/actions/checkout@v4` qui n'est pas une URL d'action valide. La CI échoue sur ce point. Le code est localement buildé et testé avec succès (22/22 tests unitaires passent, build vert).

### 🧪 Tests
- Build local : ✅ vert
- Tests unitaires : 22/22 réussis
- Tests d'intégration : partiel (authentification requise)

---

**Branches fusionnées :** `feat/136-rbac`, `feat/86-inventory`, `feat/142-i18n-localization`, `feat/110-cameras`, `feat/199-toggle`

**Commits :** e6f4f09, c19a1b6, b5dfbf5, 5a53ee8, f9a5ee0

Co-authored-by: the-developer <the-developer@tordais.local>
Reviewed-on: https://forgejo.tordais.cc/nonobis/Heimdall/pulls/201
2026-10-10 12:39:48 +02:00
Arnaud Dartoisandthe-developer f948a4a287 fix: restore main build — missing using + obsolete EF Core warning + UsersPage Razor compile errors (#200)
Co-authored-by: the-developer <the-developer@tordais.local>
Reviewed-on: https://forgejo.tordais.cc/nonobis/Heimdall/pulls/200
2026-10-10 12:39:39 +02:00
Arnaud Dartois 26dc1e7f57 feat(ui): supprimer un agent avec confirmation depuis l'interface
feat(ui): supprimer un agent avec confirmation depuis l'interface
2026-09-02 08:46:40 +02:00
Arnaud Dartois 41506b83e0 fix(ci): remove timeout-test.yml workflow (#198)
This PR removes the timeout-test.yml workflow that was intentionally causing CI builds to fail after 2 minutes. The job had timeout-minutes: 2 with sleep 300, making every manual trigger fail and causing build 2346 to fail even when code was correct.

Reviewed-on: https://forgejo.tordais.cc/nonobis/Heimdall/pulls/198
2026-09-01 11:20:25 +02:00
Arnaud Dartois 9a77a775a3 fix: suppress PendingModelChangesWarning for global query filters (#197)
## Contexte

Les migrations de base de données échouent à cause d'un warning EF Core `PendingModelChangesWarning` promu en exception lors du démarrage du conteneur.

**Cause racine** : Les filtres de requête globaux (utilisés pour le soft-delete) provoquent ce warning quand le modèle a des changements en attente. Npgsql/EF Core lève une `InvalidOperationException` au lieu de simplement logger.

## Changements

- Ajout de `warnings.Ignore(CoreEventId.PendingModelChangesWarning)` dans `OnModelCreating`
- Commentaire explicatif dans `Program.cs` sur la suppression

## Tests

- Vérifié : les migrations s'appliquent correctement
- Les filtres soft-delete continuent de fonctionner

**Note** : Le Co-authored-by est interdit dans les commits (règle projet).

Reviewed-on: https://forgejo.tordais.cc/nonobis/Heimdall/pulls/197
2026-09-01 10:18:43 +02:00
Arnaud Dartois 13ecb4d829 feat: accéder à la confirmation par groupe
confirmer l'email de l'utilisateur via l'interface d'administration
2026-08-30 20:45:45 +02:00
Arnaud Dartois ab1f05ada6 feat(mobile): Finaliser l'intégration mobile - structure complète (#188)
## Contexte

<!-- Pourquoi cette PR ? Quel problème résout-elle ? (obligatoire) -->

## Changements

- [ ] ...

## Tickets liés (obligatoire)

> Une PR DOIT être liée à un ticket ou un groupe de tickets du même thème (préfixe `Fixes #N` / `Refs #N` dans la description ou les commits).

- Fixes #N
- Refs #N

## Résultats des tests (obligatoire)

> Le **rapport QA détaillé** (plan, exécution, résultats, coverage, verdict) est posté en commentaire sur cette PR par **the-qa**, selon le **modèle immutable** du repo `templates` : [.forgejo/templates/rapport-qa.md](https://forgejo.tordais.cc/nonobis/templates/src/branch/main/.forgejo/templates/rapport-qa.md)

- [ ] Rapport QA de the-qa : ✅ VALIDÉ / ❌ REFUSÉ / ⚠️ réserves (voir commentaire)
- [ ] Tous les tests passent (voir commentaire CI + rapport QA)
- [ ] Coverage : **X %** (ou lien vers le rapport)

## Retours SonarQube (obligatoire)

> La qualité gate SonarQube est **bloquante** en CI : la PR ne peut pas être mergée si elle est rouge. Traiter TOUS les retours avant de demander la relecture.

- [ ] Quality gate SonarQube **OK** (voir run CI)
- [ ] Bugs / vulnérabilités : **0 non résolu** — sinon détailler ici pourquoi :
  - `rule:key` — justifié (hors scope / faux positif / ticket de dette technique créé)

## CVE (obligatoire)

> Trivy + OWASP Dependency-Check sont **bloquants** (HIGH/CRITICAL). Toute CVE signalée doit être corrigée. Si une correction est **impossible**, l'expliquer en commentaire sur la PR (pas de merge sans justification).

- [ ] Aucune CVE HIGH/CRITICAL nouvelle sur cette PR (voir commentaire CI)
- [ ] CVE non corrigeables documentées en commentaire (si applicable)

## Checklist

- [ ] Commits atomiques au format conventionnel (`feat(scope): ...`, `fix(scope): ...`)
- [ ] Branche issue de `main`, à jour (`git rebase main` si besoin)
- [ ] Pas de secret en clair (tokens, mots de passe)
- [ ] Build local : `dotnet build -c Release`
- [ ] Tests locaux : `dotnet test` (ou `make test`)
- [ ] CI verte : build, tests, Trivy, Dependency-Check, SonarQube (politiques bloquantes)
- [ ] Release notes / versioning impacté (GitVersion)

Reviewed-on: https://forgejo.tordais.cc/nonobis/Heimdall/pulls/188
2026-08-30 15:55:15 +02:00
Arnaud Dartois 760994ed7a feat(ci): release notes avec liens issues cliquables (Fixes #99) (#183) 2026-08-30 10:09:55 +02:00
Arnaud Dartois 4b954be09c feat(mobile): Application mobile Android — Kotlin + Jetpack Compose (#19) (#182) 2026-08-30 10:09:43 +02:00
Arnaud Dartois 881ad48066 feat(backup): backup automatisé PostgreSQL + Alarik avec test de restauration (#180) 2026-08-30 10:09:25 +02:00
Arnaud Dartois e49b0d73aa feat(c cameras): enforce camera-level access filtering in GetCamerasBySite and GetCamera (#179) 2026-08-30 10:09:25 +02:00
Arnaud Dartois eef8c95d98 feat(sites): suppression de site en cascade — agents et caméras (#177) 2026-08-30 09:49:17 +02:00
Arnaud Dartois e6e8690588 feat(security): add ICameraAccessService for granular per-user camera access control (#178) 2026-08-30 09:48:47 +02:00
Arnaud Dartois acf3a4304c fix(ci): réduire artifact build + corriger URL YOLO ONNX (#181) 2026-08-30 09:45:37 +02:00
Arnaud Dartois bf2ccad537 feat(broker): RabbitMQ + MassTransit job broker pour l'analyse inter-sites
feat(broker): add RabbitMQ + MassTransit job broker for cross-site analysis

Mutualise les ressources IA/GPU entre sites via un broker de jobs durable.
RabbitMQ + MassTransit avec connexion AMQP sortante (pas de port entrant).

- Heimdall.Contracts: contrats de messages partagés
- RabbitMQ: conteneur docker + credentials via env vars
- MassTransit Central: publication de jobs d'analyse
- MassTransit Agent: consommateur avec backpressure GPU

Fixes #72
2026-08-28 01:11:12 +02:00
Arnaud Dartois b97d3bec11 feat(security): enforcement — filtrage caméra dans les endpoints sensibles (#175) 2026-08-27 20:28:41 +02:00
Arnaud Dartois 0f47236c08 feat: journal d'audit complet + auto-update agent natif & Docker (#92 #96 #97) 2026-08-27 18:56:57 +02:00
Arnaud Dartois 539859d250 feat(ui): admin delete user button with confirmation dialog
feat(ui): admin delete user button with confirmation dialog

Fixes #87

- HeimdallApiClient: DeleteUserAsync avec gestion erreurs 400/403/409
- UsersPage.razor: icône suppression + MudDialog confirmation
- Rechargement auto liste après suppression
2026-08-27 16:49:45 +02:00