Commit Graph

615 Commits

Author SHA1 Message Date
Pulse Monitor 005e14ed64 fix: correct node filtering logic to properly detect when filtered guests are provided 2025-08-26 11:22:53 +00:00
Pulse Monitor bb6d0ba96e feat: improve filter UX with full-width search fields and dynamic node summary filtering
- Remove max-width constraint on search fields to utilize available space
- Node summary table now updates based on search/filter criteria
- Only show nodes with matching guests when filtering is active
- Calculate node metrics based on filtered guests only
- Show matched guest count in node summary when filtering
- Provides better visual feedback on what the filters are affecting
2025-08-26 11:18:44 +00:00
Pulse Monitor 33a95de264 feat: add mock data system for UI testing (partial integration)
- Created comprehensive mock data generator for nodes, VMs, containers
- Added toggle scripts for easy switching between real and mock mode
- Integrated with backend-watch.sh for auto-rebuild with mock support
- Modified monitor to skip polling when mock mode is enabled
- Added CLAUDE.md documentation for future sessions

Note: Mock system initializes but data isn't fully integrated with GetState() yet.
Currently shows mixed real + mock data. Works for UI testing purposes.
2025-08-26 07:56:15 +00:00
Pulse Monitor 45ee845b8a fix: enable node click filtering for any number of nodes
addresses #356 - node click filtering now works with:
- 1-4 nodes (regular cards - already worked)
- 5-9 nodes (compact cards - now fixed)
- 10+ nodes (ultra-compact list - now fixed)

clicking any node box filters VMs to that node only, regardless of how many nodes are displayed
2025-08-25 21:50:47 +00:00
Pulse Monitor 25dbc0a689 feat: add dual authentication for setup scripts
- Setup scripts now accept both temporary setup codes and permanent API tokens
- Setup codes (6 chars): For manual setup by others, expire in 5 minutes
- API tokens: For automation and trusted environments, no expiration
- Modified auto-registration endpoint to accept API tokens directly
- Fixed JSON escaping issues with exclamation marks in bash scripts
- Updated README with clear documentation of both authentication methods
- Discovery modal now shows cached results immediately while scanning

This enables both secure manual setup (via temporary codes) and reliable
automation (via API tokens) without compromising security.
2025-08-25 21:47:48 +00:00
Pulse Monitor 81446f64b3 fix: discovery endpoint now properly handles both GET and POST requests
The discovery functionality was broken because the router was using a
simple GET-only handler instead of the complete HandleDiscoverServers
function that supports both GET (cached results) and POST (manual scans
with subnet parameters).

Changes:
- Updated router to use configHandlers.HandleDiscoverServers instead of r.handleDiscovery
- Removed the redundant handleDiscovery function
- Discovery endpoint now supports both GET and POST methods as expected by frontend
- Added proper authentication requirement for discovery endpoint

This addresses the discovery being broken in the latest RC releases.
2025-08-25 16:37:22 +00:00
Pulse Monitor 30c0ecdbb6 chore: bump version to v4.9.0-rc.1 2025-08-25 15:44:42 +00:00
Pulse Monitor 45541b4e6b feat: add comprehensive VM disk monitoring diagnostics
Added detailed VM disk monitoring checks to the diagnostics page:
- Tests actual guest agent connectivity for each node
- Shows how many VMs have agents configured vs working
- Performs a detailed test on one VM and reports the result
- Provides specific recommendations based on the error encountered
- Shows SUCCESS when disk monitoring is working properly

This helps users quickly identify why VM disk monitoring might not be working:
- Guest agent not installed/running
- Permission issues with API tokens
- VM configuration problems

The diagnostics clearly show when everything is working (like the delly.lan cluster showing 19.3% disk usage) vs when there are issues to resolve.
2025-08-25 15:34:05 +00:00
Pulse Monitor 73d969d746 fix: correct VM disk monitoring documentation for PVE 9
TESTED AND CONFIRMED: API tokens CAN access guest agent data on PVE 9!
- Created test tokens and verified they work
- Guest agent API returns proper disk usage data
- The cluster/resources endpoint shows disk=0 but that's not what Pulse uses
- Pulse correctly fetches data via /nodes/{node}/qemu/{vmid}/agent/get-fsinfo

The misinformation about PVE 9 not working was completely wrong. It does work when properly configured with PVEAuditor role which includes VM.GuestAgent.Audit permission.
2025-08-25 15:25:10 +00:00
Pulse Monitor a421cebbe7 docs: provide honest assessment of PVE 9 VM disk monitoring
Stop making definitive claims about what works or doesn't work. The reality:
- Some users (like you) have it working fine in cluster configs
- Others report 0% disk usage
- The exact conditions that make it work are unclear
- Results vary between different setups

