Commit Graph
34 Commits
Author SHA1 Message Date
arnaud.dartois 495740292a feat(web): add camera-scoped WebRTC live view 2026-11-04 22:46:28 +01:00
arnaud.dartois 815ba7f842 feat: add camera recording vertical 2026-11-04 22:19:53 +01:00
arnaud.dartois e2d3f1054f fix(docker): probe health endpoint with GET 2026-11-04 22:02:35 +01:00
Arnaud Dartois e034d81a34 fix(backup): restore Central data and validate database dumps
Heimdall Gitea / Detect CI scope (pull_request) Successful in 5s
Heimdall Gitea / Build and tests (pull_request) Successful in 13m32s
Heimdall Gitea / Publish versioned release (pull_request) Skipped
Heimdall Gitea / Build and scan server image (pull_request) Successful in 4m32s
Heimdall Gitea / Build and scan agent image (pull_request) Successful in 11m12s
Heimdall Gitea / Publish Docker Hub latest tags (pull_request) Skipped
Heimdall Gitea / CI policy (pull_request) Successful in 1s
2026-10-26 07:28:37 +01:00
Arnaud Dartois d774d28f2a refactor(settings): manage integrations through Central UI
Heimdall Gitea / Detect CI scope (pull_request) Successful in 5s
Heimdall Gitea / Build and scan server image (pull_request) Canceled after 0s
Heimdall Gitea / Build and scan agent image (pull_request) Canceled after 0s
Heimdall Gitea / Publish Docker Hub latest tags (pull_request) Canceled after 0s
Heimdall Gitea / Publish versioned release (pull_request) Canceled after 0s
Heimdall Gitea / Build and tests (pull_request) Canceled after 7m33s
Heimdall Gitea / CI policy (pull_request) Failing after 2s
2026-10-26 06:26:00 +01:00
Arnaud Dartois 68e540133c refactor(docker): separate core and optional compose services
Heimdall Gitea / Detect CI scope (pull_request) Successful in 9s
Heimdall Gitea / Build and tests (pull_request) Successful in 18m48s
Heimdall Gitea / Publish versioned release (pull_request) Skipped
Heimdall Gitea / Build and scan server image (pull_request) Canceled after 0s
Heimdall Gitea / Build and scan agent image (pull_request) Canceled after 0s
Heimdall Gitea / Publish Docker Hub latest tags (pull_request) Canceled after 0s
Heimdall Gitea / CI policy (pull_request) Failing after 2s
2026-10-26 06:07:23 +01:00
Arnaud Dartois a2f75a00a7 fix(agent): make GPU passthrough optional
Heimdall Gitea / Build and tests (pull_request) Successful in 16m45s
Heimdall Gitea / Publish versioned release (pull_request) Skipped
Heimdall Gitea / Build and scan agent image (pull_request) Successful in 7m31s
Heimdall Gitea / Build and scan server image (pull_request) Successful in 7m44s
Heimdall Gitea / Publish Docker Hub latest tags (pull_request) Skipped
2026-10-25 00:01:42 +02:00
Arnaud Dartois 18813106a5 Merge remote-tracking branch 'origin/main' into fix/agent-container-nonroot
Heimdall Gitea / Build and tests (pull_request) Failing after 1m35s
Heimdall Gitea / Publish versioned release (pull_request) Skipped
# Conflicts:
#	docker/Dockerfile.agent
2026-10-22 19:16:22 +02:00
Arnaud Dartois 8ebb231c17 fix(agent): run container as non-root
Heimdall Gitea / Build and tests (pull_request) Failing after 4m46s
Heimdall Gitea / Publish versioned release (pull_request) Skipped
2026-10-22 07:00:12 +02:00
Arnaud Dartois 8ebcdb81a6 fix(agent): secure diagnostics and require TLS to central
Heimdall Gitea / Build and tests (pull_request) Failing after 2m24s
Heimdall Gitea / Publish versioned release (pull_request) Skipped
2026-10-22 06:56:06 +02:00
Arnaud Dartois f0cf011c30 Remove RabbitMQ and use existing SignalR agent channel
Heimdall Gitea / Build and tests (pull_request) Failing after 49s
Heimdall Gitea / Publish versioned release (pull_request) Skipped
2026-10-21 17:52:53 +02:00
Arnaud Dartois 1c8cd508bd docs(storage): replace Alarik with RustFS
Heimdall Gitea / Build and tests (pull_request) Failing after 23m28s
Heimdall Gitea / Publish versioned release (pull_request) Skipped
2026-10-21 16:03:16 +02:00
Arnaud Dartois 02082e504d docs: correct development commands and test guidance
Heimdall Gitea / Build and tests (pull_request) Successful in 29m11s
Heimdall Gitea / Publish versioned release (pull_request) Skipped
2026-10-21 09:56:24 +02:00
Arnaud Dartois cef3434c3c fix(ops): confine local storage and repair maintenance jobs (Refs #1) 2026-10-20 02:27:03 +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 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 b607574501 feat(docker): Docker secrets + coturn/ollama/redis 2026-08-20 18:13:59 +02:00
Arnaud Dartois 9097102575 chore(docker): retire les env SENTRY vides qui écrasaient les DSN fixes appsettings (Refs #107) 2026-08-12 12:23:44 +02:00
Arnaud Dartois ddfa22bee6 fix(agent): camera discovery — host-network compose, parasite filtering, auto stream detection
- Compose (dev+prod): agent on host network (bridge 172.x was skipped by the
  scanner), listen on 8081 (ntfy owns 8080), CentralUrl via host/domain,
  healthcheck adapted, no Docker DNS
- Scanner: skip the LAN gateway (NAT router, never a camera); wider camera
  ports (+34567/34568 Imou SDK, +8000 Hikvision SDK); 750 ms port timeout;
  keep only devices with real camera evidence; RTSP OPTIONS + MJPEG
  content-type probes prove live streams from the agent (it is on the LAN)
- Central: drop Unknown devices (nginx/gunicorn/gateway) on submit; classify
  37777 DVRIP as Standard camera (not NVR), 8899 alone as NVR; persist
  agent-tested stream URLs flagged IsAlive; shared CameraStreamTemplates
  with the agent so both build identical candidate URLs
- UI: discoveries popup auto-selects the agent-verified main stream — no
  manual stream choice
2026-08-11 20:47:27 +02:00
Arnaud Dartois afc1b2e032 fix: resolve demo admin seeding, Sentry DSN pass-through, and add startup diagnostics
- Replace IsDevelopment() guard with Seed:DemoOnStartup config flag
  (default: true, disable via SEED__DEMO_ON_STARTUP=false)
- Add Seed:AdminLogin (env SEED__ADMIN_LOGIN) to customize demo admin email
- Add Seed:AdminDisplayName (env SEED__ADMIN_DISPLAYNAME) to customize display name
- Add Sentry__Dsn env var to docker-compose files (matches .env convention)
- Increase Heimdall log level to Debug for startup diagnostics
- Add [DIAG] startup logs for Sentry DSN, Data Protection keys, environment
- Add Data Protection key directory diagnostic in DependencyInjection
2026-07-29 14:21:16 +00:00
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 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 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 51589dd988 fix(docker): add persistent volume for data protection keys
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.
2026-07-20 14:04:42 +00:00
Arnaud Dartois 562aabdfc8 feat(api+web): merge REST API and Blazor UI into single process
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.
2026-07-20 10:30:01 +00:00
Arnaud Dartois 3f75a20860 fix(infra): copy web wwwroot to /app/wwwroot in Dockerfile
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.
2026-07-19 19:14:47 +00:00
Arnaud Dartois 41d9ae2bc0 fix(infra): add working_dir /app/web to heimdall-web service
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.
2026-07-19 19:13:10 +00:00
Arnaud Dartois 554fd7ffc3 chore(docker): fix compose files and update README documentation
- 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
2026-07-19 16:07:32 +00:00
Arnaud Dartois f5c4bcd5f0 feat(deploy): add heimdall-web Blazor UI service to Docker Compose
The Dockerfile.central already compiled Heimdall.Web but it was never
deployed as a service. Add heimdall-web service using the same image
with entrypoint overridden to dotnet web/Heimdall.Web.dll.

- Expose port 5001 for the Blazor Server UI
- API_BASE_URL points to heimdall-central:8080 for server-side HTTP calls
- Healthcheck on root / returns 200 once the Blazor circuit is ready
2026-07-18 20:44:38 +00:00
Arnaud Dartois 1c08e0394d refactor(agent): use Options pattern with validation instead of raw env vars
Introduce AgentOptions class with DataAnnotations validation bound
from configuration (env vars with Agent__ prefix). Replace all
Environment.GetEnvironmentVariable() calls with typed IOptions<T>
injection. Config errors are caught at startup via ValidateOnStart().
2026-07-18 14:11:47 +00:00
Arnaud Dartois 58f46fe3dd feat(agent): add health check endpoint and Docker HEALTHCHECK
Migrate from Microsoft.NET.Sdk.Worker to Microsoft.NET.Sdk.Web to
enable HTTP health checks. Add /healthz endpoint via
AgentHealthCheck (reports healthy when registered with Central).
Configure Docker HEALTHCHECK with 30s interval and 15s start period.
2026-07-18 14:09:32 +00:00
Arnaud Dartois 5b656286e5 refactor: replace MinIO with Alarik S3-compatible storage
Alarik is a drop-in S3-compatible replacement requiring no application
code changes. All S3 APIs (upload, download, list, delete, multipart)
are fully supported.
2026-07-18 11:40:03 +00:00
Arnaud Dartois 6d5ec0c201 feat(mvp): cameras API, Docker production, tests, security, Makefile
- Cameras API: CRUD with service/controller/DTOs + Blazor page
- Docker: production-grade compose with healthchecks, .env, Makefile, networks
- Healthchecks: /healthz (liveness) and /readyz (readiness) endpoints
- Testing: 13 integration tests (Auth, Sites, Users, Cameras controllers)
  - Users: create, list, lock, reset-password
  - Cameras: create with site, list by site
- Environment: .env.example, docker-compose.override.yml for dev
- Infrastructure: ICameraService registered in DI
2026-07-17 06:18:56 +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