Commit graph

54 commits

Author SHA1 Message Date
Pulse Monitor
b9a768b5e6 feat: add per-guest custom URL functionality
- guests can now have custom URLs that make their names clickable
- added metadata store for persisting guest metadata to JSON files
- added API endpoints for managing guest metadata
- integrated edit button in dashboard to set/edit custom URLs
- guest names become clickable links when custom URL is set
2025-08-12 16:35:14 +00:00
Pulse Monitor
782651e24e feat: make node names in summary cards clickable
- Node names in the summary cards at the top now link to Proxmox web interface
- Matches the behavior of node names in the table rows below
- Uses same hover effect (blue color) for consistency
2025-08-12 16:19:02 +00:00
Pulse Monitor
75f4b74b83 feat: implement API token management UI (addresses #302)
- Add interactive API token management in Settings > Security tab
- Users can now generate, view, regenerate, and delete API tokens from the UI
- Tokens are persisted in system.json and survive restarts
- Environment variable API_TOKEN still takes precedence for backward compatibility
- Proper authentication enforcement when tokens are configured
- Secure token generation using crypto/rand (32 bytes, hex encoded)
- Clean UI with copy-to-clipboard functionality for newly generated tokens
2025-08-12 15:32:23 +00:00
Pulse Monitor
ef3789e9e0 feat: add RC badge to header for release candidate versions
The Pulse logo now displays an orange "RC" badge when running a release
candidate version. This helps users identify when they're testing pre-release
versions.

- Backend now detects RC versions and sets channel field accordingly
- Frontend displays RC badge next to Pulse logo when channel is "rc"
- Works for both git-based and VERSION file-based builds
2025-08-12 14:47:21 +00:00
Pulse Monitor
8492b0932d fix: dashboard now uses actual configured host URLs for node links
addresses #306 - The dashboard and storage views were hardcoding port 8006 for node links,
but now they properly use the host URLs from the node configuration. This ensures users
are redirected to the correct URL when clicking on node names, respecting custom ports
and protocols configured in the settings.

- Added host field to Node struct in Go models
- Updated monitor.go to populate host field from instance config
- Added host field to TypeScript Node interface
- Modified Dashboard and Storage components to use nodeHostMap for correct URLs
- Falls back to old behavior if host field is not available
2025-08-12 14:28:19 +00:00
Pulse Monitor
b77df2f2f1 feat: add custom webhook payload templates and fix Telegram chat_id handling
- Add custom JSON payload template support for generic webhooks
- Users can now define custom webhook formats with Go template syntax
- Fix Telegram webhook issue where chat_id in URL caused 400 errors
- Automatically strip chat_id from URL and place in JSON body for Telegram
- Add comprehensive webhook documentation with examples
- Update API documentation with webhook endpoints

Addresses #305
2025-08-12 14:03:13 +00:00
Pulse Monitor
5d50fe06da feat: embed frontend in Go binary for simplified deployment
Addresses #304 - Eliminates redirect loops and path issues by embedding
the frontend directly in the Go binary using go:embed

- Frontend is now embedded at compile time, no separate files needed
- Simplified tarball structure - just the binary and config files
- No more path searching or frontend directory issues
- Works consistently across all installation methods
- Smaller deployment footprint and simpler installation

This change makes Pulse a true single-binary deployment, eliminating
the complexity of managing separate frontend files and the issues that
arose from different installation structures.
2025-08-12 12:45:57 +00:00
Pulse Monitor
8431a49329 fix: improve frontend file discovery to prevent redirect loops
- Add multiple search paths for frontend files
- Check parent directories when binary is in bin/ subdirectory
- Support both tarball extraction and installed structures
- Fixes issue #304 where manual tarball extraction caused redirect loops
- Maintains compatibility with community scripts
2025-08-12 12:33:40 +00:00
Pulse Monitor
c62952e070 fix: email test now uses saved password when not provided
- Test email button now works without re-entering password
- Backend uses saved password if test request has empty password
- Fixes authentication error when testing email notifications
2025-08-12 09:47:05 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
Pulse Monitor
f7018debc4 fix: complete update system improvements
- Use background context for update downloads to prevent cancellation
- Detect actual binary location and update correct file
- Support both 'pulse' and 'pulse-backend' service names
- Copy VERSION file to multiple locations for compatibility
- Handle flat tarball structure from GitHub releases
2025-08-07 11:43:40 +00:00
Pulse Monitor
1c0d131cae fix: update UI channel selection and apply update file extraction
- Frontend now passes currently selected channel when checking for updates
- Backend accepts channel parameter to check specific channel without saving
- Fixed applyUpdateFiles to handle flat tarball structure (not nested in pulse-* directory)
- Fixed extraction logic to properly copy pulse binary, frontend, and VERSION file
- Users no longer need to toggle channels and save to see update button
2025-08-07 11:16:02 +00:00
Pulse Monitor
5ee4b79c88 fix: resolve critical issues from GitHub
- Fix cpulimit parsing bug (#256): Add float support to FlexInt for LXC containers with cpulimit
- Fix PBS connection error (#260): Improve error handling and port configuration for PBS
- Fix 'no healthy nodes' error (#257): Add better cluster endpoint validation and fallback
- Add better error logging for cluster connection failures
2025-08-07 08:37:47 +00:00
Pulse Monitor
28f9d9db53 feat: add comprehensive security system for API protection
Security Features Added:
- Secure-by-default configuration export/import with ALLOW_UNPROTECTED_EXPORT environment variable
- Rate limiting (5 attempts/minute) to prevent brute force attacks on sensitive endpoints
- Comprehensive audit logging for all export/import attempts with IP tracking
- Frontend Security tab showing API protection status and configuration guidance
- Frontend now shows when export is blocked and disables buttons appropriately
- Strong passphrase requirement (minimum 12 characters) for exports

Technical Implementation:
- New RateLimiter component with automatic cleanup and middleware support
- Security status API endpoint showing protection state
- Enhanced error messaging with specific guidance for homelab vs production use
- Proper authentication flow with API token validation
- Updated documentation reflecting new security model

Breaking Changes:
- Export/import now requires API_TOKEN unless ALLOW_UNPROTECTED_EXPORT=true is set
- Minimum passphrase length increased from none to 12 characters

Additional Improvements:
- Fixed architecture-specific updates for better cross-platform support
- Removed RC label from UI header
- Updated security documentation with clear setup instructions
2025-08-06 21:39:52 +00:00
Pulse Monitor
9bc050371b fix: Docker persistence actually fixed this time
The ConfigHandlers were calling config.SaveConfig() which uses
globalPersistence initialized at startup with potentially wrong path.
Now handlers use their own persistence instance directly which is
initialized with the correct DataPath.

This was causing Docker configurations to still save to /etc/pulse
even though we thought we fixed it in v4.0.6.

Fixes #253 (for real this time)
2025-08-06 17:14:34 +00:00
Pulse Monitor
9c77f6e7db fix: Docker persistence and Windows VM memory reporting
- Fix Docker persistence bug where config was saved to /etc/pulse instead of /data
- Fix Windows VM memory reporting with balloon drivers
- Add GetVMStatus method to get detailed VM info including balloon memory
- Update diagnostics endpoint to use correct config paths

Fixes #253 (Docker persistence)
Fixes #258 (Windows VM memory reporting)
2025-08-06 16:00:22 +00:00
Pulse Monitor
6609c7a962 feat: add diagnostics endpoint and improve error handling
- Add /api/diagnostics endpoint for detailed troubleshooting info
- Shows connection status, auth methods, errors for each node
- Auto-fix PBS hosts missing https:// prefix instead of crashing
- Skip invalid PBS instances instead of failing to start
- Fixes issue #251 where invalid PBS config crashed the service
2025-08-06 15:24:06 +00:00
Pulse Monitor
ebb512c023 fix: webhook persistence using wrong directory
ConfigPersistence was initialized with empty string instead of cfg.DataPath,
causing webhooks to save to /etc/pulse instead of PULSE_DATA_DIR.
This affected Docker deployments where /data is the persistent volume.

Fixes #249
2025-08-05 21:37:56 +00:00
Pulse Monitor
1ffbee5243 fix: improve PBS token authentication handling (#250)
- Parse user@realm from token name if provided in full format
- Better handle various token input formats
- Require user info for token auth (either in token name or user field)
- Fix realm defaulting logic for different auth types
2025-08-05 20:29:07 +00:00
Pulse Monitor
02c5319099 fix: Docker container data persistence issue (#249)
- Add GetDataDir() function to respect PULSE_DATA_DIR environment variable
- Update all hardcoded /var/lib/pulse paths to use configurable data directory
- Fix circular import by moving GetDataDir to utils package
- Ensures Docker containers can properly persist configuration and alerts
2025-08-05 07:01:11 +00:00
Pulse Monitor
89e43fc1d9 fix: update to serve on port 7655 and fix version handling 2025-08-03 21:16:05 +00:00
Pulse Monitor
f501ec258d fix: consolidate to encrypted-only configuration system
- Remove all unencrypted configuration fallback logic
- Fix PBS user realm handling with automatic @pbs appending
- Enable test connection for existing nodes using stored credentials
- Delete legacy migration code and unified config system
- Fix redundant "No guests found" message when no PVE nodes configured
- Remove old example yml and migration binary
- Ensure all credentials stored only in encrypted .enc files
2025-08-03 11:19:32 +00:00
Pulse Monitor
0bcffc465a Fix frontend email test field mapping
- Frontend was sending 'server' but backend expects 'smtpHost'
- Fixed field mapping in testEmailConfig function
- Changed config type to 'any' since backend expects different structure
- Removed provider and starttls fields not needed by backend

The UI test email button should now work correctly.
2025-08-02 18:15:03 +00:00
Pulse Monitor
9566dd0cb8 Improve mobile responsiveness and fix email notifications
- Fix Gmail email configuration (field mapping between frontend/backend)
- Implement proper AES-256-GCM encryption for sensitive config files
- Add responsive column hiding for Storage tab on mobile devices
- Fix email configuration persistence and auto-populate recipients
- Add comprehensive testing tools for UI and API validation
- Fix alert acknowledge/clear functionality returning 404 errors
- Improve mobile UX: Storage shows only essential columns on small screens
- Revert dashboard to consistent table view (removed card layout experiment)
- Fix various UI issues: threshold detection, email template spacing
- Update notification system to use actual node data in test emails
2025-08-02 16:02:13 +00:00
Pulse Monitor
b1d79d8e25 Add comprehensive update mechanism with auto-update support
- Backend update manager with GitHub Releases API integration
- Support for stable and RC update channels
- Safe update process with backups and rollback capability
- Docker environment detection
- Update API endpoints (check, apply, status)
- Frontend update UI in Settings with progress tracking
- WebSocket events for real-time update progress
- Auto-update configuration options
- Version display in app footer
- TypeScript types for update operations
2025-07-30 15:59:06 +00:00
Pulse Monitor
0824e22338 Fix all TypeScript 'any' types and ensure strict typing
- Replace all 'any' types with proper TypeScript types throughout the codebase
- Fix Record<string, any> to use specific types (AlertThresholds, unknown)
- Update logger methods to use 'unknown' instead of 'any' for parameters
- Fix type assertions to use proper types instead of 'as any'
- Update generic type defaults from 'any' to 'unknown'
- Fix WebSocket message types to use 'unknown' for optional data
- Move global Toast declaration to top level to fix TypeScript errors
- Comment out legacy PBS backup code that referenced non-existent fields
- Ensure all code follows TypeScript standards as documented in CLAUDE.md

All TypeScript compilation errors have been resolved and the codebase now
adheres to strict typing standards with no 'any' types remaining.
2025-07-30 14:08:06 +00:00
Pulse Monitor
b0199e2ee3 Update frontend components and backend API router
- Modified Settings, NodeModal, and DynamicChart components
- Updated Alerts page and related stores (charts, websocket)
- Enhanced alert types definitions
- Updated internal API router
- Added backend directory
2025-07-29 22:59:09 +00:00
Pulse Monitor
2968c63baf Fix node test connection for new nodes
- Add new `/api/config/nodes/test-config` endpoint for testing unsaved node configurations
- Update NodesAPI to use appropriate endpoint based on whether node has an ID
- Existing nodes use `/api/config/nodes/{id}/test`, new nodes use `/api/config/nodes/test-config`
- Fix TypeScript types to include latency in test response details

This resolves the 400 error when testing connections for new nodes before they are saved.
2025-07-29 21:25:23 +00:00