Arnaud Dartois
ec50f6635e
fix: remove hardcoded DB password from AppDbContextFactory
...
The fallback connection string included 'Password=heimdall' as a literal.
Remove the password — the fallback is only for local dev where PostgreSQL
trust authentication is typically used. Production deployments must set
the DATABASE_URL environment variable.
2026-07-27 18:37:54 +00:00
Arnaud Dartois
06927fb9b4
fix: remove stale NtfyToken from migration snapshot
...
The UserNotificationConfig entity was migrated from Gotify to ntfy
(NtfyUrl replaces GotifyUrl, NtfyEnabled replaces GotifyEnabled).
NtfyToken was never part of the entity but the snapshot still referenced
it, causing PendingModelChangesWarning and 4 integration test failures.
Remove NtfyToken from the Designer.cs and ModelSnapshot.cs to align
the snapshot with the actual entity model.
2026-07-27 18:36:45 +00:00
Arnaud Dartois
9429568fb2
fix(ci): fetch RENOVATE_TOKEN from Vault instead of secrets
2026-07-27 12:08:13 +00:00
Arnaud Dartois
a6b2a21ebc
fix: corriger les issues mineures du review
...
🟡 SnapshotUrl: validation sécurité SSRF (scheme + loopback)
🟡 Integration tests: skip graceful sans PostgreSQL (TestContainers)
2026-07-27 09:09:14 +00:00
Arnaud Dartois
fba29b3eb4
chore: remove embedded templates repo from tracking
2026-07-27 05:33:58 +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
1080f26591
chore: cleanup gitignore - coverage reports, core dumps, embedded repo
2026-07-26 20:46:04 +00:00
Arnaud Dartois
f9be0f1e0d
feat: implémenter SignalR hubs (Monitoring, Notifications, Admin) + système de notifications complet
...
SignalR Hubs:
- MonitoringHub (/hubs/monitoring) — statuts agents/caméras/stockage/GPU jobs
- NotificationsHub (/hubs/notifications) — notifications in-app badge temps réel
- AdminHub (/hubs/admin) — broadcast changements config (Admin only)
Notification System:
- Nouvelles entités: Notification, NotificationTemplate, UserNotificationConfig
- CQRS/MediatR: 6 handlers (list, unread, mark-read, mark-all, config get/update)
- Infrastructure: NotificationService orchestrator + EmailService + GotifyService
- Rate limiter IMemoryCache (20 events/min/camera/type)
- Hangfire jobs: SendNotification, DailyDigest, WeeklyDigest
- NotificationsController API (6 endpoints)
- Blazor UI: NotificationsPage + NotificationBadge
- Migration AddNotifications (3 nouvelles tables)
- 644 nouveaux tests (Domain: 131, Application: 321, Infra: 151, Integration: 120, +autres)
2026-07-26 20:45:35 +00:00
Arnaud Dartois
ef3ea9d1ca
fix: resolve 7 code quality issues from audit
...
- Add CancellationTokenSource timeout to DB migration loop (5 min)
- Make seed admin password configurable via env/config
- Improve ExceptionFilter with typed exception handling (409/499/500)
- Document Hangfire.PostgreSql CS0618 pragma with upgrade link
- Narrow CredentialProtector fallback catch to non-empty ciphertext
- Fix ApiBaseUrl in appsettings.json (:5000 -> :8080) for Docker consistency
- Improve HTTPS reverse proxy comment in middleware config
Build: 0 errors, 0 warnings | Tests: 799/799 passed
2026-07-26 19:49:42 +00:00
Arnaud Dartois
e426897449
chore: update opencode submodule to f5cb597
2026-07-26 19:34:45 +00:00
Arnaud Dartois
117172adb8
chore: update opencode submodule to 89ad88b
...
Pins parent to submodule with COG patterns:
- Worker /tmp/ cost optimization
- Graceful MCP dependency levels
- Braindump skill for structured capture
2026-07-26 19:27:58 +00:00
Arnaud Dartois
6c1defb4eb
chore: update opencode submodule to 61efbd4
...
Pins parent to submodule with:
- Use Cases Library (templates/use-cases/)
- CLI Dashboard (scripts/dashboard.sh)
- DAG Workflow Engine (scripts/workflow.sh + skills/dag-workflow/)
2026-07-26 19:23:52 +00:00
Arnaud Dartois
851a3d0686
chore: update opencode submodule to 1013fad
...
Parent project pins the updated opencode submodule with:
- MCP Runtime Contract rule
- Typed IPC protocol with JSON Schema validation
- Terminal Design System skill
- Secure Execution Boundary (§43)
- Grill Mode for deliberation (§50.10)
- ADR Workflow (§51) with template
2026-07-26 18:03:22 +00:00
Arnaud Dartois
9dd503f305
chore: update opencode submodule — remove agents, SkillServer-only
...
- Remove 43 agent .md files from submodule (served from skill.tordais.cc)
- Fix opencode.template.json with coordinator primary declaration
- Update INTEGRATION.md, clean agent-registry.yaml
- Fix deprecated agent names in rules
- Update global config prompt to ~/.config/opencode/agents/
- Publish fixed agents to SkillServer (coordinator mode: primary, load_rules/load_skills cleanup)
2026-07-26 17:46:06 +00:00
Arnaud Dartois
ae6c5ebfe6
chore: update opencode submodule
...
- Add all 43 agents to submodule agents/ directory
- Fix YAML frontmatter (UTF-8 special chars, long descriptions)
- Remove hidden: true from all agents for @ menu visibility
- Configure coordinator-agent as primary agent in global config
2026-07-25 19:40:15 +00:00
Arnaud Dartois
3ab27aa9fe
chore: update opencode submodule to 85dd8cb
...
Added shared agent boilerplate rule (29-agent-boilerplate.md):
- Journal Entry format, IPC Protocol, Structured Output
- Self-Verification Checklist, Cross-Domain Peer Referral
- Token savings: ~1,783 lines (15% reduction across all agents)
Removed deprecated agents (perf-agent, dotnet-optimizer-agent)
from local cache — merged into perf-optimizer-agent
2026-07-25 18:58:37 +00:00
Arnaud Dartois
3ddc8f3006
chore: update opencode submodule to 0aa33b8
...
Massive optimization: 4 agents reduced by 68% average
- mudblazor-agent: 1643 → 203 lines (−88%)
- coordinator-agent: 966 → 304 lines (−68%)
- identity-agent: 649 → 228 lines (−65%)
- ux-ui-agent: 991 → 327 lines (−67%)
Created 6 new skills extracted from agents:
- mudblazor-theming, mudblazor-forms, mudblazor-performance, mudblazor-e2e, mudblazor-migration
- dotnet-identity-authentication
All optimized agents published to SkillServer v2.0.0
Total token savings: ~40-60% per agent dispatch
2026-07-25 18:53:29 +00:00
Arnaud Dartois
5213c0fb25
chore: update opencode submodule
2026-07-25 18:42:55 +00:00
Arnaud Dartois
ec4deeaf9f
chore(ci): add workflow_dispatch trigger for manual CI runs
2026-07-25 18:38:52 +00:00
Arnaud Dartois
70512e3ab0
chore: update opencode submodule to d567469
...
Massive cleanup: removed 21 redundant rules (−45% context size)
- Deleted 13 'see skill' pointers (duplicated by auto-loading)
- Deleted 7 research docs (moved to memorizer)
- Extracted ui-frontend-patterns to skill
- Cleaned cross-references in remaining rules
- Updated sync-agents.sh to fetch latest version
- Published coordinator-agent v1.1.0 on SkillServer
2026-07-25 18:29:57 +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
f6fbc082a1
chore: update opencode submodule to e73b5c4
...
- Add CI/CD templates repo architecture documentation
- Document vault-secrets debugging
- Add troubleshooting table for CI failures
2026-07-25 16:39:53 +00:00
Arnaud Dartois
920722544b
fix(ci): push Docker images to eltruncho instead of nonobis
...
The docker-compose.prod.yml pulls from eltruncho/heimdall but the CI
was pushing to nonobis/heimdall. Fix the docker-images config in both
ci.yml and release.yml to match the deployment target.
2026-07-25 16:26:24 +00:00
Arnaud Dartois
d0da78188a
test(auth): add integration tests for authentication redirect flow
...
Add AuthFlowTests to catch Blazor redirect bugs:
- Get_Root_WithoutAuth_RedirectsToLogin: unauthenticated GET /
must redirect to /login (would have caught the /Account/Login bug)
- Get_LoginPage_ReturnsOk: verify login page renders
- Get_ProtectedApi_WithoutAuth_ReturnsUnauthorized: API auth check
- RegisterAdmin_ThenLogin_ReturnsJwt_AndAccessesProtectedApi:
full auth flow with JWT token refresh
- Register_WithWeakPassword_ReturnsBadRequest: password validation
- Register_ReturnsValidAuthResponse: success path
2026-07-24 19:39:47 +00:00
Arnaud Dartois
15cb65064a
chore: update opencode submodule to f7cde17
...
Auto-pipeline now runs at 4 checkpoints (startup, before/after work unit, session end)
instead of only after learning-agent invocations.
2026-07-24 19:29:34 +00:00
Arnaud Dartois
50507ad86a
fix(auth): move ConfigureApplicationCookie after AddInfrastructure
...
AddIdentity (called by AddInfrastructure) sets default cookie paths
(/Account/Login) that override our custom paths. Move
ConfigureApplicationCookie after AddInfrastructure to ensure our
custom paths (/login) take precedence.
2026-07-24 19:29:02 +00:00
Arnaud Dartois
a379f2b136
feat(logging): add comprehensive authentication logging
...
- Add cookie authentication event logging in Program.cs (redirect to login, access denied, principal validation)
- Add logging in RedirectToLogin.razor for redirection tracking
- Add detailed logging in Login.razor for login attempts, 2FA verification, and authentication completion
- Add structured logging in AuthController for all authentication endpoints (register, login, 2fa, refresh, change-password, logout, etc.)
- Use appropriate log levels (Information, Warning, Error, Debug) based on event importance
2026-07-24 18:25:33 +00:00
Arnaud Dartois
550c621f35
fix(auth): move ConfigureApplicationCookie to Program.cs to override Identity defaults
...
Move ConfigureApplicationCookie configuration from DependencyInjection.cs
to Program.cs, ensuring it's called AFTER AddAuthentication().AddCookie().
This prevents Identity default paths (/Account/Login) from overriding
custom login paths (/login).
2026-07-24 18:15:56 +00:00
Arnaud Dartois
e5fb13632f
fix(auth): configure Identity cookie paths to use custom login page
...
Add ConfigureApplicationCookie to override Identity default paths
(/Account/Login) with custom paths (/login). This fixes the 404 error
when unauthenticated users are redirected to the login page.
2026-07-24 17:55:23 +00:00
Arnaud Dartois
364e8e6f55
fix(stats): execute DB queries sequentially to avoid DbContext thread-safety issue
...
DbContext is not thread-safe for concurrent operations. Running multiple
queries in parallel with Task.WhenAll caused 'A second operation was
started on this context instance before a previous operation completed'
exceptions, resulting in 500 errors on the stats endpoint.
2026-07-24 17:09:17 +00:00
Arnaud Dartois
0eb2410638
chore: update opencode submodule to b7cbd1d
...
Learning-agent now invoked after every commit (unconditional trigger)
2026-07-24 17:08:14 +00:00
Arnaud Dartois
adbc38fa75
fix(ci): remove sudo commands from disk cleanup
2026-07-24 16:51:53 +00:00
Arnaud Dartois
3cef2ab3d7
chore(ci): add aggressive disk cleanup to prevent runner OOM
...
The CI runner was failing at 100% disk capacity (67G/69G) during
coverage report generation. Add two cleanup steps:
1. Aggressive cleanup before CI execution (removes unnecessary
packages, Docker images, caches)
2. Cleanup after CI before coverage report (removes build
artifacts, test results)
2026-07-24 14:36:53 +00:00
Arnaud Dartois
261f922ad1
fix(web): disable HTTPS redirection when not configured
...
The application forced HTTPS redirection and secure cookies
even in HTTP-only mode (Docker deployment), preventing
plain HTTP connections.
Make UseHttpsRedirection() conditional on ASPNETCORE_URLS
and change CookieSecurePolicy from Always to SameAsRequest.
2026-07-24 13:52:22 +00:00
Arnaud Dartois
fc5108a4fa
fix(agent): add ffmpegPath parameter to CameraStreamService for deterministic testability
2026-07-24 06:38:15 +00:00
Arnaud Dartois
b851a20dde
test(web): add bUnit tests for StatusChip and FilterBar with ManualMockKeyInterceptorService
2026-07-23 20:40:56 +00:00
Arnaud Dartois
9df02856ad
ci: enable bunit-enabled for Blazor component tests
2026-07-23 20:26:35 +00:00
Arnaud Dartois
55f01cb922
ci: add explicit Web.Tests (bUnit) step to CI pipeline
2026-07-23 19:52:16 +00:00
Arnaud Dartois
3d7137a865
test(web): add bUnit shared component tests for PaginationBar, EmptyState, LoadingSkeleton, SectionCard
2026-07-23 19:38:30 +00:00
Arnaud Dartois
0745903fef
test: add remaining handler tests for Users, Groups, Persons, Assignments, Discovery; more Agent + E2E tests
2026-07-23 19:19:05 +00:00
Arnaud Dartois
a94afed6b5
test(e2e): add Playwright E2E tests for Blazor pages; refactor Program.cs to support test server
2026-07-23 18:12:47 +00:00
Arnaud Dartois
7678b4703a
chore: add InternalsVisibleTo for Agent tests
2026-07-23 17:00:22 +00:00
Arnaud Dartois
79d60abca3
docs: add test coverage design doc and implementation plan
2026-07-23 16:31:22 +00:00
Arnaud Dartois
262adc07cf
test(agent): add service tests for CameraStream, ConfigReceiver, FrameAnalyzer, SystemMetrics, DTOs
2026-07-23 15:37:20 +00:00
Arnaud Dartois
06247d4f5c
test(web): add Web.Tests unit tests and extended IntegrationTests
2026-07-23 15:27:34 +00:00
Arnaud Dartois
5d06c39160
test(infrastructure): add service tests for Security, Data, Discovery, Jobs layers
2026-07-23 15:08:09 +00:00
Arnaud Dartois
fed55bb1ab
test(application): add CQRS handler tests for Sites, Cameras, Agents, Auth, Events, Settings, Groups, Users, Assignments, Discovery, Persons, Stats, Audit
2026-07-23 14:32:33 +00:00
Arnaud Dartois
ddd0664a71
fix(test): replace NSubstitute-based DbSet mock with InMemoryDbSet - fixes nested substitution issue
2026-07-23 14:22:21 +00:00
Arnaud Dartois
d9c2a24949
test(application): add MockDbSetHelper and CreateSiteHandler tests
2026-07-23 09:59:30 +00:00