Commit graph

1011 commits

Author SHA1 Message Date
rcourtman
2eb9e61f0e test: add unit tests for utils package
- Test ID generation (uniqueness, format)
- Test JSON response writing (various types, headers)
- Test boolean parsing (truthy/falsy values)
- Test environment variable trimming
- Test data directory resolution
- Test large payload handling
2025-11-26 13:56:30 +00:00
rcourtman
ed81143119 test: add unit tests for crypto package
- Test encrypt/decrypt round-trip (various data types)
- Test string encryption (base64 output)
- Test key persistence across manager instances
- Test key file permissions (0600)
- Test decryption of invalid/corrupted data
- Test encryption uniqueness (random nonce)
- Test orphaned data protection
- Test large data encryption (1MB)
2025-11-26 13:52:05 +00:00
rcourtman
3c1cd4ee98 test: add unit tests for auth package
- Test API token generation (uniqueness, format)
- Test API token hashing (SHA3-256, deterministic)
- Test constant-time token comparison
- Test token hash detection
- Test password hashing (bcrypt, salted)
- Test password verification
- Test password complexity validation
- Verify bcrypt cost and minimum password length constants
2025-11-26 13:51:13 +00:00
rcourtman
f111c3ff6a test: add unit tests for agentupdate security features
- Test binary magic verification (ELF, PE, Mach-O)
- Test architecture detection
- Test Unraid persistent path generation
- Test updater configuration defaults
- Test edge cases: empty files, too short, non-existent
2025-11-26 13:50:19 +00:00
rcourtman
17af64fedf security: harden Windows installer script
- Add input validation for URL (http/https), token format, and interval
- Add SHA256 checksum verification against X-Checksum-Sha256 header
- Add PE binary magic verification (MZ header)
- Add file size validation (1-100MB expected)
- Add TLS 1.2/1.3 minimum enforcement
- Add 5-minute download timeout
- Add temp file cleanup on failure
- Add binary backup/restore on installation failure
- Download to temp file before atomic move to final location
2025-11-26 13:42:45 +00:00
rcourtman
dc4669f9f6 security: harden agent installers and auto-update mechanism
Install script (scripts/install.sh):
- Add multi-platform support: Unraid, OpenRC/Alpine, Synology DSM 6/7
- Add input validation for URL, token format, and interval
- Add binary magic verification (ELF/Mach-O/PE)
- Add cleanup trap for temp files
- Wrap script in main() for partial download protection
- Fix shellcheck compliance issues
- Add curl timeouts

Agent auto-update (agentupdate, dockeragent):
- Enforce TLS 1.2 minimum version
- Make SHA256 checksum verification mandatory
- Add 100MB binary size limit
- Add binary magic verification before replacement
- Add Unraid persistent binary update after self-update
- Add 5-minute download timeout

Frontend:
- Update Linux install description to note auto-detection of init systems
2025-11-26 13:14:58 +00:00
rcourtman
04f6a320b3 feat: add responsive column hiding to Docker table
Convert Docker table from HTML table to CSS Grid with dynamic column
visibility, matching the responsive behavior of the Proxmox overview.

Changes:
- Add DOCKER_COLUMNS with priority-based visibility breakpoints
- Use useGridTemplate hook for dynamic grid-template-columns
- Convert DockerContainerRow and DockerServiceRow to grid layout
- Use ResponsiveMetricCell for CPU/Memory/Disk columns
- Columns show/hide automatically based on viewport width:
  - essential (always): Resource, Status
  - primary (sm): Type, Updated
  - secondary (md): CPU, Memory
  - supplementary (lg): Image, Tasks
  - detailed (xl): Disk
2025-11-26 10:58:12 +00:00
rcourtman
442bcf2ad4 Auto-update Helm chart version to 4.33.0 2025-11-26 10:49:02 +00:00
rcourtman
67a9d84412 Auto-update Helm chart documentation 2025-11-26 10:49:01 +00:00
rcourtman
9daf1d5398 fix: cache daemon ID at init to prevent Podman token binding conflicts
Podman can return unstable or empty daemon IDs across API calls. When
the agent fetched info.ID on every report cycle, this could cause the
agent identity to change mid-session, triggering "token already in use"
errors on the server.

