Commit Graph
28 Commits
Author SHA1 Message Date
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 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 881ad48066 feat(backup): backup automatisé PostgreSQL + Alarik avec test de restauration (#180) 2026-08-30 10:09:25 +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 0f47236c08 feat: journal d'audit complet + auto-update agent natif & Docker (#92 #96 #97) 2026-08-27 18:56:57 +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 42a441a7ab fix(prod): déploiement docker fonctionnel — API_BASE_URL + wildcard loopback
- SameOriginHttpMessageHandler: quand Kestrel écoute sur une wildcard
  (0.0.0.0 / [::] — ASPNETCORE_URLS=http://+:8080 en conteneur), résoudre
  l'origine interne vers http://localhost:<port> au lieu de l'adresse
  anycast que le HttpClient ne peut pas joindre
- docker-compose.prod.yml: API_BASE_URL explicite (http://localhost:8080)
  pour que les appels internes du circuit Blazor ciblent le listener du
  conteneur et non le port hôte vu par le navigateur
- docker-compose.local.yml: override pour déployer l'image locale tant
  que les fixes ne sont pas publiés sur Docker Hub par la CI
- .gitignore: exclut les .env (secrets JWT/mots de passe)

Vérifié par smoke test Playwright contre la prod (127.0.0.1:5010) :
login UI → dashboard, page users, création d'utilisateur, logout : 5/5
2026-08-10 00:09:22 +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 c1eac5431b fix: corriger les 8 issues du code review notifications
🔴 EmailService: implémentation SMTP réelle (System.Net.Mail)
🔴 GetNotificationConfigHandler: CQS — retourne DTO par défaut sans écrire en DB
🟠 NotificationRateLimiter: increment atomique (Interlocked)
🟠 DailyDigestJob/WeeklyDigestJob: comptes événements user-specific
🟠 docker-compose.prod: auth ntfy via NTFY_AUTH_FILE
🟠 Namespace: Heimdall.Web.Controllers (consistant)
🟠 Commentaire 'gotify' → 'ntfy'
🟠 Tests: NotificationsControllerTests (7 tests)
2026-07-27 05:33:53 +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 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 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 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 2f32906f68 feat: add Docker Hub production docker-compose and docs 2026-07-18 11:30:55 +00:00