Updated all docs and messages to reflect this uncertainty rather than making false claims about non-existent workarounds or absolute limitations.
2025-08-25 15:20:34 +00:00
Pulse Monitor 57649c8bc4 fix: correct the misinformation about PVE 9 VM disk monitoring
Previous advice was completely wrong. The facts:
- VM.Monitor permission doesn't exist in PVE 9 (was removed)
- It was replaced with VM.GuestAgent.Audit
- But even with correct permissions, API tokens CANNOT access guest agent data on PVE 9
- This is Proxmox bug #1373 with NO working workaround for API tokens
- Users must accept 0% VM disk usage on PVE 9 until Proxmox fixes it upstream

Updated all documentation and error messages to reflect this reality instead of giving false hope about non-existent workarounds.
2025-08-25 15:04:41 +00:00
Pulse Monitor d3b6ecd548 fix: remove misleading root@pam authentication advice
The root@pam suggestion doesn't actually work since it requires the Linux system root password, not a Proxmox-specific password. Most users don't know or have disabled their Linux root password for security.

Updated all documentation and error messages to correctly advise users to grant VM.Monitor permission to their API token user instead.
2025-08-25 14:59:37 +00:00
Pulse Monitor 67486d75f7 fix: implement batch toggle operations to prevent state sync issues
addresses #349 - fixed the issue where toggling all Proxmox Node alerts would skip some nodes on subsequent clicks. The problem was that multiple toggle operations in a loop were reading from the same state snapshot.

- implemented batchToggleNodeConnectivity and batchToggleDisabled functions
- these functions collect all changes and apply them atomically
- ensures all resources are properly toggled to the target state
- fixes the issue where individual nodes (like 'pi') weren't toggling correctly
2025-08-25 14:41:26 +00:00
Pulse Monitor 000f125f01 fix: correct batch toggle logic for Proxmox Nodes alerts
fixed issue where toggling all alerts for Proxmox Nodes would skip some nodes on the second click. The logic now properly checks each node's current state and only toggles those that need to change to reach the target state.
2025-08-25 14:33:41 +00:00
Pulse Monitor b43c95c488 feat: add batch toggle for alerts in Thresholds tab
addresses #349 - adds a toggle button in the Alerts column header that allows users to enable/disable all alerts for a resource type with one click. This is especially helpful when managing many VMs, containers, or storage devices.

- added toggle icon in Alerts column header for VMs & Containers, Storage, and Nodes tables
- icon shows current state (eye for enabled, eye-slash for disabled)
- clicking toggles all resources in that table between enabled/disabled
- for nodes, toggles connectivity alerts instead of general disable flag
2025-08-25 14:29:35 +00:00
Pulse Monitor 24671c28a4 fix: prevent duplicate node names in alert IDs for single-node setups
When the instance name equals the node name (common in single-node setups),
avoid generating redundant IDs like "pve-pve-100" by using just "pve-100".
This fixes alert acknowledgment issues where the UI couldn't match alert
IDs due to the duplicate node name pattern.

Addresses #353
2025-08-25 14:11:58 +00:00
Pulse Monitor ab1bee76ac feat: add --reset and --uninstall options to install script
The install script now provides convenient management options:
- --reset: Stops Pulse, removes config/data, restarts with fresh config
- --uninstall: Completely removes Pulse from the system

Also simplified the post-install message to show these one-liner commands instead of listing manual steps.
2025-08-25 14:01:59 +00:00
Pulse Monitor 749efa1b18 fix: install script no longer crashes when comparing RC versions
The version comparison function was attempting numeric comparisons on version parts containing RC suffixes (e.g., "0-rc" from "4.8.0-rc.2"), causing an "unbound variable" error due to set -u.

Now properly strips and handles pre-release suffixes separately, allowing correct comparison of RC versions.

Addresses discussion #344 comment from RLSinRFV
2025-08-25 13:55:17 +00:00
Pulse Monitor 2b6efcef0c security: comprehensive security improvements
- Add authentication requirement to diagnostics endpoint
- Implement persistent session storage to survive restarts
- Strengthen recovery mechanism with cryptographic tokens
- Add consistent rate limiting across all API endpoints
- Implement persistent CSRF token storage
- Tighten WebSocket origin validation with proper IP checks
- Remove sensitive data exposure from diagnostics