Cache the daemon ID at initialization and use it consistently for all
reports.

Related to #740
2025-11-26 10:23:22 +00:00
rcourtman
7d7368f18f fix: use correct script paths in unified agent handlers
The unified agent handlers were using r.config.AppRoot which pointed
to /app, but scripts are in /opt/pulse/scripts. Updated to match the
pattern used by other script handlers - check /opt/pulse/scripts first,
then fall back to project root for dev environment.

Also added no-cache headers to prevent stale scripts being served.
2025-11-26 10:05:43 +00:00
rcourtman
f3e85a7455 fix: remove references to deleted install-host-agent.sh script
The unified agent system replaced install-host-agent.sh with install.sh.
This commit updates all references:
- Dockerfile: removed COPY for deleted script
- router.go: serve install.sh at /install-host-agent.sh endpoint (backwards compatible)
- build-release.sh: removed copy of deleted script
- validate-release.sh: removed validation of deleted script
- install.sh: updated script list for bare-metal installs
2025-11-26 09:57:06 +00:00
rcourtman
2345e0d955 Prepare v4.33.0 release 2025-11-26 09:50:58 +00:00
rcourtman
7a0546c034 fix: use responsive max-width for better scaling on all displays
Changes from hard-coded 1768px to min(95vw, 2400px) which scales
appropriately on 4K and ultrawide monitors while maintaining
breathing room at screen edges.
2025-11-26 09:46:56 +00:00
rcourtman
2458bf5abc fix: constrain max layout width to 1768px on wide screens
Prevents the UI from stretching uncomfortably on ultra-wide displays.
2025-11-26 09:37:20 +00:00
rcourtman
8044c8cfba fix: restore I/O column styling to match v4.32.5 release
- Restore green/yellow/red color thresholds for disk and network I/O
- Use consistent text-xs font size across all columns
- Expand column widths to fit full header text at larger breakpoints
- Show full header names (Disk Read, VMID, Uptime, Memory) at xl+ screens
- Use shared GUEST_COLUMNS config for header/row grid alignment
- Add whitespace-nowrap to prevent header text wrapping
2025-11-26 09:32:58 +00:00
rcourtman
62300d5dcf fix: resolve TypeScript errors in frontend components
- UnifiedBackups: remove unused cols variable in colspan calculation
- GuestDrawer: remove unused IOMetric import, fix osInfo -> osName/osVersion
- Settings: add 'agents' to SettingsTab type, remove unused Boxes import,
  fix ToggleChangeEvent target -> currentTarget
- UnifiedAgents: remove unused onCleanup import, prefix unused hostname param
- NodeSummaryTable: remove unused index parameter in For callback
- Toggle: add locked and lockedMessage props to LabeledToggleProps
2025-11-26 09:11:25 +00:00
rcourtman
240af6a9ea fix: replace stale agent tests with UnifiedAgents tests
DockerAgents.tsx and HostAgents.tsx were consolidated into
UnifiedAgents.tsx, but the old test files remained and referenced
non-existent components, breaking CI.

- Remove DockerAgents.test.tsx and HostAgents.test.tsx
- Add UnifiedAgents.test.tsx covering token generation, host lookup,
  managed agents table, and platform-specific install commands
2025-11-26 09:06:15 +00:00
rcourtman
6853a0ffd1 feat: serve install scripts from GitHub releases instead of main branch
Scripts like install.sh and install-sensor-proxy.sh are now attached
as release assets and downloaded from releases/latest/download/ URLs.
This ensures users always get scripts compatible with their installed
version, even while development continues on main.

Changes:
- build-release.sh: copy install scripts to release directory
- create-release.yml: upload scripts as release assets
- Updated all documentation and code references to use release URLs
- Scripts reference each other via release URLs for consistency
2025-11-26 08:59:59 +00:00
rcourtman
ae3b78d661 fix: propagate unified agent version and improve legacy cleanup
Issues found during scenario testing:

1. Version propagation: The hostagent and dockeragent packages were
   reporting their own Version (0.1.0-dev) instead of the unified
   agent's version. Added AgentVersion config field to pass the
   parent's version down.

