Commit Graph

369 Commits

Author SHA1 Message Date
Pulse Monitor 625fac99b5 fix: prevent setup screen showing on rate limit and exclude status checks from auth rate limiting
- Login component now handles 429 rate limit responses correctly
- When rate limited, assume auth is configured and show login form
- /api/security/status endpoint excluded from strict auth rate limiting
- Status checks now use general API rate limit (500/min) instead of auth limit (10/min)
- Fixes issue where rapid logout/login could trigger rate limiting
- Fixes setup screen appearing incorrectly when rate limited
2025-08-17 07:08:42 +00:00
Pulse Monitor 445adaa340 fix: respect saved theme preference over system preference
- Only use system color scheme preference if user has never set a theme
- Once user sets a theme preference, always respect it
- Properly remove dark class when in light mode on App initialization
- Fixes theme changing unexpectedly after login
2025-08-17 07:04:18 +00:00
Pulse Monitor 6c837d21fa fix: apply theme preference on login page
- Login component now applies saved theme preference on mount
- Theme preference correctly persists across logout/login in all modes
- Fixes issue where login page would revert to default theme after logout
2025-08-17 07:00:15 +00:00
Pulse Monitor 6c37ad11e9 fix: correctly preserve theme preference on logout
- Fixed bug where theme was not being preserved using correct storage key
- Now properly uses STORAGE_KEYS.DARK_MODE instead of 'theme'
- Theme preference now correctly persists across logout/login cycles
2025-08-17 06:51:23 +00:00
Pulse Monitor 89a9d02e01 fix: preserve theme preference on logout (addresses #318)
- Theme now persists when user logs out and logs back in
- Added documentation for BACKEND_HOST environment variable (addresses #321)
- Users can now bind to localhost only for reverse proxy setups
- Improved documentation for network configuration options
2025-08-17 06:46:38 +00:00
Pulse Monitor 3edef396d8 chore: cleanup test files and scripts
- Removed test scripts created during debugging sessions
- Removed telegram setup scripts and configs
- Removed test binaries and build artifacts
- Cleaned up repository structure
2025-08-17 06:40:17 +00:00
Pulse Monitor 97e317148c fix: webhook custom templates not being used when service field is empty
- Fixed bug where custom webhook templates were being overwritten with generic payload
- The issue occurred when a webhook had a custom template but empty service field
- Now properly preserves custom template payloads regardless of service field value
- Telegram webhooks and other custom template webhooks now work correctly
- Addresses user reports of webhook delivery issues
2025-08-16 21:57:27 +00:00
Pulse Monitor 053e4da097 fix: improve webhook test notifications with realistic values
- Use realistic test values (85.5% CPU, 80% threshold) instead of zeros
- Set alert level to 'warning' instead of 'info' for better visibility
- Add 5-minute duration to test alerts for realistic testing
- Improve test message to be more descriptive
- Fix empty message text issue in Telegram webhooks

The webhook system now sends proper test notifications that accurately
simulate real alerts, making it easier to verify webhook configurations.
2025-08-16 21:46:33 +00:00
Pulse Monitor ddaeab5d5e fix: major webhook system improvements and bug fixes
- Re-enable JSON validation that was accidentally commented out
- Fix Telegram chat_id handling with proper validation
- Add smart retry logic that distinguishes retryable from permanent errors
- Enhance error logging to include response bodies for debugging
- Add webhook URL validation for security (prevent SSRF)
- Fix deprecated strings.Title function usage
- Add webhook delivery history tracking
- Improve template variable substitution
- Add exponential backoff for retries (max 30 seconds)
- Validate numeric chat IDs for Telegram webhooks
- Add comprehensive error handling and logging

Tested with Telegram, Discord, and Slack - all working correctly now
2025-08-16 21:39:31 +00:00
Pulse Monitor fbbbb3b867 fix: comprehensive security improvements and UI fixes
- Remove overly restrictive password complexity requirements (now only 8+ chars)
- Fix Change Password section not appearing in Settings > Security
- Fix logout sometimes showing setup page instead of login page
- Remove misleading desktop notifications option from first-run setup
- Improve rate limiting on authentication endpoints
- Fix sensitive data appearing in logs (passwords, tokens)
- Enhance file permissions for sensitive files (0600)
- Fix WebSocket origin validation defaults
- Add password complexity validation for setup
- Improve CSRF token handling after server restarts
- Fix security status API using wrong fetch client
- Add logout race condition prevention

Security improvements:
- No credential leakage in logs
- Proper bcrypt password hashing
- Session management enhancements
- Rate limiting on all auth endpoints
- Secure file permissions on sensitive data
2025-08-16 21:10:24 +00:00
Pulse Monitor 8fe81b5712 fix: use authenticated requests for setup-script-url endpoint
The copy button in NodeModal was using plain fetch() instead of apiFetch() for the /api/setup-script-url endpoint, causing 401 errors when authentication is configured. Updated both PVE and PBS setup script generation to use authenticated requests.
2025-08-16 19:11:13 +00:00
Pulse Monitor 843e723216 docs: update Docker discovery configuration
Removed outdated DISCOVERY_SUBNET environment variable references and documented the correct way to configure discovery subnet in Docker containers via system.json. Docker containers detect their internal network by default, so manual configuration is needed for LAN discovery.
2025-08-16 19:07:07 +00:00
Pulse Monitor cab85f7571 fix: use authenticated requests for discovery endpoints
The /api/discover endpoint requires authentication when auth is configured. Updated Settings and DiscoveryModal components to use apiFetch which includes proper authentication headers (session cookies, API tokens, etc).
2025-08-16 18:58:00 +00:00
Pulse Monitor ecf6000f6b fix: use proper Show components for reactive rendering in Login
Refactored Login component to use nested Show components for proper reactivity in SolidJS. This ensures the component re-renders correctly when auth status changes, fixing the issue where UI stayed stuck on "Checking authentication...".
2025-08-16 18:51:05 +00:00
Pulse Monitor c636268569 fix: add Suspense boundary for lazy-loaded FirstRunSetup component
Added proper Suspense wrapper around the lazy-loaded FirstRunSetup component to ensure it loads correctly in production builds. Also added debug logging to help diagnose auth flow issues during development.
2025-08-16 18:47:08 +00:00
Pulse Monitor f235ac24b9 fix: resolve FirstRunSetup component not loading in Docker
The FirstRunSetup component wasn't being included in the production build due to Vite's tree-shaking optimization. Fixed by using lazy loading to ensure the component is always bundled as a separate chunk, allowing it to display properly when no authentication is configured.
2025-08-16 18:36:57 +00:00
Pulse Monitor 55b49fc257 fix: add FirstRunSetup for initial authentication configuration
- Modified Login component to check security status
- Shows FirstRunSetup when no authentication is configured
- Shows login form when authentication exists
- Fixed App.tsx to properly detect when auth setup is needed
2025-08-16 18:08:21 +00:00
Pulse Monitor e518f69f2c fix: improve Docker entrypoint script and clean up test files
Docker improvements:
- Fixed entrypoint script to properly handle UID/GID changes
- Simplified user/group recreation logic to avoid conflicts
- Properly handles switching between different UID/GID values

Cleanup:
- Removed temporary test scripts and files
- Removed PROXMOX_ENDPOINTS.md documentation
- Cleaned up various test Python and shell scripts

Docker testing confirmed:
- Data persistence working across restarts
- UID/GID configuration working correctly
- Volume backup/restore functioning properly
2025-08-16 17:54:45 +00:00
Pulse Monitor 2983c09a4a fix: resolve UI issues with Quick Token Setup and settings
- Fixed copy button not working in Quick Token Setup modal
  - Button was conditionally rendered only when host was populated
  - Now always visible and shows error if host is empty
  - Updated placeholder text to be clearer

- Fixed toast notifications appearing behind modals
  - Increased z-index from z-50 to z-[9999] to ensure visibility

- Fixed Generate API Token section intermittently not showing
  - Added proper loading state for security status
  - Prevents race condition where component renders before data loads
  - Added loadSecurityStatus() function for reusability
  - Refresh security status after password change

- Skip CSRF validation for /api/setup-script-url endpoint
  - Endpoint generates temporary tokens, not a state change
  - Fixes 403 Forbidden error when generating setup scripts

All API token functionality confirmed working with token rotation
2025-08-16 17:36:17 +00:00
Pulse Monitor fcd7823709 fix: reduce API calls to prevent syslog spam on non-clustered nodes (#322)
- Cache nodes list in pollPVEInstance and pass to sub-functions
- Prevents multiple GetNodes() calls per polling cycle
- Reduces API calls from ~5 per cycle to 1 per cycle
- Fixes syslog spam on standalone PVE nodes trying to find cluster certificates
- Fixes PBS 'Transport endpoint not connected' errors from excessive polling

Previously we were calling GetNodes() in:
- pollPVEInstance (main)
- pollVMs
- pollContainers
- pollStorage
- pollStorageBackups

Now we call it once and pass the list to avoid duplicate API calls that trigger
certificate checks on non-clustered nodes.
2025-08-16 12:48:03 +00:00
Pulse Monitor b316510a2b fix: resolve WebSocket metric updates and improve polling efficiency
- Fix alternating zero I/O metrics by implementing rate caching for stale data from Proxmox
- Hardcode polling interval to 10 seconds (matching Proxmox cluster/resources update cycle)
- Remove polling interval settings from UI (no longer user-configurable)
- Implement efficient VM/container polling using single cluster/resources API call
- Remove 'Remove Password' feature (auth is now mandatory)
- Fix CSRF validation for Basic Auth (exempt from CSRF checks)
- Fix Generate API Token modal and authentication
- Remove redundant 'Active' status from Authentication section
- Remove Connection Timeout setting from frontend (backend-only)
- Clean up frontend console logging (reduce verbosity)
- Remove PBS polling interval setting (fixed at 10s)
- Add frontend rebuild detection to backend-watch script
- Improve first-run setup flow and error handling
2025-08-16 12:12:10 +00:00
Pulse Monitor f524166f9d refactor: remove legacy system.json API token management
- Remove old /api/system/api-token endpoints
- Remove APIToken field from SystemSettings struct
- Remove token handling from system_settings.go
- Clean up config.Load() to not read token from system.json
- Remove unused frontend API token functions
- Remove unused APITokenManager and CurrentAPIToken components

API tokens are now managed exclusively via .env file with the new
/api/security/regenerate-token endpoint. This eliminates confusion
between the two systems and ensures consistency.
2025-08-15 10:04:39 +00:00
Pulse Monitor 4323339c5e feat: add Generate New API Token functionality
- Add backend endpoint to regenerate API tokens without resetting auth
- Updates .env file with new token while preserving other settings
- Frontend component with clear UX for token generation
- Shows new token once with copy functionality
- Indicates restart required to activate new token
- Works across all deployment types (Docker, LXC, native)

Much better UX than telling users to 'reconfigure security' just for a new token
2025-08-15 09:58:36 +00:00
Pulse Monitor 4d3d5592a5 fix: add informative content to API Token section when auth is enabled
- Show API Token Active status
- Add security notice about one-time visibility
- Include usage example with curl
- Replaces empty section that was confusing users
2025-08-15 09:51:40 +00:00
Pulse Monitor b212498c71 fix: remove misleading API token display after setup
- Remove CurrentAPIToken component entirely
- API tokens now only shown once during initial setup
- Add clear warning that token won't be shown again
- Remove sessionStorage caching of tokens
- Follows security best practices (like GitHub/AWS)

This prevents showing cached/wrong tokens from sessionStorage that don't match the actual configured token
2025-08-15 09:46:10 +00:00
Pulse Monitor b947eb8a98 fix: improve security setup and pending restart detection
- Add pending restart detection when .env exists but not loaded
- Update frontend to show pending state instead of re-showing setup
- Fix QuickSecuritySetup to refresh security status after configuration
- Remove auto-restart attempts from security setup
- Show deployment-appropriate restart instructions
- Update documentation to reflect new update mechanism

Related to security setup issues after removing sudo/auto-restart capabilities
2025-08-15 09:35:40 +00:00
Pulse Monitor c6690d5392 docs: comprehensive documentation update for v4.3.8
- Add critical docker-compose bcrypt escaping documentation
- Create comprehensive TROUBLESHOOTING.md guide
- Create dedicated DOCKER.md deployment guide
- Update CONFIGURATION.md with service name variations
- Document that .env file is not created when using env vars
- Add warnings about dollar sign escaping in docker-compose.yml

These docs address the main confusion points from recent issues,
especially the docker-compose bcrypt hash problem affecting many users.
2025-08-14 22:23:57 +00:00
Pulse Monitor eb93cba6fa chore: bump version to v4.3.8
Emergency release to fix critical issues in v4.3.7:
- Install script now correctly installs binary to /opt/pulse/bin/pulse
- Password changes no longer require sudo (addresses #317)

These fixes restore basic functionality for new installations
and Docker deployments.
2025-08-14 22:00:12 +00:00
Pulse Monitor de3132dfd9 chore: bump version to v4.3.7 2025-08-14 21:08:28 +00:00
Pulse Monitor fa5bd4da0e fix: allow quick-setup endpoint to check if already configured
- ProxmoxVE script can now check if auth is already set without credentials
- Quick-setup endpoint is now public but handler checks if setup should be skipped
- Prevents duplicate auth configuration attempts
- Critical for automated setup scripts
2025-08-14 20:59:25 +00:00
Pulse Monitor bd2ae433f3 fix: remove legacy security setup handler
- Remove old buggy Quick Security Setup handler
- New handler in security_setup_fix.go handles all cases properly
- Tested and working with Docker, systemd, and manual installations
2025-08-14 20:52:53 +00:00
Pulse Monitor 809854538f chore: add debug logging for notification troubleshooting 2025-08-14 20:46:52 +00:00
Pulse Monitor 0563b2eb0e fix: address authentication and setup issues for v4.3.6
- Add service name detection (pulse vs pulse-backend) for ProxmoxVE compatibility
- Remove sudo attempts for non-root users (addresses #6833)
- Add bcrypt hash validation to ensure 60-character length
- Fix Docker .env generation with proper quotes to prevent shell expansion
- Skip security setup if API_TOKEN already configured
- Better environment detection (Docker vs Systemd vs Manual)
- Clear error messages for truncated hashes (addresses #314, #316)
2025-08-14 20:46:41 +00:00
Pulse Monitor 6623bec738 revert: remove unnecessary v4.3.7 release 2025-08-14 19:40:16 +00:00
Pulse Monitor 47f5bf531b chore: bump version to v4.3.7 2025-08-14 19:37:11 +00:00
Pulse Monitor 4f47d425d5 fix: add debug logging for Telegram webhook issues
- Enhanced logging to diagnose chat_id extraction problems
- Log payload being sent to Telegram for debugging
- Better error messages when chat_id is missing or invalid
2025-08-14 19:28:52 +00:00
Pulse Monitor d6a2a05d95 chore: bump version to v4.3.6 2025-08-14 19:12:35 +00:00
Pulse Monitor d2bf420980 fix: improve bcrypt hash validation and error reporting
- Add clear error message for truncated bcrypt hashes (addresses #316)
- Detect hashes between 55-59 chars and warn they're invalid
- Only accept exactly 60 character bcrypt hashes as valid
- Treat truncated hashes as plaintext to force users to fix them
2025-08-14 19:12:14 +00:00
Pulse Monitor d8536c1c75 chore: bump version to v4.3.5 2025-08-14 16:35:06 +00:00
Pulse Monitor 54506811a2 fix: address critical issues from v4.3.x releases
- Docker: Fix password change failing due to missing sudo (addresses #314)
  - Detect Docker environment and write directly to .env file
  - Preserve existing .env settings during password update
  - No longer requires sudo in Docker containers

- Alerts: Add debug logging for acknowledgement issues (addresses #310)
  - Enhanced logging to help diagnose 404 errors
  - Better error reporting for alert operations

- Installer: Fix directory creation order (addresses #311)
  - Create directories before downloading files
  - Prevents installation failure on fresh systems
2025-08-14 16:29:42 +00:00
Pulse Monitor e6ba9981a2 fix: improve cluster handling with offline nodes and fix node card border styling
- Cluster now handles offline nodes gracefully without marking endpoints unhealthy
- Fixed error 595 (node unreachable) not being treated as node-specific failure
- Added parallel health checks with shorter timeouts for better performance
- Fixed inconsistent border width on offline node cards (removed conflicting border-l-4)
- Switched to ring utility for consistent outline on offline/alert nodes
- Improved logout functionality with proper CSRF token handling

addresses #312, #315
2025-08-14 15:46:37 +00:00
Pulse Monitor 91ed56d825 fix: add critical node offline alerts
- alerts now trigger when nodes go offline or lose connectivity
- alerts automatically resolve when nodes come back online
- offline status is checked before resource thresholds
- logs critical events when nodes lose connectivity

This was a major oversight - nodes going offline should always trigger alerts
2025-08-14 14:47:35 +00:00
Pulse Monitor 57df26668a feat: add logout button to header when auth is enabled
- adds logout button next to connection status indicator
- implements /api/logout endpoint to clear sessions
- button only shows when authentication is configured
- clears session cookie and invalidates server-side session

implements #315
2025-08-14 14:39:26 +00:00
Pulse Monitor 541e8f3c64 fix: update cluster node online indicators based on actual status
- tracks online/offline status for individual cluster nodes
- updates ClusterEndpoint.Online field during node polling
- fixes issue where all cluster nodes showed green indicator regardless of status

fixes #312
2025-08-14 14:24:19 +00:00
Pulse Monitor 8b34532c10 docs: add clear explanation of .env vs .enc file split
- explains purpose of each file type
- clarifies that .env is only for auth, not a regression
- documents the technical reasoning behind the architecture
- addresses confusion raised in #314
2025-08-14 14:11:06 +00:00
Pulse Monitor c8c351f9e7 fix: ensure install directory exists before copying binary
addresses #311 - installer was trying to copy pulse binary before creating /opt/pulse directory
2025-08-14 14:09:43 +00:00
Pulse Monitor 055ef1e1ad docs: fix security documentation accuracy
- clarified .env file usage for Docker (it's acceptable for Docker volumes)
- emphasized need for quotes around bcrypt hashes to prevent shell expansion
- removed incorrect SHA3-256 'cost factor' reference (only bcrypt has cost factor)
- added notes about proper quoting in Docker examples
2025-08-14 13:42:00 +00:00
Pulse Monitor 167a42d92a chore: update version fallback to 4.3.4 2025-08-14 13:23:58 +00:00
Pulse Monitor 65d0360c24 chore: bump version to v4.3.4 2025-08-14 13:20:45 +00:00
Pulse Monitor 3933f59877 fix: quote environment variables in .env to prevent shell expansion
addresses #314 - bcrypt hashes with $ signs were being interpreted as shell variables
by godotenv, causing authentication to fail after Docker container restarts
2025-08-14 13:04:33 +00:00