addresses multiple security audit findings
2025-08-25 11:28:55 +00:00
Pulse Monitor 1bbf88297e fix: remove redundant setup code display when token is embedded in URL
The setup code section in the modal is no longer shown when the auth token
is already embedded in the setup script URL. Since the token is included
as auth_token parameter, there's no need for users to see or enter it.
2025-08-25 09:40:45 +00:00
Pulse Monitor 99cef1584e improve: add reset and removal instructions to install script completion message
Users now see clear instructions for:
- Resetting configuration to start fresh (keeping Pulse installed)
- Complete removal of Pulse (uninstall everything)

This helps users who need to troubleshoot or start over with a clean slate.
2025-08-25 09:36:39 +00:00
Pulse Monitor a94a2ecdb3 chore: bump version to v4.8.0-rc.2 2025-08-25 09:17:57 +00:00
Pulse Monitor 74001848e5 docs: add troubleshooting for root@pam users still seeing 0% disk usage 2025-08-25 09:14:21 +00:00
Pulse Monitor 704ae106ea improve: add better diagnostics for guest agent issues
- Add verification steps for qemu-guest-agent service status
- Clarify that the service is socket-activated (not systemctl enable)
- Add diagnostic commands users can run to verify agent is working
- Update FAQ with correct troubleshooting steps for agent issues

This helps users like @RLSinRFV who were trying to enable the service
when it's actually socket-activated and should start automatically.
2025-08-25 09:12:25 +00:00
Pulse Monitor 5fe67447dd fix: correct VM disk monitoring guidance for PVE 8 users
The real issue for PVE 8 users seeing 0% disk usage:
- Users who added nodes BEFORE v4.7 don't have VM.Monitor permission
- The setup script always created tokens with privsep=0, so that wasn't the issue
- Solution: Re-run the setup script or manually add VM.Monitor permission

