Commit graph

91 commits

Author SHA1 Message Date
Pulse Monitor
46a697613a fix: remove sensitive data from logs
Updated logging to exclude request bodies that may contain passwords
or other sensitive information. Now only logs metadata about requests
without exposing actual credentials.
2025-08-12 08:41:17 +00:00
Pulse Monitor
7dbcb5461c fix: addresses #299 - email notifications not working
Fixed two critical issues with email notifications:
1. Test email API now returns errors properly instead of always showing success
2. Added timeouts to SMTP connections to prevent hanging (10s dial, 30s overall)

The root cause of users not receiving emails was that errors were being
silently logged instead of returned to the API, making it appear successful
when it wasn't. SMTP connections could also hang indefinitely on unreachable
servers.

Note: API uses "server" and "port" JSON fields, not "smtpHost"/"smtpPort"
2025-08-12 08:04:04 +00:00
Pulse Monitor
c111738825 chore: bump version to v4.2.0 2025-08-11 16:05:09 +00:00
Pulse Monitor
9f6a3d1b5f fix: multiple UI and configuration issues (addresses #295, #296)
Frontend fixes:
- Fixed VM thresholds incorrectly showing as 'CT' in alerts UI (issue #295)
- Fixed threshold slider not reaching 0% and 100% edges (issue #295)
- Fixed PBS form auto-filling with PVE settings (issue #296)
- Fixed email config property mapping (server/port instead of smtpHost/smtpPort)

Backend fixes:
- Updated EmailConfig struct to use 'server' and 'port' JSON tags for consistency
- Added 'provider' and 'startTLS' fields to EmailConfig
- Fixed PORT env var to correctly set FrontendPort instead of BackendPort
- Changed default log level from Debug to Info

All changes tested and verified working correctly.
2025-08-11 15:29:53 +00:00
Pulse Monitor
378ebcb250 Major improvements to security, alerts, and ease of use
Security enhancements:
- Fixed critical issue: PBS tokens no longer logged in plaintext
- PVE tokens now properly masked in all log outputs
- Enhanced token security documentation

Alert system fixes:
- Fixed storage alerts not working due to threshold being 0
- Added automatic defaults preservation for alert thresholds
- Storage alerts now properly trigger at 85% usage

Node management improvements:
- Fixed node deletion causing 'Node not found' errors
- Added instant discovery refresh when nodes are deleted
- Added manual refresh buttons for discovery
- Fixed PBS token cleanup in auto-registration scripts
- Fixed /dev/tty errors when running scripts in Docker containers

Bug fixes:
- Fixed CPU MHz field type mismatch causing JSON unmarshal errors
- Suppressed non-critical container snapshot API errors
- Fixed auto-registration using Docker internal IPs instead of actual host IPs

Documentation updates:
- Added comprehensive security documentation
- Streamlined setup documentation focusing on ease of use
- Removed marketing language and consolidated repetitive content

Frontend improvements:
- Added WebSocket support for real-time node updates
- Added discovery refresh buttons in Settings
- Improved node deletion feedback
2025-08-11 13:59:58 +00:00
Pulse Monitor
161bbf5ec4 fix: exclude ct templates and isos from backup tab (fixes #265)
- filter out vztmpl (container templates) from backup list
- filter out iso files from backup list
- only show actual vm/container backups in the backup tab
- remove unnecessary checks for template/iso content types
2025-08-11 10:13:12 +00:00
Pulse Monitor
0491abf885 fix: prevent cpu alerts for non-running vms and containers (fixes #273)
- check if vm/container status is "running" before using cpu value
- set cpu to 0 for stopped, paused, suspended states
- prevents false high cpu alerts for offline vms
- handles all non-running states, not just "stopped"
2025-08-11 10:08:41 +00:00
Pulse Monitor
2a965b2a05 fix: ensure all webhook services use proper payload formats
- extend webhook template support to all services (slack, teams, pagerduty)
- properly detect service type and apply correct template
- add pagerduty routing_key support from headers
- fallback to generic json only when no template exists
- handle both individual and grouped alerts for all services
2025-08-11 09:49:59 +00:00
Pulse Monitor
94a74fdcfe fix: telegram webhook payload format and pbs connection issues (fixes #294)
- add proper telegram bot api support with chat_id and text fields
- fix frontend pbs red dot display (was checking 'error' instead of 'unhealthy')
- fix qemu guest agent memory reporting (fallback to mem when freemem is 0)
- extract chat_id from telegram webhook urls when present
2025-08-11 09:38:09 +00:00
Pulse Monitor
2f2ab19c0b fix: QEMU guest agent VMs now show memory usage correctly
- Fall back to vmStatus.Mem when guest agent doesn't report FreeMem
- Fixes issue where VMs with guest agent showed 0% memory usage
- Addresses issue #294
2025-08-11 08:45:49 +00:00
Pulse Monitor
c7a96f9d39 chore: bump version to v4.1.8 2025-08-11 07:57:50 +00:00
Pulse Monitor
6922a79d59 fix: reload alert and notification configs after import
- Import was saving configs to disk but not updating in-memory state
- Added explicit reloading of alert thresholds after import
- Added explicit reloading of webhooks after import
- Added explicit reloading of email config after import
- Settings now show immediately in UI without requiring restart

Fixes #291 where imported alert thresholds and webhooks weren't
visible until after service restart
2025-08-10 22:29:14 +00:00
Pulse Monitor
30fe499437 improve: Docker persistence fix with better error handling
- Use consistent utils.GetDataDir() helper instead of duplicating logic
- Handle migration failures gracefully - log warnings but continue using old key
- Add detailed logging for migration with source and destination paths
- Prevent unnecessary migration when paths are identical
- Improve error messages for debugging

Addresses review feedback on the Docker persistence fix
2025-08-10 22:09:48 +00:00
Pulse Monitor
9587528157 fix: Docker persistence by storing encryption key in data volume
- Move encryption key from /etc/pulse to PULSE_DATA_DIR (/data in Docker)
- Add automatic migration for existing installations
- Key now persists across container restarts when using volume mount
- Maintains backward compatibility for non-Docker installations

Fixes #290 reported by da99Beast where Docker containers lost
configuration on restart due to encryption key being regenerated
2025-08-10 22:04:14 +00:00
Pulse Monitor
256d168d54 fix: update hardcoded fallback version to 4.1.7
The binary was using 4.1.6 as the fallback version when VERSION file
wasn't found, causing version mismatches in some installations
2025-08-10 20:49:29 +00:00
Pulse Monitor
068322bb45 feat: add DISCOVERY_SUBNET environment variable support for Docker network discovery configuration 2025-08-10 19:44:31 +00:00
Pulse Monitor
ba6bf68acc fix: update system to handle new tarball structure and permission issues
- Support both old (root) and new (bin/) tarball structures
- Use writable directories for temp and backup files (data dir instead of /tmp)
- Fixes update failures for users on v4.1.5 and earlier
2025-08-10 19:38:40 +00:00
Pulse Monitor
14dcdfc4d6 fix: Discord webhook avatar URLs pointing to wrong repository 2025-08-10 19:23:31 +00:00
Pulse Monitor
eef3ebf354 fix: critical bugs in v4.1.5
- Fixed hardcoded version fallback showing 4.1.1 instead of current version
- Fixed install script syntax error that prevented fresh installations
- Identified root cause of Docker persistence issue (notification UI not saving)
- Identified missing save functionality in frontend notification settings

Issues addressed: #277, #278, #282
2025-08-10 18:49:51 +00:00
Pulse Monitor
fbf8e5f1ce fix: RAM usage calculation and webhook test functionality
- Fixed incorrect RAM usage display for VMs without guest agent (issue #280)
  - VMs without guest agent now show 0% usage instead of 100%
  - Only show actual usage when guest agent provides FreeMem data
  - Containers continue to show accurate usage as before

- Fixed webhook test functionality (issue #279)
  - Added proper webhook ID handling in test notification endpoint
  - Created SendTestWebhook method to test specific webhooks
  - Frontend can now successfully trigger webhook tests
2025-08-10 10:59:26 +00:00
Pulse Monitor
bb3f783b59 refactor: implement directory-based auto-update approach
Replaced sudo-based updater with a cleaner directory-based approach:
- Pulse binary now installs to /opt/pulse/bin/pulse (owned by pulse user)
- Symlink created at /usr/local/bin/pulse for PATH convenience
- Pulse user has full write access to /opt/pulse, enabling self-updates
- Removed sudo dependency and security risks
- Simplified update logic - no special scripts or permissions needed

This is more secure, simpler, and works in all environments (containers, VMs, bare metal)
2025-08-10 09:48:53 +00:00
Pulse Monitor
1da7ca4ea7 feat: add timestamp to token names for true uniqueness
Token names now include both Pulse server IP and Unix timestamp (e.g. pulse-192-168-0-176-1754816525) ensuring each script run creates a unique token. This completely eliminates 'token already exists' errors when running setup scripts multiple times.
2025-08-10 09:02:52 +00:00
Pulse Monitor
5a98e05cb0 feat: add Pulse server IP to token names for uniqueness
When running the setup script multiple times from different Pulse servers, tokens now include the Pulse server's IP address in the name (e.g. pulse-192-168-0-176) to avoid conflicts. This prevents 'token already exists' errors when managing multiple Pulse instances.
2025-08-10 08:58:04 +00:00
Pulse Monitor
aafa90f9db fix: enable PBS backup monitoring by default
- PBS instances now have MonitorBackups enabled by default
- Fixes issue where PBS backups weren't showing in the UI
- Bump version to v4.1.1
2025-08-10 08:27:20 +00:00
Pulse Monitor
6d633aa486 fix: correct hardcoded fallback version to 4.1.0 2025-08-10 07:44:40 +00:00
Pulse Monitor
68e8ef69f6 fix: Docker permission issues and alert history file access
- Fixed Docker entrypoint to properly handle running as root (PUID=0)
- Improved alert history loading to handle permission errors gracefully
- Container now correctly runs as root when PUID=0 is set
- Alert history continues loading even if backup file has permission issues

Addresses #266 and #262
2025-08-10 06:51:45 +00:00
Pulse Monitor
f8ef3f9259 fix: multiple critical issues in monitoring and notifications
- PBS instances now show as online when datastores are accessible even if version endpoint fails
- Email sending now uses proper STARTTLS support for compatibility with providers like SMTP2GO
- Email recipient input no longer filters entries while typing
- Auto-update setting now properly persists and loads from config
- Fixed CPU usage alerts for offline VMs (already addressed in previous commits)
2025-08-09 23:26:12 +00:00
Pulse Monitor
0ebfb8ec01 hotfix: backup type detection for PBS backups
- Added format field checking for pbs-ct and pbs-vm
- Changed unknown type fallback from VM to LXC (more common)
- Fixes issue where all backups showed as VM type
2025-08-09 22:42:04 +00:00
Pulse Monitor
a368d3b3c9 attempt to address: Discord webhooks, backup types, storage duplicates, alert issues
- Added service field to WebhookConfig to identify Discord webhooks
- Use Discord-specific template when sending Discord webhooks
- Fixed backup type detection for PBS backups (vm/ct)
- Fixed shared storage duplicate IDs across instances
- Fixed alert acknowledge/clear response format to match frontend expectations
2025-08-09 22:27:10 +00:00
Pulse Monitor
3f897f42fa fix: clear user instructions for manual refresh after updates 2025-08-09 21:43:17 +00:00
Pulse Monitor
4c8094e4ac fix: auto-restart after update using clean exit strategy 2025-08-09 20:57:00 +00:00
Pulse Monitor
311ef7619e fix: critical production issues for v4.1.0-rc.5
- Fixed Discord/Slack/Teams webhooks not persisting (Issue #272)
- Fixed email recipients not saving and Enter key issue (Issue #270)
- Fixed auto-update toggle not saving (Issue #269)
- Fixed false CPU alerts for stopped VMs/containers (Issue #273)
- Automatic alert clearing for stopped guests
- Preserve passwords when updating email config

chore: bump version to v4.1.0-rc.5
2025-08-09 18:27:30 +00:00
Pulse Monitor
7f414623fc fix: ensure consistent CPU core display for all guests
- Fix CPU core display to show for all guests with CPU data
- Previously only showed cores when CPU > 0 (truthy)
- Now shows "(0.0/X cores)" consistently for all running/stopped guests
- Improve code organization with new helper utilities
- Clean up import statements and remove debug logs
2025-08-09 15:03:28 +00:00
Pulse Monitor
fce003b559 fix: polling interval now persists through restarts
- System.json settings now take priority over environment variables
- Fixed issue where POLLING_INTERVAL env var would override saved settings
- Polling interval changes in UI now persist correctly after restart
2025-08-09 12:59:21 +00:00
Pulse Monitor
decce4f39f feat: implement secure registration token system with fixes
- Add registration token system for secure node auto-registration
- Implement token generation, validation, and revocation APIs
- Add frontend UI for managing registration tokens
- Fix polling interval hot-reload to work without restart
- Fix environment variable persistence for system settings
- Optimize monitor reload to avoid 'no nodes configured' message
- Fix goroutine leak in token manager cleanup
- Fix context propagation in reload logic
- Fix AUTO_UPDATE_ENABLED persistence bug
- Add proper error handling and security validation
- Ensure all resources properly cleaned up with defer statements
2025-08-09 11:54:26 +00:00
Pulse Monitor
5b0be4e677 security: fix critical vulnerabilities in auto-registration
- Remove token logging - tokens were being logged in plaintext
- Add client IP logging for security auditing
- Add HTTPS warning when tokens sent over HTTP
- Remove debug output that exposed tokens in console
- Add optional auth requirement via REQUIRE_AUTH_FOR_AUTO_REGISTER env var
- Prevent token exposure in error messages
- Already has duplicate node prevention

Security improvements:
- Tokens no longer logged anywhere
- Source IPs tracked for audit trail
- Optional authentication for high-security environments
- HTTPS enforcement warnings
2025-08-09 10:23:21 +00:00
courtmanr@gmail.com
7f33cb64cc fix: address additional critical bugs and security vulnerabilities
- Fix unsafe JSON parsing in WebSocket with proper error handling
- Fix unsafe JSON parsing in Settings import with validation
- Improve API token security by using sessionStorage as primary storage
- Remove debug console statements from production code
- Fix race conditions in WebSocket alert handling with atomic updates
- Add NaN validation for parseFloat operations in search queries
- Add safer error handling alternatives in generics utility
- Improve graceful shutdown in Settings API with proper timing
- All changes verified with successful frontend and backend builds
2025-08-09 10:54:10 +01:00
courtmanr@gmail.com
6404b2d63e fix: address critical security vulnerabilities and improve code quality
- Fix XSS vulnerabilities in Tooltip component by replacing innerHTML with textContent and adding content sanitization
- Fix XSS vulnerability in UnifiedBackups by replacing innerHTML with safe DOM manipulation
- Add proper null checks for props.guest.cpu in GuestRow to prevent NaN errors
- Replace unsafe non-null assertions with proper conditional rendering
- Fix memory leak in Settings component by improving interval cleanup
- Fix WebSocket reconnection race condition by adding proper timeout cleanup
- Create standardized error handler utility for consistent error handling
- Enable VM state support in monitoring (resolves TODO)
- Improve type safety throughout the codebase
- All changes verified with successful frontend and backend builds
2025-08-09 10:41:28 +01:00
Pulse Monitor
8dad7e9a7c refactor: simplify configuration to single source of truth
- Remove .env syncing - UI no longer writes to .env file
- system.json is the single source for UI-managed settings
- .env files are read-only for deployment overrides
- Environment variables still override everything (Docker/systemd)
- Cleaner separation: env vars for deployment, JSON for runtime
- Updated documentation to clarify configuration hierarchy
- Simpler code with less failure points
2025-08-09 09:32:31 +00:00
Pulse Monitor
af84e27e80 feat: sync UI settings with .env file
- UI settings now automatically update .env file when changed
- .env file and system.json stay in sync
- Settings hierarchy preserved: env vars > .env > UI
- .env file is auto-generated/updated when UI saves settings
- Improved user experience - changes in UI reflect in .env and vice versa
2025-08-09 06:56:37 +00:00
Pulse Monitor
d29c4da7e9 fix: release channel persistence and expanded .env support
- Fix release channel not saving when changed in UI
- Add system settings persistence for update-related config
- Expand .env file support to include all non-sensitive settings:
  - UPDATE_CHANNEL, AUTO_UPDATE_ENABLED, AUTO_UPDATE_CHECK_INTERVAL, AUTO_UPDATE_TIME
  - POLLING_INTERVAL, CONNECTION_TIMEOUT, ALLOWED_ORIGINS, LOG_LEVEL
- Update documentation with all available .env settings
- Settings now properly persist across restarts
- Environment variables override saved settings at startup
2025-08-08 23:19:26 +00:00
Pulse Monitor
fbb6e14721 fix: update channel logic for RC releases
- Fix bug where RC channel always returned first release without proper comparison
- Ensure RC channel returns the latest release (newest by creation date)
- Stable channel correctly returns first non-prerelease
- Add manual update instructions for users stuck on rc.1
2025-08-08 23:10:50 +00:00
Pulse Monitor
dd5ee8120f fix: critical bugs and add .env configuration support
- Fix Export/Import API token authentication (wasn't sending X-API-Token header)
- Add client-side passphrase validation (12+ chars with visual feedback)
- Fix settings persistence for AllowedOrigins field
- Fix hardcoded port display in diagnostics (now shows actual port)
- Add .env file support for non-sensitive configuration (ports, logging, etc)
- Keep sensitive data (API tokens, passwords) using secure methods (systemd env vars)
- Update documentation with configuration guide and latest features
- Document auto-discovery, cluster detection, and export/import features
2025-08-08 22:37:02 +00:00
Pulse Monitor
bb0920efa6 feat: add optional backup management permissions checkbox
- Add checkbox to control whether backup write permissions are granted
- When checked: adds PVEDatastoreAdmin role on /storage (allows backup management)
- When unchecked: only PVEAuditor role (read-only, no PVE backups in Storage tab)
- Update setup script generation to conditionally add storage permissions
- Update UI to clearly explain the implications of each choice
2025-08-08 21:50:05 +00:00
Pulse Monitor
d6e93e2e2b feat: major improvements to cluster detection, auto-registration, and UI
Frontend:
- Enhanced cluster vs standalone node visual distinction in Settings
- Added glassmorphic style to all toast notifications for consistency
- Fixed test connection in edit modal to use stored encrypted credentials
- Added batch credential modal for bulk node operations
- Added network discovery modal with auto-subnet detection
- Improved notification system with dual toast/notification support
- Added event bus for component communication

Backend:
- Fixed duplicate toast notifications during auto-registration
- Fixed PBS auto-registration token extraction from JSON output
- Added network discovery service with background scanning
- Improved cluster detection with actual cluster name from API
- Added helper function to reduce code duplication in cluster detection
- Fixed host URL normalization in auto-registration
- Enhanced PBS client token authentication parsing

Bug Fixes:
- Fixed stacking toast notifications creating visual bugs
- Fixed PBS authentication failures after auto-registration
- Fixed network discovery not finding Proxmox servers
- Fixed test connection for existing nodes with encrypted tokens
- Removed duplicate WebSocket broadcasts for auto-registration events
2025-08-08 21:25:28 +00:00
Pulse Monitor
f274519892 Fix PBS authentication and auto-configuration
- PBS host now automatically gets https:// prefix and :8007 port if missing
- Fixed auto-naming to work after host normalization
- Token auth now correctly displays 'Token:' instead of 'User:'
- Edit mode now correctly identifies token vs password auth
- Backend properly clears unused auth fields when switching types

Fixes #263, #261
2025-08-08 16:27:56 +00:00
Pulse Monitor
d63b735c7a Fix PBS token authentication display issue
- Fixed NodeModal to correctly detect token auth based on tokenName instead of user field
- Backend now properly clears user field when using token authentication
- Backend now properly clears token fields when using password authentication
- This fixes the issue where PBS nodes using token auth would show "User:" instead of "Token:"

Fixes #263, #261
2025-08-08 15:46:52 +00:00
Pulse Monitor
1aadd9dc0a Remove PBS summary card and fix backup chart timezone
- Removed PBS summary card from Dashboard and Backups tabs (not needed)
- Fixed backup frequency chart to use local timezone instead of UTC
- Chart now properly includes today in the date range
- Dates display according to user's browser timezone
2025-08-08 15:30:28 +00:00
Pulse Monitor
93ea43a7c7 Add Updates UI to Settings page
- Add System tab with Performance, Network, and Updates sections
- Implement Check for Updates and Apply Update functionality
- Add support for PULSE_UPDATE_SERVER environment variable for testing
- Fix Settings tab navigation issues
- Version bump to v4.1.0-rc.1
2025-08-07 18:17:13 +00:00
Pulse Monitor
e77b4ed8f4 fix: resolve frontend redirect loop issue in releases
The issue was that the binary was looking for frontend files relative to the current working directory instead of relative to the binary location. This caused a redirect loop when the binary was installed in /opt/pulse but run from elsewhere.

Fixed by:
- Making the binary detect its own location and look for frontend files there
- Adding fallback paths for common installation locations
- Logging where frontend files are being served from for debugging
2025-08-07 15:59:47 +00:00