Commit Graph

789 Commits

Author SHA1 Message Date
rcourtman 8600706da3 Fix FreeBSD agent restart handling
Refs #1457
2026-05-24 21:51:11 +01:00
rcourtman 2dffa40379 Fix v5 user-reported monitoring and auth issues
Refs #1452

Refs #1455

Refs #1467

Refs #1471

Refs #1472

Refs #1477

Refs #1478

Refs #1479
2026-05-24 21:07:55 +01:00
rcourtman 8337cbc4c9 Fix v5 diagnostics GitHub export
Normalize diagnostics collection fields to empty arrays before encoding and harden the sanitized GitHub export path against null arrays so empty v5 installs can still produce issue attachments.

Refs #1454
2026-05-03 19:12:24 +01:00
rcourtman 81661a934a Move v5 maintenance flow onto release/5.1 2026-04-14 18:34:41 +01:00
rcourtman 1f0dfd60fc Lock SAML metadata public URL refresh 2026-04-13 13:48:27 +01:00
rcourtman 678f528961 Preserve OIDC group fields on SSO updates 2026-04-05 23:35:54 +01:00
rcourtman aa69bd2d8e Add resource alert stats regression coverage 2026-04-05 23:35:54 +01:00
rcourtman 0a68d79871 Make agent installs version-aware 2026-04-05 23:35:54 +01:00
rcourtman cca27b697e Fix SAML public URLs and OIDC group role mappings 2026-04-05 23:35:54 +01:00
rcourtman cc756f5d2f Select reachable Proxmox auto-register hosts 2026-04-01 13:17:21 +01:00
rcourtman 2a99e03831 Add Ollama basic auth support 2026-04-01 12:00:38 +01:00
rcourtman 6a5a5ee615 Use allowlisted host-agent filenames in router 2026-03-31 09:40:54 +01:00
rcourtman 57cf7b305a Validate SAML redirects and request URLs 2026-03-31 09:34:31 +01:00
rcourtman a7326d7047 Tighten redirect and download path handling 2026-03-31 09:17:52 +01:00
rcourtman 66b448d63b Harden outbound SSO and webhook URL handling 2026-03-31 09:06:06 +01:00
rcourtman 04a828264a Restore legacy host config fetch compatibility (#1254) 2026-03-30 19:30:48 +01:00
rcourtman b5757c38fd Harden security handlers and apprise execution 2026-03-28 11:03:16 +00:00
rcourtman c5fc38143e Update monitor wrapper test for alert-backed state 2026-03-28 10:12:34 +00:00
rcourtman 716340dcd6 Reuse loaded AI config when restarting stopped service 2026-03-28 10:00:37 +00:00
rcourtman 7849dd012b Remember AI chat state provider across restart (#1339) 2026-03-27 15:34:42 +00:00
rcourtman d310c257a1 Prefer monitor connection state in diagnostics 2026-03-26 22:58:57 +00:00
rcourtman 5997fd81f3 Preserve webhook mentions in list API (#1118) 2026-03-25 23:12:22 +00:00
rcourtman fd13d7f59e Avoid background update goroutines in api tests 2026-03-25 13:57:49 +00:00
rcourtman 2ed1c3b839 Proxy missing host-agent binaries from GitHub releases (#1254) 2026-03-25 13:11:31 +00:00
rcourtman 1de1392c9b Preserve provider metadata in AI model lists (#1320) 2026-03-25 13:08:15 +00:00
rcourtman 93475f3941 Self-heal stale Proxmox auto-register markers (#1267) 2026-03-25 12:34:50 +00:00
rcourtman 8119050819 Accept tokenId/tokenSecret aliases for node config API (#1147) 2026-03-25 12:23:39 +00:00
rcourtman 83f8e93543 Use org-specific metrics store for report generation (#1186) 2026-03-25 11:48:57 +00:00
rcourtman 73786a9e27 Skip patrol triggers when patrol is disabled (#1258) 2026-03-25 11:33:34 +00:00
rcourtman b20221429f Harden Proxmox setup SSH key handling (#1297) 2026-03-25 11:27:25 +00:00
rcourtman 2fa8379a6b Fix resource stats alert counts (#1365) 2026-03-25 11:19:03 +00:00
rcourtman 4d4344911a Harden PVE setup token extraction (#1312) 2026-03-25 11:09:19 +00:00
rcourtman c12f5fb5a4 Restart AI chat on provider and patrol model changes (#1339) (#1360) 2026-03-25 10:58:12 +00:00
rcourtman 8a43a964b6 fix(ai): wire patrol circuit breaker on first-time configure 2026-03-13 12:10:14 +00:00
rcourtman ae2edbde20 fix(ai): complete wiring on first-time configure; guard Ollama fallback
Three follow-up fixes:

1. RestartAIChat() now performs the full post-start wiring (MCP providers,
   patrol adapter, investigation orchestrator) when the service starts for
   the first time via Restart(). Previously these were only wired via
   StartAIChat(), leaving first-time configure with a partially wired service.

2. The Ollama→OpenAI-compatible fallback in createProviderForModel is now
   guarded by !strings.HasPrefix(modelStr, "ollama:") so explicit
   "ollama:llama3" models are never silently rerouted to a different provider.

3. Windows install script registration check now uses the $Hostname override
   (if set) instead of always looking up $env:COMPUTERNAME, so post-install
   verification works correctly when a custom hostname is specified.
2026-03-13 12:06:08 +00:00
rcourtman e137f3fbf7 fix(ai): start chat service on first-time configure without restart
When Pulse starts before AI is configured, legacyService is nil.
Saving AI settings called Restart() which bailed immediately on the
nil check, leaving the service unstarted (503 on /api/ai/sessions)
until a full process restart.

Merged the nil and !IsRunning checks so first-time configure now
starts the service inline, same as the already-handled stopped case.

Also: bare model names that ParseModelString routes to Ollama (e.g.
"qwen3-omni") now fall back to a configured custom OpenAI base URL
when Ollama is not explicitly configured — handles manually-typed
model names on self-hosted OpenAI-compatible endpoints.

Fixes #1339, #1296
2026-03-13 11:13:27 +00:00
rcourtman 1a582ccc35 fix(diagnostics): honor PVE fingerprint in diagnostics probe 2026-03-10 22:46:12 +00:00
rcourtman a4b0771974 Prevent removed host agents from resurrecting via in-flight reports (#1331)
Host agents removed from the UI would reappear on the next report cycle
because there was no rejection mechanism — unlike Docker agents which
already had resurrection prevention. Mirror the Docker agent pattern:

- Track removed host IDs in a `removedHosts` map with 24hr TTL
- Persist removal records in `State.RemovedHosts` for frontend display
- Reject reports from removed hosts in `ApplyHostReport()`
- Add `AllowHostReenroll()` + API route to clear the block
- Show removed host agents in the Settings UI with "Allow re-enroll"
- Sync removed-agent maps from state on startup for all agent types
- Fix mock integration snapshot missing `RemovedDockerHosts` field
2026-03-09 17:52:34 +00:00
rcourtman 9b531c547d Fix recovery notifications silently disabled by config PUT (#1332)
Two fixes for missing recovery/resolved notifications:

1. API config PUT handler now preserves notifyOnResolve when the client
   omits it from the request body. Go decodes a missing bool as false,
   which silently disabled recovery notifications on older clients.

2. CancelAlert now always cleans up the cooldown record even when the
   alert has already left the pending buffer, preventing stale cooldown
   entries from suppressing future alert cycles.
2026-03-09 11:28:28 +00:00
rcourtman 572520ebc6 Promote guest-agent /proc/meminfo fallback for accurate VM memory (#1270)
Move the guest-agent file-read of /proc/meminfo earlier in the memory
fallback chain so it runs before RRD, giving real-time MemAvailable that
correctly excludes reclaimable buff/cache on Linux VMs. Also add
VM.GuestAgent.FileRead permission for PVE 9 and fix install.sh to use
comma-separated privilege strings.
2026-03-09 10:04:28 +00:00
rcourtman 45b5c8a861 Restore previous license on persistence failure instead of clearing it
If license save fails, the in-memory license was being cleared, which
could drop a valid existing license. Now snapshots the current license
before activation and restores it if persistence fails.
2026-03-08 11:49:26 +00:00
rcourtman fe0706f614 Fix cluster double-registration invalidating Proxmox credentials (#1319)
Two nodes in the same PVE cluster generated identical Proxmox API token
names, so the second node's setup rotated the shared token and broke the
first node. Include the hostname in the token name so each node gets its
own token. Also refresh the stored cluster credential on the server when
a new endpoint merges into an existing cluster entry.
2026-03-07 22:36:01 +00:00
rcourtman 0dd3fc779b Fix alert disable notification suppression 2026-03-07 18:40:08 +00:00
rcourtman d6e8bffaeb pulse/license upgrade safety hardening 2026-03-07 15:13:09 +00:00
rcourtman a6f6f66078 Improve auto-register auth errors and setup token grace window (#1319)
The /api/auto-register endpoint returned a generic "Invalid or expired
setup code" for all auth failures, making cluster registration issues
impossible to diagnose. Now returns specific errors for expired tokens,
wrong scope, invalid API tokens, etc.

Also extend the setup token grace window to /api/auto-register so
multiple cluster nodes can register with the same token within the
1-minute grace period after first use.
2026-03-07 13:39:26 +00:00
rcourtman ddecf6d00c Guard legacyMonitor typed-nil and add OIDC refresh panic recovery
Normalize SystemSettingsMonitor interface assignments via reflect to
prevent typed-nil-in-interface (same class as #1324 fix). Also add
defer/recover to the background OIDC token refresh goroutine so a
panic there cannot take down the process.
2026-03-07 10:21:07 +00:00
rcourtman 23a9fa70da Fix nil pointer crash when saving settings (#1324)
SystemSettingsHandler.mtMonitor was an interface field. A nil
*MultiTenantMonitor stored in it became a non-nil interface
(Go typed-nil-in-interface), bypassing the nil guard in getMonitor()
and panicking on every settings save in single-tenant mode.

Change mtMonitor to concrete *monitoring.MultiTenantMonitor so nil
checks work correctly. Also resolve getMonitor() once per request
instead of repeated calls to eliminate a TOCTOU race.
2026-03-07 10:21:07 +00:00
rcourtman 89577fe533 Fix OIDC token refresh bypass and guard AISettingsHandler nil path
The applyAuthContextHeaders early-return in CheckAuth skipped the OIDC
token refresh block, causing long-lived OIDC sessions to expire instead
of auto-refreshing. Move the refresh trigger into extractAndStoreAuthContext
so it fires at the middleware level before CheckAuth's early return.

Also add a nil guard on mtPersistence in AISettingsHandler.GetAIService
for non-default org paths, preventing a potential panic if background
code carries a non-default org context in v5 single-tenant mode.
2026-03-06 11:05:01 +00:00
rcourtman 743ef17b79 Fix AI and config profile handlers broken in v5 single-tenant mode
The single-tenant lockdown (499ab812e) set mtPersistence to nil but
only patched AISettingsHandler with a legacy fallback. AIHandler (chat
service) and ConfigProfileHandler were missed, so AI features (Patrol,
Chat) failed with "chat service not available" and config profiles
would panic on nil dereference. Wire legacy persistence into both
handlers and add the same fallback to ProfileSuggestionHandler.

Fixes #1322
2026-03-06 11:05:01 +00:00
rcourtman 6618db7799 Fix v5 single-tenant router test setup 2026-03-05 23:58:11 +00:00