2. macOS legacy cleanup: The install.sh script was missing cleanup
   for pulse-docker-agent on macOS.

3. Windows legacy cleanup: The install.ps1 script was missing cleanup
   for legacy PulseHostAgent and PulseDockerAgent services.

These fixes ensure:
- Unified agent reports consistent version across host/docker metrics
- Legacy agents are properly removed on all platforms during upgrade
- Users migrating from legacy agents get a clean transition
2025-11-25 23:39:10 +00:00
rcourtman
ea335546fc feat: improve legacy agent detection and migration UX
Add seamless migration path from legacy agents to unified agent:

- Add AgentType field to report payloads (unified vs legacy detection)
- Update server to detect legacy agents by type instead of version
- Add UI banner showing upgrade command when legacy agents are detected
- Add deprecation notice to install-host-agent.ps1
- Create install-docker-agent.sh stub that redirects to unified installer

Legacy agents (pulse-host-agent, pulse-docker-agent) now show a "Legacy"
badge in the UI with a one-click copy command to upgrade to the unified
agent.
2025-11-25 23:26:22 +00:00
rcourtman
0436101ee5 feat: add auto-update support for unified agent
Implement self-update capability for the unified pulse-agent binary:

- Add internal/agentupdate package with cross-platform update logic
- Hourly version checks against /api/agent/version endpoint
- SHA256 checksum verification for downloaded binaries
- Atomic binary replacement with backup/rollback on failure
- Support for Linux, macOS, and Windows (10 platform/arch combinations)

Build and release changes:
- Dockerfile builds unified agent for all platforms
- build-release.sh includes unified agent in release artifacts
- validate-release.sh validates unified agent binaries
- Install scripts (install.sh, install.ps1) use correct URL format

Related to #727, #737
2025-11-25 23:15:03 +00:00
rcourtman
5e3f1db5b3 fix: adapt NodeSummaryTable column widths per tab context
Count columns now have appropriate widths based on their header text:
- Dashboard: VMs/CTs use compact 40-50px (short labels)
- Storage: Storage/Disks use wider 50-70px and 45-60px
- Backups: Backups uses wider 50-70px

This fixes the broken appearance on Storage and Backups tabs where
longer header text didn't fit in the narrow fixed-width columns.
2025-11-25 22:31:59 +00:00
rcourtman
e1403c719e fix: make I/O metrics reactive to WebSocket updates
The I/O columns were not updating in real-time because they accessed
props.guest directly instead of through reactive memos. This wraps
diskRead, diskWrite, networkIn, networkOut in createMemo() to properly
track changes from WebSocket data updates.
2025-11-25 21:36:27 +00:00
rcourtman
adc659b717 fix: restore intensity-based coloring for I/O columns
The I/O columns (Disk Read, Disk Write, Net In, Net Out) were showing
static gray text regardless of throughput values. This restores the
visual intensity scaling that was lost during the responsive table
refactor, where higher throughput values appear bolder/brighter to
draw attention to active I/O.

