3044 Commits

Author SHA1 Message Date
rcourtman
a73352a396 Add recovery endpoint regression test 2026-02-04 11:39:30 +00:00
rcourtman
aa61c8edc5 Add quick setup and token auth regression tests 2026-02-04 11:38:09 +00:00
rcourtman
0c4b19ddf4 Add SSH security regression coverage 2026-02-04 11:36:11 +00:00
rcourtman
06df067cd7 Cover apply-restart auth guards 2026-02-04 11:30:37 +00:00
rcourtman
a9dc469de7 Add permission denial regression tests 2026-02-04 11:28:09 +00:00
rcourtman
a2b8b21ada Fix rate limit flake in config export/import tests 2026-02-04 11:23:12 +00:00
rcourtman
ee5931ac7d test: extend admin proxy and reset lockout auth coverage 2026-02-04 11:16:53 +00:00
rcourtman
df4ae9d639 test: deny non-admin proxy users on admin endpoints 2026-02-04 11:14:53 +00:00
rcourtman
65a0b7a0e4 test: cover change-password and public export/import guards 2026-02-04 11:12:54 +00:00
rcourtman
5553214256 test: require auth for license status 2026-02-04 11:08:21 +00:00
rcourtman
1af342da2d fix: add 7-day snooze cooldown to GitHub star modal
"Maybe later" previously only hid the modal for the current session,
causing it to reappear on every subsequent visit. Now it snoozes the
modal for 7 days before showing again.
2026-02-04 11:04:52 +00:00
rcourtman
ed0f85149d test: require auth for logs and update status 2026-02-04 11:00:46 +00:00
rcourtman
cea2fdd40f fix: add FreeBSD binaries to release manifest and validation
The previous commit added FreeBSD binaries to the Docker build and
release directory but didn't update the manifest generator or validation
script. Without this, FreeBSD binaries would be built but not tracked
or validated, and release validation would fail on the new entries.

