Commit Graph

149 Commits

Author SHA1 Message Date
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 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 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 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 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 167a42d92a chore: update version fallback to 4.3.4 2025-08-14 13:23:58 +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
Pulse Monitor 75b2fad471 fix: remove script output from logs to prevent credential leaks
Script outputs from change-password and remove-password operations could
potentially contain sensitive information. Removed output logging while
keeping error logging for debugging.
2025-08-14 12:37:20 +00:00
Pulse Monitor 893c621eb2 chore: bump version to v4.3.3 2025-08-14 12:21:23 +00:00
Pulse Monitor b2573a1ee3 fix: properly handle hashed API tokens in auth checks
The export/import handlers were using direct string comparison for API tokens
instead of proper hash comparison. This caused auth to fail when tokens were
stored as hashes (which is what the security wizard does).

addresses #314
2025-08-14 12:18:36 +00:00
Pulse Monitor 0f91ee5f77 chore: bump version to v4.3.2 2025-08-14 11:41:00 +00:00
Pulse Monitor 300f805665 fix: critical auth persistence bug in Docker Quick Security Setup
- Docker containers were not saving credentials to persistent storage
- Non-Docker setups were saving plain text instead of hashed credentials
- After container restart, saved credentials would not work

This fixes issue #314 where users couldn't login after setting up security
in Docker containers. The Quick Security Setup now:
1. Properly hashes passwords and tokens before saving
2. Saves to /etc/pulse/.env for persistence in Docker volumes
3. Correctly loads credentials after container restart
2025-08-14 11:37:52 +00:00
Pulse Monitor 07b33ad215 chore: bump version to v4.3.1 2025-08-14 10:39:10 +00:00
Pulse Monitor 97acef85c0 feat: auto-allow export/import on private networks without auth
- Homelab users on private networks (192.168.x.x, 10.x.x.x, 172.16.x.x) can now export/import without any configuration
- No need to set ALLOW_UNPROTECTED_EXPORT=true for typical homelab setups
- Public network access still requires authentication for security
- Simplifies backup/restore for users who don't need authentication
2025-08-14 10:07:29 +00:00
Pulse Monitor cdc77860ee fix: reload guest metadata after import
- Guest metadata handler now reloads from disk after import
- Custom console URLs are immediately available after import
- No longer requires service restart to see imported guest URLs
2025-08-14 09:51:40 +00:00
Pulse Monitor f62016099b fix: use correct data path for guest metadata export/import
- Export/import now uses PULSE_DATA_DIR env var (defaults to /etc/pulse)
- Guest console URLs and metadata are now properly included in backups
- Fixed path mismatch between runtime (/etc/pulse) and export (/var/lib/pulse)
2025-08-14 09:46:21 +00:00
Pulse Monitor 8ed9054a63 fix: simplify export/import authentication flow
- Allow export/import with session auth when logged in with password
- No longer require API token when user is already authenticated
- Backend now accepts either session cookies OR API token
- Frontend only prompts for API token if no password auth exists
- Improved UX by eliminating redundant authentication requests
2025-08-14 09:32:24 +00:00
Pulse Monitor 60d6be27a2 fix: correct documentation and add FRONTEND_PORT env var support
- Add support for FRONTEND_PORT environment variable (preferred over legacy PORT)
- Fix incorrect PULSE_PASSWORD references (should be PULSE_AUTH_PASS)
- Remove documented but unimplemented PULSE_DISABLE_SECURITY_WARNINGS
- Clarify Docker vs LXC/systemd configuration differences
- Update UI to accurately describe env variable override behavior
- Fix default values in docs (POLLING_INTERVAL=3, AUTO_UPDATE_ENABLED=false)
- Clarify CORS settings (empty = same-origin only, * = allow all)
- Improve documentation structure to clearly separate deployment types
2025-08-14 09:09:22 +00:00
Pulse Monitor 0f36d1248d feat: enhance security and improve login UI
Security Improvements:
- Implement bcrypt password hashing (cost factor 12)
- Add SHA3-256 API token hashing
- Fix authentication enforcement after security setup
- Improve restart mechanism to properly reload systemd environment
- Add CSRF protection for all state-changing operations
- Implement comprehensive rate limiting (10/min auth, 500/min API)
- Remove sensitive data from logs
- Add security audit test suite

UI Enhancements:
- Add Pulse logo to login screen with animations
- Implement glassmorphism design for login form
- Add gradient backgrounds and smooth animations
- Enhance input fields with icons
- Add loading spinner for authentication
- Improve overall login page aesthetics

Bug Fixes:
- Fix security setup restart mechanism
- Fix systemd environment variable inheritance
- Fix CSRF validation for security endpoints
- Fix password change and removal functionality

Testing:
- Add automated security test suite
- Verify all authentication flows
- Test rate limiting effectiveness
- Validate CSRF protection
2025-08-13 23:07:57 +00:00
Pulse Monitor 37e86a7cbc feat: add ability to remove password authentication
New Feature:
- Add "Remove Password" button in Settings → Security tab
- Allows users to disable password authentication completely
- Returns Pulse to open access mode (no auth required)
- Requires current password confirmation for security

Implementation:
- New API endpoint: POST /api/security/remove-password
- New modal component: RemovePasswordModal.tsx
- Removes password from systemd override files
- Clears auth configuration from running instance
- Invalidates all sessions after removal

This addresses the issue where users couldn't disable authentication
once it was enabled. Now they can easily toggle between secured and
open modes as needed for their use case.
2025-08-13 20:39:26 +00:00
Pulse Monitor 1d23178286 fix: address critical security vulnerabilities from audit
Security Fixes:
- Fix path traversal vulnerability in tar extraction (HIGH)
  - Validate and sanitize paths from tar archives
  - Prevent directory traversal attacks via ../
  - Ensure extracted files stay within destination directory