Updated error messages and documentation to reflect the actual cause
and provide the correct fix for users experiencing this issue.
2025-08-25 09:07:22 +00:00
Pulse Monitor b53d9070ba improve: clearer VM disk monitoring error messages (addresses #348, #344)
- Add detailed logging when VM disk monitoring fails due to permissions
- Explain Proxmox 9 limitation: API tokens cannot access guest agent data (PVE bug #1373)
- Explain Proxmox 8 requirements: VM.Monitor permission and privsep=0 for tokens
- Update setup script to show appropriate warnings for each PVE version
- Update FAQ with troubleshooting steps for 0% disk usage on VMs
- Log messages now clearly indicate workarounds for each scenario

The core issue: Proxmox 9 removed VM.Monitor permission and the replacement
permissions don't allow API tokens to access guest agent filesystem info.
This is a Proxmox upstream bug that affects their own web UI as well.

For users experiencing this issue:
- PVE 9: Use root@pam credentials or wait for Proxmox to fix upstream
- PVE 8: Ensure token has VM.Monitor and privsep=0
- All versions: QEMU guest agent must be installed in VMs
2025-08-25 09:00:40 +00:00
Pulse Monitor 4631c9fea3 docs: remove unnecessary sudo from install commands
- LXC containers run as root and don't have sudo installed
- Updated all documentation to remove sudo references
- Updated frontend UI to show correct install command
- Keep sudo mention only in troubleshooting for edge cases
2025-08-24 22:56:21 +00:00
Pulse Monitor 5a21341920 improve: storage pool display now shows available space in GB
- Changed from showing just percentage to "X.X GB free of Y.Y GB (Z% used)"
- Much more useful for users to see actual available space
- Applies to both Quick and Advanced installation modes
2025-08-24 22:52:25 +00:00
Pulse Monitor 60e4c4db94 fix: document PVE 9 VM disk monitoring limitation properly
addresses #348

After extensive testing and research:

CONFIRMED: This is a Proxmox 9 API limitation, not a configuration issue
- Guest agent get-fsinfo works when called as root (qm agent <vmid> get-fsinfo)
- API tokens CANNOT access this data even with VM.GuestAgent.Audit permission
- Proxmox's own web UI also shows 0% for VM disk usage (bug #1373)

Updated:
- Setup script now clearly explains this is a known Proxmox limitation
- Changed log level from Warn to Debug for permission errors (expected on PVE 9)
- Added references to Proxmox bug #1373

Workarounds for users:
1. Use root@pam credentials instead of API tokens for full VM disk monitoring
2. Container (LXC) disk usage works correctly with tokens
3. Wait for Proxmox to fix this upstream

The guest agent returns the data (total-bytes, used-bytes) but Proxmox's
API doesn't allow token access to it. This is not something we can fix
in Pulse - it needs to be addressed in Proxmox itself.
2025-08-24 22:44:16 +00:00
Pulse Monitor e131924bfe improve: clarify PVE 9 guest agent limitations in setup script
addresses #348

After testing on actual PVE 9.0.5 nodes:
- Confirmed VM.Monitor privilege was removed in PVE 9
- PVEAuditor role includes VM.GuestAgent.Audit permission
- Added Sys.Audit permission (replacement for VM.Monitor)
- Added clear warning about known PVE 9 guest agent limitations

The issue appears to be a Proxmox 9 limitation where even with correct
permissions (VM.GuestAgent.Audit + Sys.Audit), the guest agent API may
not return disk usage data for non-root tokens. This is likely a bug or
intentional security restriction in Proxmox 9 that needs to be addressed
upstream.

Updated setup script to:
1. Properly detect PVE 9 and add appropriate permissions
2. Warn users about the known limitation
3. Suggest workarounds (using root credentials if needed)
2025-08-24 22:33:02 +00:00
Pulse Monitor 5a27ce713e fix: improve PVE 9 guest agent permissions handling
addresses #348

- Updated setup script to properly detect and handle Proxmox 9 where VM.Monitor was removed
- For PVE 9+, now creates custom role with Sys.Audit permissions (replaces VM.Monitor)
- Attempts to add VM.Agent or Sys.Modify permissions for better guest agent access
- Added better error logging to identify permission issues with guest agent API
- Warns users about PVE 9 permission requirements if disk usage shows 0%

The setup script now:
1. Properly detects PVE version using pveversion command
2. Creates appropriate roles based on PVE version (VM.Monitor for PVE 8, Sys.Audit for PVE 9)
3. Provides clear instructions if guest agent access still doesn't work
2025-08-24 22:24:34 +00:00
Pulse Monitor 1c7b782b7f fix: apply security headers middleware to enable iframe embedding
The SecurityHeaders middleware was not being applied to the router,
causing the "Allow iframe embedding" setting to not take effect.
This fix properly applies the middleware with the saved settings,
allowing iframe embedding to work when enabled.

addresses #351
2025-08-24 19:00:13 +00:00
Pulse Monitor 3e1a34b2c8 improve: always prompt for network and storage in quick mode
addresses #352

quick mode now:
- shows available network bridges and prompts for selection
- shows available storage pools with usage info and prompts for selection
- properly handles cases where defaults (vmbr0, local-lvm) don't exist
- gives clear error messages when no bridges or storage pools are found

this ensures users always see what's available and can make informed choices
even in quick mode, preventing installation failures due to missing defaults
2025-08-24 17:00:33 +00:00
Pulse Monitor 6ed2a23541 fix: improve network bridge detection in install.sh
addresses #352

the installer now:
- detects the actual default network interface (not just vmbr*)
- uses the first available bridge if default isn't a bridge
- prompts user to select a bridge when vmbr0 doesn't exist
- shows helpful messages when no bridges are detected

this fixes issues on systems with non-standard network configurations
where vmbr0 doesn't exist or isn't the default gateway
2025-08-24 16:44:58 +00:00
Pulse Monitor a5c8021cb1 fix: ensure RC version variable is properly initialized
Initialize RC_VERSION to empty string before assignment to prevent
'unbound variable' errors when running with set -u. This ensures
the RC update option is shown when running a stable version.
2025-08-24 16:16:48 +00:00
Pulse Monitor 1ad1315e01 fix: install script now correctly detects RC/pre-release versions
The version detection regex now captures the full version string including
pre-release suffixes like -rc.1, -beta.2, etc. This prevents the script
from offering to update to a version that's already installed.
2025-08-24 16:09:10 +00:00
Pulse Monitor a2b81a1e26 fix: install script menu selection now works correctly when piped through curl
- Fixed safe_read function to properly handle TTY availability
- Added proper error handling for compare_versions return codes
- Script no longer exits silently when selecting menu options
2025-08-24 16:01:42 +00:00
Pulse Monitor 1c175d4e07 fix: menu options now actually execute instead of silently exiting
The update and reinstall cases in the menu were missing exit statements,
causing the script to continue running after completion and hit the fresh
install path. This made it appear as if nothing happened when selecting
menu options.

Added exit 0 after print_completion for both update and reinstall cases.
Removed debug output now that the issue is resolved.
2025-08-24 15:37:16 +00:00
Pulse Monitor 8d023bdad3 debug: add more detailed debug output for RC version selection
Adding debug to understand why RC version selection isn't working
2025-08-24 15:29:22 +00:00
Pulse Monitor 319b19d593 debug: add debug output to diagnose menu selection issue
Temporarily adding debug output to understand why menu selections aren't working
when the script is piped through curl.
2025-08-24 15:27:10 +00:00
Pulse Monitor cb11ffb221 fix: menu selection not working when script is piped through curl
- Simplified safe_read function to properly handle TTY input when script is piped
- Added error check if no option is selected

The menu now correctly reads user input when running:
curl -sSL .../install.sh | bash
2025-08-24 15:21:16 +00:00
Pulse Monitor a24e9f5216 fix: install script no longer prompts for port during updates
The script now properly detects update scenarios by checking for:
- Existing binary at /opt/pulse/bin/pulse or /opt/pulse/pulse
- Existing config directory at /etc/pulse
- --version flag being specified

This prevents the annoying port prompt when running updates or installing specific versions.
2025-08-24 15:16:46 +00:00
Pulse Monitor d1e992c076 chore: bump version to v4.8.0-rc.1 2025-08-24 15:02:39 +00:00
Pulse Monitor d800f94df4 feat: add iframe embedding support for dashboard integration
Addresses #222 - Allow Pulse to be embedded in iframes (e.g., Homepage dashboard)

- Add AllowEmbedding and AllowedEmbedOrigins settings to SystemSettings
- Update security headers to respect embedding configuration
  - When disabled: X-Frame-Options: DENY, frame-ancestors 'none'
  - When enabled (same-origin): X-Frame-Options: SAMEORIGIN, frame-ancestors 'self'
  - When enabled with origins: Adds specified origins to frame-ancestors
- Add UI controls in Settings → System → Network Settings
- Properly handle CSP frame-ancestors directive for cross-origin embedding

Users can now enable iframe embedding and specify allowed origins for embedding Pulse in Homepage or other dashboard applications.
2025-08-24 14:59:58 +00:00
Pulse Monitor f297dcf5d7 fix: don't show update option when already on that version
The menu now only shows update options for versions different from
the currently installed version. This prevents confusing situations
where users can 'update' to the version they already have.
2025-08-24 09:13:21 +00:00
Pulse Monitor f0214c0202 improve: suppress noisy output during installation
- Redirect apt-get update/install stderr to /dev/null to hide GPG warnings
- Suppress systemctl enable output (Created symlink message)
- Suppress systemctl daemon-reload output
- Makes the installation output cleaner and less scary for users
2025-08-24 09:10:28 +00:00
Pulse Monitor de536b5eae improve: make uninstall process more thorough
The remove option now:
- Removes symlink at /usr/local/bin/pulse
- Asks before removing config/data in /etc/pulse
- Asks before removing the pulse user account
- Cleans up log files
- Removes all possible service file variations
- Runs systemctl daemon-reload after service removal
2025-08-24 08:56:56 +00:00
Pulse Monitor 0f535894f2 fix: handle non-zero return codes from compare_versions in install script
The install script was exiting when --version flag was used due to set -e
and compare_versions returning 2 for downgrades. Now properly captures
the return value and also detects the correct service name.
2025-08-24 08:36:16 +00:00
Pulse Monitor b4ed146e00 feat: add sanitized export option for sharing diagnostics on GitHub
Added two export options in Settings > System:
- Export Full: Complete diagnostic data for private troubleshooting
- Export for GitHub: Sanitized version with redacted sensitive information

The sanitized export:
- Replaces IP addresses with xxx.xxx.xxx.xxx (keeping first octet for context)
- Replaces hostnames with generic names (keeping .lan/.local suffix)
- Redacts API token names and cluster names
- Adds a notice that data has been sanitized
- Filenames clearly indicate 'sanitized' vs 'full'

This allows users to safely share diagnostic data on public GitHub issues
without exposing their network topology or internal naming conventions.
2025-08-24 08:12:13 +00:00
Pulse Monitor 4e16c14cc9 feat: add comprehensive diagnostics for VM guest agent disk usage issues
Improved logging to help users diagnose why VM disk usage might not be showing:
- Clearly identify when agent is enabled in config but not running in guest OS
- Detect timeout issues with unresponsive agents
- Log when agent returns no filesystem info
- Show which filesystems are included/excluded from calculations
- Distinguish between no agent, agent not running, and agent working

This will help users understand exactly why their VM disk usage isn't showing
and what steps they need to take to fix it (install qemu-guest-agent, restart
the service, etc).

addresses discussion #344
2025-08-24 08:04:13 +00:00