Thresholds:
- < 1 MB/s: dim gray
- 1-10 MB/s: normal gray
- 10-50 MB/s: medium weight, slightly brighter
- > 50 MB/s: semibold, white/black
2025-11-25 21:29:06 +00:00
rcourtman
daf46e0c5e fix: auto-hide sublabel when progress bar text overflows
Use ResizeObserver to track container width and estimate text width
based on character count. When the full text (percentage + sublabel)
won't fit, only the percentage is shown to prevent text clipping.
2025-11-25 20:45:11 +00:00
rcourtman
2851c3da59 feat: improve responsive table layout with tighter columns
- Add 4 separate I/O columns (D Read, D Write, N In, N Out) to guest table
- Tighten column widths: fixed-width I/O columns, flexible progress bar columns
- Remove sticky columns from NodeSummaryTable (not needed)
- Shorten "Containers" to "CTs" in node summary for consistency
- Always show full VM/LXC labels (no mobile abbreviation)
- Increase name column minWidth to 100px for mobile readability
- Add formatSpeed utility function for I/O display
- Add responsive infrastructure: useBreakpoint hook, useGridTemplate hook
2025-11-25 20:37:28 +00:00
courtmanr@gmail.com
653823f848 chore: update go.mod to make golang.org/x/sync a direct dependency 2025-11-25 17:26:44 +00:00
courtmanr@gmail.com
1716774e71 feat: adaptive node table layout, guest row fixes, and legacy agent detection
- Implemented adaptive layout for NodeSummaryTable with responsive columns and sticky name column.
- Fixed GuestRow background display issues.
- Added IsLegacy field to Host and DockerHost models to flag legacy agents (version < 1.0.0).
- Updated monitor to populate IsLegacy based on agent version.
2025-11-25 17:19:36 +00:00
courtmanr@gmail.com
6803556dec feat: auto-remove legacy agents during unified installation 2025-11-25 12:56:31 +00:00
courtmanr@gmail.com
7a204eab52 feat: add managed agents list and cleanup legacy scripts 2025-11-25 12:54:13 +00:00
courtmanr@gmail.com
92f8426ee7 feat: unify agent installation UI and scripts 2025-11-25 12:23:22 +00:00
courtmanr@gmail.com
930c086556 WIP: Save all pending changes including frontend updates and unified agent scaffolding 2025-11-25 11:27:07 +00:00
courtmanr@gmail.com
9466db4868 Register unified installer routes
Exposes /api/install/install.sh and /api/install/install.ps1 for the unified agent installer.
2025-11-25 11:25:10 +00:00
courtmanr@gmail.com
3ec7b401a3 Improve installer UX with pauses and popups on failure
Fixes #755. Adds interactive pauses and graphical popups (where available) to installer scripts when critical errors occur, ensuring troubleshooting guides are readable. Also clarifies 'build from source' instructions.
2025-11-25 11:17:37 +00:00
courtmanr@gmail.com
b524d1d79d Enhance UI responsiveness for tables: apply percentage-based widths and selective column hiding 2025-11-25 10:57:33 +00:00
courtmanr@gmail.com
71fea10aa5 Further reduce setup script verbosity: silence token checks and consolidate permission logs 2025-11-25 10:20:17 +00:00
courtmanr@gmail.com
32c1c3fac5 Suppress 'User already exists' message in setup script 2025-11-25 10:16:08 +00:00
courtmanr@gmail.com
bddb90229b Improve setup script clarity: reduce verbosity and fix confusing messages 2025-11-25 10:13:20 +00:00
courtmanr@gmail.com
0c6fd01ff2 Improve setup script output by hiding irrelevant Docker/proxy info 2025-11-25 10:01:41 +00:00
courtmanr@gmail.com
7b4152f771 chore: ignore .agent directory 2025-11-25 09:36:25 +00:00
courtmanr@gmail.com
7c69b75363 Fix checksum verification on macOS by replacing awk with grep 2025-11-25 09:36:21 +00:00
courtmanr@gmail.com
fcccee7389 Add issue triage rules 2025-11-25 09:13:44 +00:00
courtmanr@gmail.com
584ad94ee5 Refactor: Parallelize PVE node polling 2025-11-25 08:38:03 +00:00
courtmanr@gmail.com
0c4b295ac7 refactor(scripts): replace legacy install-docker-agent.sh with bundled v2 script 2025-11-25 08:36:24 +00:00
courtmanr@gmail.com
7e8d7d1b5f fix(scripts): improve checksum verification robustness against whitespace 2025-11-25 08:24:26 +00:00
courtmanr@gmail.com
f4c2bd7c35 Implement UI toggle for Hide Local Login (related to issue #750) 2025-11-25 08:14:19 +00:00
courtmanr@gmail.com
a68f2de3e6 Relax container SSH check for temperature monitoring (ref #727) 2025-11-25 08:00:08 +00:00
courtmanr@gmail.com
fd39196166 refactor: finalize documentation overhaul
- Refactor specialized docs for conciseness and clarity
- Rename files to UPPER_CASE.md convention
- Verify accuracy against codebase
- Fix broken links
2025-11-25 00:45:20 +00:00
courtmanr@gmail.com
8464a69abe Refactor remaining docs and standardize naming 2025-11-25 00:28:33 +00:00