- Remove weak SHA-256 password hashing code (MEDIUM)
  - Removed unused SHA-256 hash function from crypto package
  - All password hashing now uses bcrypt (cost 12) exclusively
  - Added warning comment about proper password hashing

- Fix error information leakage (MEDIUM)
  - Add sanitizeErrorMessage helper function
  - Log detailed errors internally while returning generic messages
  - Prevent exposure of system internals in error responses

- Change default CORS from * to restrictive (MEDIUM)
  - Default to no CORS headers (same-origin only)
  - Allow localhost origins only in development mode
  - Require explicit configuration for production CORS

These fixes address all critical and medium severity issues found
in the security audit while maintaining backward compatibility.
2025-08-13 19:46:39 +00:00
Pulse Monitor 565573ac40 feat: enhance security and improve API token UX
Security Improvements:
- Add comprehensive CSRF protection for state-changing operations
- Implement rate limiting (500 req/min general, 10/min for auth)
- Add account lockout after 5 failed login attempts
- Secure session management with HttpOnly cookies
- Add security headers (CSP, X-Frame-Options, etc.)
- Implement audit logging for security events
- Session invalidation on password change

API Token UX Improvements:
- Always show API token to authenticated users (no longer hide after generation)
- Add ability to view existing token anytime from Settings
- Fix clipboard copy with HTTP fallback

Authentication Flow Fixes:
- Fix WebSocket initialization to occur after auth check
- Fix CSRF validation to handle server restarts gracefully
- Adjust rate limiting to exclude high-frequency endpoints
- Fix authentication check to use session cookies properly

Documentation Updates:
- Document all security features comprehensively
- Update API documentation with CSRF usage examples
- Add security feature details to README
2025-08-13 19:05:23 +00:00
Pulse Monitor 5e079db893 refactor: consolidate authentication system and improve API structure
- Remove registration tokens feature in favor of simpler API token auth
- Add password authentication with change password functionality
- Centralize API client logic with proper auth handling
- Add development scripts for better DX (hot-reload, proxy setup)
- Refactor auth middleware and handlers for cleaner separation
- Update frontend to use new centralized API client
2025-08-13 14:51:46 +00:00
Pulse Monitor 3fff302121 fix: use same restart mechanism as updates for security setup
- Exit cleanly with os.Exit(0) instead of trying systemctl restart
- Let systemd's Restart=always bring service back up
- New environment variables loaded automatically on restart
- Same proven approach used by update system
2025-08-12 21:13:45 +00:00
Pulse Monitor 58fa977502 fix: handle permission issues in security setup gracefully
- Try automatic setup first (if sudo available)
- Fall back to generating a simple apply script
- Show single command to run: sudo bash /etc/pulse/apply-security.sh
- Script handles all systemd configuration steps
- Clear UI shows when manual step is needed
2025-08-12 21:11:21 +00:00
Pulse Monitor 62524f040a feat: make security setup fully automatic for systemd
- One-click security that actually applies immediately
- Creates systemd override file automatically
- Auto-restarts service after 2 seconds
- No manual command line steps needed
- Shows clear success message about auto-restart
- Still provides manual instructions for Docker users
2025-08-12 21:08:00 +00:00
Pulse Monitor b1b74b2bd8 fix: permanently solve frontend embed sync issue
- Add build.sh script that ensures frontend is copied before Go build
- Update backend-watch.sh to sync frontend on every restart
- Remove duplicate frontend files from internal/api/
- Frontend embed directory already in .gitignore
- No more manual copying needed - just run ./build.sh
2025-08-12 20:56:43 +00:00
Pulse Monitor 01dd7120be feat: add smart security context detection (Phase 3)
- Detect public vs private network access
- Show stronger warnings for public access without auth
- Red banner when accessed from internet without authentication
- Support for trusted networks configuration via PULSE_TRUSTED_NETWORKS
- Automatic RFC1918 private IP detection
- Enhanced security status API with network context
- Added debug logging for encryption key loading
2025-08-12 20:23:37 +00:00
Pulse Monitor f46b8a89cb feat: add Quick Security Setup wizard for one-click security hardening
- Created QuickSecuritySetup component with password/token generation
- Added /api/security/quick-setup endpoint to generate config
- Shows credentials once with copy/download functionality
- Generates systemd environment configuration file
- Only shows when authentication is not already enabled
2025-08-12 20:10:21 +00:00
Pulse Monitor 70f240ff4c feat: add non-intrusive security warning system
- Security warning banner shows when security score is low
- Displays security score (0-5) based on enabled features
- Fully dismissible (1 day, 1 week, forever)
- Shows details of what's enabled/disabled
- Links directly to Security settings tab
- Enhanced /api/security/status endpoint
- Updated documentation

This is Phase 1 of the security improvement plan:
- Non-breaking (no user impact)
- Educational (shows security posture)
- Dismissible (respects user choice)
- Helpful (one-click to security settings)
2025-08-12 19:55:59 +00:00
Pulse Monitor 8e42397577 feat: include guest metadata in config export/import
- guest URLs are now backed up with config export
- restored on import to preserve custom URLs across migrations
- stored in plain text (not encrypted) as they're just service URLs, not credentials
- import failures for guest metadata are non-fatal (logged as warnings)
2025-08-12 16:54:18 +00:00
Pulse Monitor 13ce7f2b7d 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 519b93e8ec 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 57b8dbe104 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 efa451ff9c 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 823f145c4d chore: bump version to v4.3.1-rc.1 2025-08-12 14:29:37 +00:00
Pulse Monitor 9576663e9d 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