Arnaud Dartois
f897bd8936
fix(audit): attribute camera status toggles
Heimdall Gitea / Build and tests (pull_request) Successful in 26m22s
Heimdall Gitea / Publish versioned release (pull_request) Skipped
2026-10-21 10:15:26 +02:00
Arnaud Dartois
a182af36d9
merge main into pipe profile and preserve isolation fixes
2026-10-20 07:26:50 +02:00
Arnaud Dartois
1cd4e2b4b5
fix(security): enforce resource isolation across API and hubs
2026-10-20 07:16:44 +02:00
Arnaud Dartois
8c6ecccf49
fix(pipeline): version detection profiles and resync camera configuration
2026-10-20 02:27:19 +02:00
Arnaud Dartois and the-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 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
acf3a4304c
fix(ci): réduire artifact build + corriger URL YOLO ONNX ( #181 )
2026-08-30 09:45:37 +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
4792b69e46
feat(agent): télémétrie inventaire matériel — CPU/mémoire/disque/GPU/OS/réseau ( Fixes #82 #83 #84 #85 ) ( #137 )
...
## Contexte
Implémentation des tickets #82 , #83 , #84 , #85 — télémétrie inventaire matériel agent. L'objectif est de fournir au central un maximum d'informations sur les machines des agents (CPU, mémoire, disques, GPU, OS, réseau, conteneur) sans SSH.
## Changements
### Nouveaux collecteurs (src/Heimdall.Agent/Services/)
- **CpuInfoProvider** : parse `/proc/cpuinfo` (vendor, modèle, cœurs physiques/logiques, fréquence, flags AVX/AVX2/FMA/AVX512, cache), topologie, détection cgroup CPU (`/sys/fs/cgroup/cpu.max` v2)
- **DiskInventoryProvider** : énumère les montages (`/proc/mounts`), capacité/libre/type SSD/HDD via `/sys/block/*/queue/rotation`
- **GpuInventoryProvider** : nvidia-smi, sysfs DRM, vainfo, rocm-smi avec fallback silencieux, multi-GPU
- **HostInfoProvider** : os-release, uname, `/proc/uptime` (uptime machine ≠ process), températures sysfs
- **ContainerInfoProvider** : détection Docker (/.dockerenv, cgroup), ID conteneur, limites CPU/mémoire
### Refonte SystemMetricsProvider
- Séparation host vs process (RAM machine ≠ RAM conteneur ≠ WorkingSet64)
- Uptime machine (`/proc/uptime`) distinct de l'uptime process
- Mémoire swap
### Entité Agent + Migration
- Champs structurés CPU/mémoire/disque/GPU/OS/réseau (tous nullable, rétrocompatible)
- Migration EF `AddAgentTelemetryInventory`
### Transport heartbeat
- Inventaire au register + refresh périodique (5 min, pas à chaque tick)
- Champs JSON pour listes (disques, GPU, interfaces réseau, températures)
### UI Admin (AgentDetail.razor)
- Sections CPU, Mémoire/Disques, GPU, Machine/Conteneur avec barres de progression et badges
### Tests
- 40+ tests unitaires : providers, handlers, entité Agent
- Total : 999 tests verts (Domain 149, Application 397, Agent 210, Web 243)
## Tickets liés
- Fixes #82 — CPU inventory
- Fixes #83 — Mémoire & disque
- Fixes #84 — GPU inventory
- Fixes #85 — OS, conteneur, réseau
## Résultats des tests
- `dotnet build` : 0 erreur, 0 warning
- Domain.Tests : 149 passed
- Application.Tests : 397 passed
- Agent.Tests : 210 passed
- Web.Tests : 243 passed
- Total : 999 tests ✅
## Checklist
- [x] `dotnet build` vert (TreatWarningsAsErrors)
- [x] Tests unitaires verts
- [x] Migration EF créée
- [x] Champs nullable (rétrocompatible)
- [x] Pas de référence Infrastructure dans les contrôleurs
- [x] Collecteurs avec fallback silencieux (pas de crash sans GPU/Docker/sysfs)
Reviewed-on: https://forgejo.tordais.cc/nonobis/Heimdall/pulls/137
2026-08-20 14:13:06 +02:00
Arnaud Dartois
f54bb596af
feat(cameras): activer/désactiver une caméra depuis la liste (toggle status) ( #151 )
...
## Résumé
Ajoute un bouton toggle (play/stop) dans chaque tuile de la liste des caméras pour activer/désactiver une caméra directement depuis la vue liste, sans passer par la page détail.
## Changements
### API
- **`POST /api/cameras/{id}/toggle-status`** — endpoint dédié qui bascule entre `Online` et `Disabled`
- `ToggleCameraStatusCommand` + handler (Application layer)
- `ToggleCameraStatusAsync` dans `HeimdallApiClient`
### UI
- **`CameraTile.razor`** — bouton toggle ajouté (play/stop) entre View et Snapshot
- **`CamerasPage.razor`** — callback `OnToggleStatus` câblé + snackbar feedback
- **`CameraDetail.razor`** — migré vers le nouvel endpoint dédié (au lieu de `UpdateCameraAsync` avec status)
### Tests
- 4 unit tests (`ToggleCameraStatusCommandTests`)
- 2 integration tests (toggle + 404)
- Fix bUnit `CameraDetailTests` (mock PUT → POST)
## Closes
- Issue #59
Reviewed-on: https://forgejo.tordais.cc/nonobis/Heimdall/pulls/151
2026-08-19 22:38:34 +02:00
Arnaud Dartois
1f954e67ba
fix(web): remonte les erreurs back-end dans l'ajout de caméra ( #118 )
...
fix(web): remonte les erreurs back-end dans l'ajout de caméra (#118 )
2026-08-14 21:07:28 +02:00
Arnaud Dartois
332be83915
feat(cameras): statut caméra temps réel piloté par la capture agent ( Fixes #58 )
...
- Endpoint PUT /api/agents/{id}/cameras/{cameraId}/status (API Key auth) +
ReportCameraStatusCommand : met à jour Camera.Status seulement si la caméra
appartient au site de l'agent, broadcast SignalR NotifyCameraStatusChanged
- Agent : CameraStatusReporterService (cooldown par changement d'état,
fire-and-forget, compteur d'échecs, ne bloque jamais la capture)
- SnapshotPipelineService.SyncStreamsAsync reporte : capture active → Online,
ffmpeg échec → Error, caméra retirée/disabled → Disabled (≤ 30 s)
- Tests : 5 handler (site check, not found, pas de broadcast si inchangé)
+ SnapshotPipelineServiceTests adaptés (ICameraStatusReporter substitué)
2026-08-12 09:13:52 +02:00
Arnaud Dartois
45c6ce82eb
perf: add ConfigureAwait(false) to all async calls in library projects
...
Add ConfigureAwait(false) to all await expressions in Application and
Infrastructure projects (111 files). This follows .NET best practices
for library code to avoid potential deadlocks when consumed from
synchronization contexts (legacy, unit test runners).
Also fix 4 test assertions that check SaveChangesAsync — update to
SaveChangesWithRetryAsync to match the handler changes from Fix 4.
2026-07-27 18:59:12 +00:00
Arnaud Dartois
9e58b5bf55
fix: use SaveChangesWithRetryAsync across all handlers
...
Replace naked SaveChangesAsync(ct) with the project's own
SaveChangesWithRetryAsync(ct: ct) in 5 locations to handle
PostgreSQL serialization conflicts and SQLite SQLITE_BUSY
transient failures:
- UpdateCameraCommand, CreateCameraCommand, DeleteCameraCommand,
SetCameraCredentialsCommand, AuthDataService
2026-07-27 18:40:23 +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