Related to #1051
2026-02-04 11:00:31 +00:00
rcourtman
ae58e16525 test: include /api/config in monitoring read coverage 2026-02-04 11:00:03 +00:00
rcourtman
764805b0b9 test: require auth for auto-register 2026-02-04 10:59:24 +00:00
rcourtman
d6172b9a86 test: require auth for config export/import in api mode 2026-02-04 10:57:14 +00:00
rcourtman
47a4dc01cf test: require auth for ai status, license features, scheduler health 2026-02-04 10:56:17 +00:00
rcourtman
7346d48872 fix: add FreeBSD agent binaries to Docker build and fix pfSense boot (#1051)
Two fixes for FreeBSD agent support:

1. The Docker image never built or included FreeBSD agent binaries, causing
   404 errors when FreeBSD clients requested the download. Added FreeBSD
   amd64/arm64 cross-compilation for both host-agent and unified-agent,
   plus COPY statements to include them in the image. Also added bare
   FreeBSD binaries to GitHub release assets for the redirect fallback.

2. pfSense does not use the standard FreeBSD rc.d boot system — scripts
   in /usr/local/etc/rc.d/ must end in .sh to run at boot. The installer
   now detects pfSense and creates a .sh boot wrapper alongside the
   standard rc.d script. Also added -r flag to daemon for auto-restart.

Related to #1051
2026-02-04 10:55:55 +00:00
rcourtman
5850ddf584 test: enforce proxy admin for config export/import and notifications 2026-02-04 10:54:51 +00:00
rcourtman
83311cdf8c test: require settings:write for ai patrol autonomy update 2026-02-04 10:48:56 +00:00
rcourtman
32426aa6ca test: license gate audit verify endpoint 2026-02-04 10:48:11 +00:00
rcourtman
f8b495c54c test: enforce scope on security token endpoints 2026-02-04 10:47:36 +00:00
rcourtman
0a26ef622a test: license gate audit webhook endpoint 2026-02-04 10:46:53 +00:00
rcourtman
1fdb96db1f test: require settings scopes for config export/import 2026-02-04 10:46:19 +00:00
rcourtman
f8a8affe26 test: enforce license gating for enterprise endpoints 2026-02-04 10:42:44 +00:00
rcourtman
a6e1b7f6ee test: require license for audit and reporting 2026-02-04 10:42:00 +00:00
rcourtman
71440c9521 test: require host:manage for host config patch 2026-02-04 10:40:58 +00:00
rcourtman
ac006ff5b9 test: require ai:chat scope for chat endpoints 2026-02-04 10:40:19 +00:00
rcourtman
563f4893fb test: guard ai settings endpoints by scope 2026-02-04 10:39:28 +00:00
rcourtman
86b75c9e7c test: enforce monitoring:write for metadata mutations 2026-02-04 10:38:48 +00:00
rcourtman
9409969ddd test: require monitoring:read for core data endpoints 2026-02-04 10:37:53 +00:00
rcourtman
8ed47b8971 test: enforce agent scope checks 2026-02-04 10:37:06 +00:00
rcourtman
37f909c6dd test: guard discovery endpoints by scope 2026-02-04 10:35:43 +00:00
rcourtman
ad21be68f3 test: enforce settings:write for config node mutations 2026-02-04 10:34:41 +00:00
rcourtman
ead8eb7087 test: require ai:execute scope on more ai endpoints 2026-02-04 10:33:53 +00:00
rcourtman
c68e386d01 test: cover ai patrol and run-command scopes 2026-02-04 10:32:05 +00:00
rcourtman
b9eee668e5 test: expand security regression coverage 2026-02-04 10:28:41 +00:00
rcourtman
4bebd2f576 docs: fix incomplete sensor-proxy cleanup commands and add upgrade warning
The legacy cleanup section in TEMPERATURE_MONITORING.md only covered 1 of the
5 systemd units and referenced an outdated binary path. Users following these
docs still had the selfheal timer running, generating recurring TASK ERROR
entries in the Proxmox task log.

Updated with the complete set of units, correct file paths, and a note that
upgrading the Pulse container does not remove the sensor proxy from the host.
Added a sensor proxy removal section to UPGRADE_v5.md so users see the warning
during upgrade.

Related to #817
2026-02-04 10:27:03 +00:00
rcourtman
5c1487e406 feat: add resource picker and multi-resource report generation
Replace manual resource ID entry with a searchable, filterable resource
picker that uses live WebSocket state. Support selecting multiple
resources (up to 50) for combined fleet reports.

Multi-resource PDFs include a cover page, fleet summary table with
aggregate health status, and condensed per-resource detail pages with
overlaid CPU/memory charts. Multi-resource CSVs include a summary
section followed by interleaved time-series data with resource columns.

New POST /api/admin/reports/generate-multi endpoint handles multi-resource
requests while the existing single-resource GET endpoint remains unchanged.

Also fixes resource ID validation regex to allow colons used in
VM/container IDs (e.g., "instance:node:vmid").
2026-02-04 10:24:23 +00:00
rcourtman
dcfa8cf0ba fix: prevent false PBS backup indicators when VMIDs collide across PVE instances (#1177)
When namespace matching fails, the VMID-only fallback now checks whether
the VMID appears on multiple PVE instances. If ambiguous, the fallback
is skipped — preventing backups from being falsely attributed to the
wrong guest. Unique VMIDs still fall back as before.
2026-02-04 10:11:35 +00:00
rcourtman
07afa94d19 feat(security): add gitleaks secret scanning to pre-commit hook and CI
Add three layers of secret leak prevention:

1. .gitleaks.toml — config extending the default ruleset (~150 rules for
   AWS, GCP, Stripe, OpenAI, private keys, JWTs, etc.) with allowlists
   tuned to suppress false positives from test fixtures and docs.

2. .husky/pre-commit — enhanced with gitleaks protect --staged (graceful
   skip if not installed), sensitive file type blocking (.pem, .key, .enc,
   id_rsa, etc.), and broadened fallback patterns covering AWS, OpenAI,
   GCP, and private key headers alongside existing Stripe checks.

3. .github/workflows/build-and-test.yml — new secret-scan CI job using
   gitleaks-action that runs in parallel with build on every push/PR,
   serving as the last gate if someone bypasses local hooks.
2026-02-04 09:52:54 +00:00
rcourtman
f60050a801 fix(security): restrict query-string token auth to WebSocket upgrades only
API tokens passed via ?token= query parameter were accepted on all HTTP
requests. This is a security concern because tokens in URLs can leak via
server logs, browser history, referrer headers, and proxy logs.

The query-string token path exists solely for WebSocket connections which
cannot set custom headers during the upgrade handshake. This change adds
an isWebSocketUpgrade check to all three query-string extraction sites
in CheckAuth and extractAndStoreAuthContext, rejecting ?token= on regular
HTTP requests while preserving WebSocket functionality.

No frontend impact — the kiosk flow stores the token in sessionStorage
then uses X-API-Token headers for all API calls.
2026-02-04 09:52:32 +00:00
rcourtman
271bf50734 fix: use dynamic precision for all formatBytes displays
The previous fix (cf52b5f5) only updated NodeSummaryTable. Guest rows,
Docker hosts, storage, and backup views still used hardcoded 0 decimals,
showing "1 GB/2 GB" instead of "1.50 GB/2.00 GB" for small values.

Related to #1116
2026-02-04 09:29:21 +00:00
rcourtman
a3e8cd7008 Auto-update Helm chart version to 5.1.0-rc.2 helm-chart-5.1.0-rc.2 2026-02-04 00:23:28 +00:00
rcourtman
b0ab6b970c Auto-update Helm chart documentation 2026-02-04 00:23:24 +00:00
rcourtman
a6f2a674eb fix: resolve test failures blocking release
- KnowledgeStore: use atomic write (temp+rename) to prevent file
  corruption from concurrent async saves
- Change password tests: add auth headers since endpoint now requires
  authentication
- ClearSession test: expect 2 cookies (pulse_session + pulse_csrf)
  matching updated clearSession behavior
- API token test: update to match current behavior where query-string
  tokens are accepted (needed for WebSocket connections)
- Host agent config: allow ScopeHostManage to resolve any host, not
  just token-bound hosts
v5.1.0-rc.2
2026-02-03 23:53:54 +00:00
rcourtman
00793c7688 fix: resolve ExportConfig deadlock and update apprise test
ExportConfig held a read lock while calling LoadNodesConfig, which
could trigger a migration requiring a write lock - causing a deadlock.
Removed the redundant outer lock since each Load function manages its
own locking.

Also updated TestAppriseConfigPersistence to match the security fix
that hardcodes CLIPath to "apprise" to prevent RCE.
2026-02-03 23:35:36 +00:00
rcourtman
6059759958 feat: Add sparkline support for unified host agents on hosts page
Backend:
- Add HostData field to ChartResponse struct in types.go
- Add host data processing in /api/charts endpoint using 'host:' prefix key
- Include hosts count in debug logging for chart responses

Frontend:
- Add 'host' to MetricResourceKind type in metricsKeys.ts
- Add hostData field to ChartsResponse interface in charts.ts
- Process hostData in seedFromBackend() in metricsHistory.ts
- Pass resourceId to EnhancedCPUBar and StackedMemoryBar in HostsOverview.tsx
- Add '7d' and '30d' to TIME_RANGE_OPTIONS in metricsViewMode.ts

This enables sparkline trend visualization for unified host agents,
consistent with Proxmox guests. Data accumulates over time at 30s intervals.
2026-02-03 22:59:55 +00:00
rcourtman
a9d7713313 fix(discovery): persist custom URL from discovery tab for Docker and Kubernetes
The DiscoveryTab component for Docker containers/services and Kubernetes pods
was not receiving the customUrl and onCustomUrlChange props, causing saved
URLs to be lost when the drawer was reopened.

Changes:
- Add guest metadata management to DockerUnifiedTable (fetches on mount,
  caches, listens for external changes)
- Pass customUrl and onCustomUrlChange props to DiscoveryTab in
  DockerContainerRow and DockerServiceRow
- Add guest metadata management to KubernetesClusters component
- Update PodRow to receive and pass metadata props to DiscoveryTab

The fix ensures that when users click 'Use this' on a suggested URL and save,
the URL persists correctly across Docker containers, Swarm services, and K8s pods.
2026-02-03 22:53:26 +00:00
rcourtman
7c1ebbecd5 fix(security): enhance webhook validation, enforce API scopes, and improve test coverage 2026-02-03 22:41:44 +00:00