Commit graph

166 commits

Author SHA1 Message Date
Pulse Monitor
e66b74ee65 fix: allow password changes when behind proxy Basic Auth (addresses #407)
The password change endpoint now handles both scenarios:
- Direct auth: Uses Authorization header when it contains Pulse credentials
- Proxy auth: Uses currentPassword from JSON body when behind proxy Basic Auth
- Prevents proxy auth from interfering with Pulse's own authentication
- Maintains security by always requiring current password verification
2025-09-04 19:42:49 +00:00
Pulse Monitor
635d7c06f4 fix: resolve webhook JSON parsing errors for all services
- Fixed SendEnhancedWebhook to use service-specific payload generation
- Test webhooks now properly skip template-syntax headers
- ntfy and other plain text services correctly skip JSON validation
- Prevents 'invalid character' errors when testing webhooks
- All webhook payload generation now respects service type
2025-09-04 18:55:23 +00:00
Pulse Monitor
4574dad237 fix: resolve 404 error when updating or deleting webhooks
- Fixed webhook ID extraction in UpdateWebhook and DeleteWebhook handlers
- Previous code expected 5 URL parts but path only had 2 after prefix stripping
- Now correctly extracts webhook ID from /api/notifications/webhooks/{id}
- Resolves frontend error when saving webhook changes
2025-09-04 18:24:02 +00:00
Pulse Monitor
83862eb817 fix: set Online status for mock cluster endpoints
Mock cluster endpoints were showing grey dots because the Online field
wasn't being set based on the node status. Now properly reflects the
node's online/offline status with green/grey indicators.
2025-09-04 15:29:42 +00:00
Pulse Monitor
0a66bffb58 fix: alert acknowledgment routing path mismatch (addresses #380)
The acknowledge/unacknowledge/clear endpoints were returning 404 due to incorrect path trimming in HandleAlerts. The router was registered with /api/alerts/ but the handler was trimming /api/alerts, causing path parsing to be off by one character.
2025-09-04 13:06:15 +00:00
Pulse Monitor
69598d62f6 enhance: improve mock data realism and alert system
- Add dynamic metric fluctuations for VMs and containers in mock data
- Fix alert acknowledgment to dim instead of hide alerts
- Implement unacknowledge functionality with backend persistence
- Simplify alert UI to single-click toggle (remove selection system)
- Add proper hysteresis for alert resolution when metrics drop
- Fix SVG icon boundaries in alert displays
- Add webhook disable toggles for testing without notifications
- Fix frontend directory duplication issue (addresses frontend-modern recreation)
- Improve alert sorting to show most recent first
- Make mock system generate realistic metric changes for proper alert lifecycle
2025-09-02 21:11:01 +00:00
Pulse Monitor
21d784164a fix: tag indicators now only show for guests that actually have tags
- Added ToFrontend() method to StateSnapshot for proper data conversion
- Modified /api/state endpoint to use frontend-formatted data
- Enhanced WebSocket store to handle tag data transformation consistently
- Ensures tags are properly converted between backend strings and frontend arrays
2025-08-31 18:01:47 +00:00
Pulse Monitor
426f4b274e fix: prevent mock mode from wiping production node configuration
Mock mode was inadvertently clearing real node configuration when toggling.
Added protection to prevent SaveNodesConfig from modifying nodes.enc when
in mock mode. Mock and production data are now completely separated.
2025-08-31 16:48:52 +00:00
Pulse Monitor
68801366d3 fix: properly handle alert IDs with special characters in acknowledge/clear endpoints (addresses #380)
Alert IDs like 'pve1:qemu/101-cpu' contain slashes which were breaking the URL path parsing.
Fixed by finding the /acknowledge or /clear suffix and extracting everything before it,
rather than trying to split by slashes.
2025-08-31 16:24:08 +00:00
Pulse Monitor
903581f66d fix: alert acknowledgement URL parsing (addresses #380)
The acknowledge and clear alert endpoints were incorrectly parsing the alert ID from the URL path, causing 404 errors. Fixed the path extraction logic to properly handle the /api/alerts/{id}/acknowledge pattern.
2025-08-31 16:16:36 +00:00
Pulse Monitor
bb715e1f3e fix: add missing base64 import for password change handler 2025-08-31 08:50:48 +00:00
Pulse Monitor
72ab5d1782 fix: password change functionality now properly validates current password (addresses #396)
The change password feature was not working because the backend wasn't
actually verifying the current password before allowing changes. Fixed both
frontend and backend issues:

- Frontend now uses the correct username from localStorage
- Backend now properly validates the current password before allowing change
- Added proper security checks to prevent unauthorized password changes
2025-08-31 08:36:00 +00:00
Pulse Monitor
395a0c3e90 fix: broadcast state updates after alert acknowledgment (addresses #380)
- Add WebSocket hub reference to AlertHandlers
- Broadcast state after acknowledge, clear, and bulk operations
- Ensures UI acknowledgment counts update immediately without refresh
- Fixes issue where acknowledgment would disappear after 2 seconds
2025-08-31 06:58:10 +00:00
Pulse Monitor
1c7cca3c6c fix: detect HTTPS protocol when behind reverse proxy for setup scripts
addresses #394 - setup script now correctly uses https:// in generated commands
when Pulse is running behind an HTTPS reverse proxy like Traefik by checking
the X-Forwarded-Proto header
2025-08-30 22:48:53 +00:00
Pulse Monitor
197d56c1e6 fix: enforce admin privileges for proxy auth users on write operations
addresses GHSA-wmgw-3g78-89xf - proxy authenticated non-admin users now properly receive 403 Forbidden when attempting write operations

- Added RequireAdmin middleware to check proxy auth admin role
- Applied admin checks to node add/update/delete operations
- Applied admin checks to system settings updates
- Applied admin checks to export/import operations
- Applied admin checks to API token regeneration
- Applied admin checks to password changes
- Non-admin proxy auth users now have proper read-only access as documented
2025-08-30 22:30:59 +00:00
Pulse Monitor
87ef949e1b feat: improve screenshots and mobile UI responsiveness
- Update screenshot tool to use MacBook Air resolution (2560x1600)
- Remove empty side borders from screenshots
- Use mock data for all screenshots for privacy
- Fix mobile alert buttons overflowing viewport
- Exempt localhost from API rate limiting for better dev experience
- Update documentation to showcase all features with screenshots
- Reorganize README visual tour into feature sections
2025-08-30 12:25:53 +00:00
Pulse Monitor
9c9da31bf2 feat: improve documentation with high-quality screenshots and mock alert history
- Add high-quality screenshots with 3x device scale factor for crisp text
- Implement mock alert history generator spanning 90 days
- Update documentation with detailed screenshot descriptions
- Add visual tour section to README with key screenshots
- Fix mock mode to properly separate from production data
- Clean up screenshot script to use actual mock data instead of DOM injection
- Enhance FAQ and webhooks docs with relevant screenshots
2025-08-30 11:13:41 +00:00
Pulse Monitor
307923dc8b fix: only apply dev IP workaround when .dev-mode file exists 2025-08-29 16:41:18 +00:00
Pulse Monitor
d7b0b69969 fix: hardcode dev IP for setup script URLs when proxied through vite 2025-08-29 16:34:16 +00:00
Pulse Monitor
91adcbf3f0 fix: address intermittent configuration display issue (#372)
- Increased rate limits for configuration GET endpoints to prevent 429 errors
- Added automatic retry logic for rate-limited requests with exponential backoff
- Added small delays between initial API calls to prevent burst requests
- Configuration read endpoints now use PublicEndpoints limit (1000/min vs 500/min)

This should resolve the issue where the configuration page sometimes shows
no information and prompts for system setup even when it's already configured.
2025-08-28 17:32:29 +00:00
Pulse Monitor
a4dfd747b9 feat: enhance diagnostics to show detailed VM disk monitoring issues
- show which specific VMs have disk monitoring problems
- list filesystem details showing what's filtered and why
- provide actionable info for troubleshooting guest agent issues
- addresses #367 by giving users better debugging information
2025-08-28 12:48:42 +00:00
Pulse Monitor
4f1f77e0ae fix: improve error handling for node connection tests (addresses #362, #363)
- Handle standalone nodes properly in diagnostics (fixes #362)
  - Try /nodes endpoint first which works for both clustered and standalone
  - Make cluster status optional, not required for connection success
  - Set cluster node count to 1 for standalone nodes

- Fix test connection UI showing success styling on errors (fixes #363)
  - Return proper HTTP error status when test-config endpoint fails
  - Clean up error messages to remove "API request failed: XXX" prefix
  - Add debug logging to trace test result states
  - Ensure consistent error status codes from all test endpoints

Both issues reported connection problems - standalone nodes failing to connect
and error messages appearing with success styling. These fixes ensure proper
handling of both scenarios.
2025-08-28 11:56:02 +00:00
Pulse Monitor
63f18afdef fix: iframe embedding checkbox persistence and functionality (addresses #351)
- Fixed /api/config/system endpoint to return all persisted settings fields including allowEmbedding, discoveryEnabled, and allowedEmbedOrigins
- Added comprehensive input validation for all settings with proper min/max bounds
- Fixed security headers to properly allow/deny iframe embedding based on user preference
- Added real bug detection test suite that validates behavior, not just status codes

The iframe embedding checkbox now properly persists its state and actually controls whether Pulse can be embedded in iframes. When enabled, removes X-Frame-Options header and sets CSP frame-ancestors to allow embedding.
2025-08-28 09:17:54 +00:00
Pulse Monitor
2e41532d48 feat: improve account lockout mechanism with recovery options
addresses #360

- Add detailed lockout feedback in login API responses showing remaining attempts
- Display lockout warnings in the frontend with attempt counters
- Show time remaining when account is locked (15 minute lockout duration)
- Add visual indicators (lock icon) for lockout status
- Implement /api/security/reset-lockout endpoint for admin recovery
- Store lockout information with expiration tracking
- Provide clear user guidance about lockout duration and recovery
2025-08-27 21:43:25 +00:00
Pulse Monitor
dfe1435681 fix: remove incorrect container check from PBS setup script
PBS often runs in Docker containers, so the container check was preventing
legitimate setups. Also fixed the script to check for proxmox-backup-manager
instead of pveum (which is PVE-only).
2025-08-27 13:39:11 +00:00
Pulse Monitor
e36436f75b fix: add comprehensive input validation for API endpoints
- Added required field validation for name, type, and host in node configuration
- Added duplicate node prevention by name (returns 409 Conflict)
- Added IP address format validation to reject invalid IPs
- Added port range validation (1-65535)
- Added validation for negative polling intervals in system settings
- Added HEAD request support for health and version endpoints
- Reduced node addition timeout from 10s to 3s to prevent UI hanging

These validation improvements were discovered through comprehensive testing
and prevent invalid data from being accepted by the API.
2025-08-27 11:07:39 +00:00
Pulse Monitor
8aecff66a2 fix: remove all VM disk monitoring mentions from setup script (addresses #348)
The setup script no longer mentions VM disk monitoring at all, as requested.
This avoids confusion about what works or doesn't work on different
Proxmox versions. The permissions are still set up correctly behind
the scenes, but users don't need to see confusing information about it.
2025-08-26 23:03:00 +00:00
Pulse Monitor
5d99d2c3bd fix: correct misleading PVE 9 VM disk monitoring message (addresses #348)
The setup script was incorrectly claiming that VM disk monitoring works
on Proxmox 9 with API tokens. This is not true due to an upstream
Proxmox limitation where API tokens cannot access guest agent data
even with the correct permissions.

Updated the setup script to clearly explain:
- This is a known Proxmox 9 limitation, not a Pulse issue
- API tokens are blocked from accessing get-fsinfo
- Available workarounds (use root@pam or wait for upstream fix)
- Link to issue #348 for full context

This should prevent further confusion for users running Proxmox 9.
2025-08-26 22:58:21 +00:00
Pulse Monitor
34b3ccdab7 fix: node summary tables now appear on initial page load
- Fixed reactivity issue where PVE node tables weren't showing on hard refresh
- Removed component re-mounting caused by IIFE wrapper in App.tsx
- Added text truncation with ellipsis to prevent row height changes
- Fixed table visibility to properly hide when filtering excludes all nodes
- Added cache-busting headers to ensure browser loads latest JS/CSS files
2025-08-26 16:27:19 +00:00
Pulse Monitor
063cd670a6 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
aa3044d487 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
c9f7ad6487 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
8dde3172ce 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
da745b0d88 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
35cecd475a 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
6f86ad5b7f 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
6fd96d7bed 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
47f8da8782 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
3ad51a43d8 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
04809119d7 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
4675b5bf92 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
6c4a931a65 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
ac82a0e679 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
2ae72e2490 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
9624d913d1 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
b49fe83d21 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
346c736112 fix: auto-registration now works with secured Pulse instances
The temporary auth tokens generated by authenticated users are now properly
validated even when Pulse has authentication enabled. This fixes the issue
where fresh installs (which are secured by default) couldn't use the
auto-registration feature.
2025-08-23 22:47:30 +00:00
Pulse Monitor
3f8f1f7899 refactor: simplify setup flow by removing setup code prompts
Replaced the two-step setup code process with a simpler token-in-URL approach:
- Auth token is now embedded directly in the setup URL
- No more prompting users for setup codes
- Same security level with better UX
- Backwards compatible with old setupCode field

The new flow generates a command like:
curl -sSL "http://pulse/api/setup-script?...&auth_token=TOKEN" | bash

This makes it much easier for users, especially in Proxmox shell where
interactive prompts can be problematic.
2025-08-23 22:16:01 +00:00
Pulse Monitor
60b0ebc852 improve: include setup code in command for easy Proxmox shell usage
- The generated command now includes PULSE_SETUP_CODE environment variable
- Users can simply copy-paste the command in Proxmox shell without needing to type the code
- Makes the setup process more streamlined for the primary use case
2025-08-23 21:54:14 +00:00
Pulse Monitor
f6a451be94 fix: improve setup code validation and environment variable handling
- Remove host validation from setup code authentication (only validate node type)
- Fix environment variable handling to check PULSE_SETUP_CODE before prompting
- Addresses issue where auto-registration failed with valid setup codes
2025-08-23 21:31:57 +00:00