Commit graph

310 commits

Author SHA1 Message Date
Pulse Monitor
085fa49cb4 feat: improve export/import functionality and documentation
- Add clear documentation that auth settings are intentionally excluded from exports
- Update API docs to explicitly state what is/isn't included in exports
- Enhance migration guide with security notes about auth exclusion
- Add UI warning in export dialog about auth settings not transferring
- Each Pulse instance should configure its own authentication for security

Related to user feedback about auth settings not transferring between instances
2025-08-14 10:30:21 +00:00
Pulse Monitor
e32fc7742e fix: improve export dialog for users without authentication
- No longer shows 'Use your login password' option when no auth is configured
- Defaults to passphrase-only mode for auth-less instances
- Shows 'Encryption Passphrase' instead of confusing login password references
- Always enforces 12-character minimum for auth-less users
- Clearer messaging throughout for different auth states
2025-08-14 10:17:10 +00:00
Pulse Monitor
a441d66fd1 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
07c50f1947 docs: update export/import documentation
- Clarify that session auth (password login) is sufficient for export/import
- Document that guest metadata and custom console URLs are included
- Update FAQ with clearer backup instructions
- Add UI-first approach to README backup section
2025-08-14 10:04:15 +00:00
Pulse Monitor
0df5ecc41f revert: restore gradient animated login page
- Bring back the blue-cyan gradient background
- Restore animated Pulse logo with hover effects
- Keep the semi-transparent backdrop-blur card design
- Maintain the improved form field styling with icons
2025-08-14 09:56:44 +00:00
Pulse Monitor
65f973e93b 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
5793ba3bd7 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
ba619b818c fix: add CSRF token to export/import requests
- Export/import now includes X-CSRF-Token header from cookie
- Fixes 403 Forbidden error when exporting with session auth
- Both export and import endpoints now properly validate CSRF tokens
2025-08-14 09:34:54 +00:00
Pulse Monitor
01bf22b419 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
c845bfb9ee improve: enhance backup/restore UI with clearer password guidance
- Add visual cards for export/import actions with descriptive icons
- Allow users to use their login password by default for backups
- Add option for custom passphrase when needed
- Improve clarity around password requirements
- Add security notice with clear guidance
- Simplify the backup process by reducing password friction
2025-08-14 09:25:50 +00:00
Pulse Monitor
2b396d31ec 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
0b1d37d576 fix: improve clipboard functionality and enhance security UI
- Fix clipboard copy buttons not working over HTTP by using fallback method
- Add proper clipboard utility with document.execCommand fallback
- Update all copy buttons to use the fallback-enabled utility
- Enhance Authentication section UI with better visual hierarchy
- Add colored headers with gradients for security sections
- Implement card-based buttons with icons and descriptions
- Show actual Pulse URL in API token examples instead of placeholder
- Improve overall security settings layout and accessibility
2025-08-14 08:45:39 +00:00
Pulse Monitor
f49e290ea5 feat: add API token retrieval in current session
- Store API tokens in sessionStorage during security setup
- Add CurrentAPIToken component to display tokens from current session
- Show token section in Settings when authentication is enabled
- Tokens can only be retrieved during the session they were created
- After logout/restart, tokens cannot be recovered (stored as SHA3-256 hash)

This addresses user feedback about making API tokens retrievable after
initial setup, similar to other applications, while maintaining security.
2025-08-14 08:00:45 +00:00
Pulse Monitor
25037fa9fe fix: remove confusing duplicate API token section
The API Token Manager section was showing a different token than the one
created by Quick Security Setup, causing confusion.

Changes:
- Hide API Token Manager when using Quick Security Setup
- Quick Security Setup manages API tokens via systemd
- Add clarification that the token shown is for API automation
- Remove duplicate/confusing token management UI

The Quick Security Setup token is the only one that matters when using
that method of authentication setup.
2025-08-14 07:52:36 +00:00
Pulse Monitor
8b5c715ba5 feat: add custom password option to Quick Security Setup
Users can now choose between:
- Auto-Generate: Creates secure 16-character password (default)
- Custom: Set their own username and password

Features:
- Toggle between auto-generate and custom modes
- Custom username field (defaults to 'admin')
- Password validation (min 8 characters)
- Password confirmation field
- Clear messaging about password hashing
- Both modes use bcrypt hashing with cost factor 12
2025-08-14 07:45:08 +00:00
Pulse Monitor
b84396485c docs: update security documentation for hashed credentials
- Clarify that passwords are ALWAYS bcrypt hashed (never plain text)
- Document SHA3-256 hashing for API tokens
- Add Quick Security Setup as recommended method
- Update examples to show hashed format required
- Add security best practices section
- Add verification script reference
- Update troubleshooting for new auth variables
2025-08-14 07:41:31 +00:00
Pulse Monitor
958cacf042 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
b550aa6a29 fix: add CSRF token to password management requests
- Include CSRF token in change password requests
- Include CSRF token in remove password requests
- Get token from pulse_csrf cookie
- Add credentials: 'include' to ensure cookies are sent

This fixes the 'CSRF token validation failed' error when
trying to change or remove passwords.
2025-08-13 20:44:24 +00:00
Pulse Monitor
f2f47b10fa 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
0bd956a9db docs: update documentation for security changes and API improvements
Documentation Updates:
- Fix CORS documentation to reflect new secure defaults (no CORS by default)
- Add API token management endpoints to API.md
- Document CORS configuration in SECURITY.md
- Update environment variable documentation with defaults
- Add authentication variables (PULSE_PASSWORD, API_TOKEN, etc.)
- Add troubleshooting for CORS and authentication issues
- Remove outdated references to ALLOWED_ORIGINS=*
- Clarify that CORS defaults to same-origin only

All documentation now accurately reflects:
- Security improvements from recent audit
- New API token management features
- Correct CORS behavior and configuration
- Complete environment variable reference
2025-08-13 19:56:21 +00:00
Pulse Monitor
c563396f18 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
35b51c3a77 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
66403e88fb 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
4c59d53c0c 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
f33241a145 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
59f95dc13f 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
4a14ceb68e fix: improve security setup instructions with actual commands
- Replace vague 'see documentation' with actual commands
- Show systemd and Docker examples with credentials filled in
- Include the restart command in the instructions
- Make commands copy-paste ready with proper formatting
2025-08-12 21:03:45 +00:00
Pulse Monitor
b1c5c4e6ff fix: simplify and clean up Security tab UI
- Show Quick Setup prominently when no auth configured
- Hide API tokens and registration tokens when not needed
- Consolidate Export/Import into single Backup & Restore section
- Only show advanced features when authentication is enabled
- Remove redundant descriptions and duplicate sections
2025-08-12 21:01:48 +00:00
Pulse Monitor
6ac6f62950 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
7323aae12b 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
da6dc52a91 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
5e6a8357af cleanup: remove security audit documentation files 2025-08-12 20:01:33 +00:00
Pulse Monitor
56efbbd996 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
21bad84700 feat: standardize on bin/ directory structure for all archives
- ALL archives now use bin/pulse structure (including architecture-specific)
- Matches what Proxmox community script expects
- Install script checks bin/ first, falls back to root for old archives
- Eliminates confusion from having two different structures
- One consistent path forward: archives have bin/ directory
2025-08-12 19:30:59 +00:00
Pulse Monitor
389e5f0b73 fix: clean up build script and maintain compatibility
- Keep universal archive for Proxmox community script (expects bin/ structure)
- Architecture-specific archives have pulse in root (simpler)
- Install script handles both structures transparently
- Removed duplicate checksum generation
- Removed unnecessary frontend-modern directory from universal archive
2025-08-12 19:27:56 +00:00
Pulse Monitor
e51240c782 fix: add TODO comment about simplifying in v5
- Current dual-path logic needed for backwards compatibility
- v4.3.0 universal archive has bin/ structure
- Architecture-specific archives have pulse in root
- TODO: Standardize on single structure in v5
2025-08-12 19:21:52 +00:00
Pulse Monitor
7bc12f15fd fix: remove unnecessary frontend dist copy from build script
- Frontend is embedded in the binary since v4.3.0
- No need to copy dist files to release archives
- Reduces archive size
2025-08-12 19:18:10 +00:00
Pulse Monitor
afadeb835a fix: correct pulse binary path in install script (fixes #308)
- Install script now handles both archive layouts (with/without bin directory)
- Service file points to correct path: /opt/pulse/pulse (not /opt/pulse/bin/pulse)
- Fixes service startup issue in fresh LXC installations
2025-08-12 19:13:46 +00:00
Pulse Monitor
6a28d7dc20 docs: add comprehensive migration guide
- Created MIGRATION.md with clear backup/migration procedures
- Emphasizes export/import as the only supported migration method
- Warns against direct file copying
- Includes security notes about passphrase protection
- Added troubleshooting and pro tips
- Updated README and SECURITY docs to reference migration guide
2025-08-12 19:02:33 +00:00
Pulse Monitor
b968d91dcd 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
4166a56afd fix: prevent URL editor modal from closing on WebSocket updates
- moved modal state to Dashboard component level
- removed local modal state from GuestRow
- modal now persists through API updates and component re-renders
- passed openUrlEditor callback from Dashboard to GuestRow components
2025-08-12 16:41:15 +00:00
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
78381497c7 fix: add missing Telegram option in webhook service dropdown
- Telegram was available in backend but missing from frontend dropdown
- Added 'telegram' to service list and display name mapping
- Fixes issue where users couldn't select Telegram as webhook service
2025-08-12 15:42:05 +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
e42c1ab4e8 chore: bump version to v4.3.1-rc.1 2025-08-12 14:29:37 +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
6765db9b13 chore: bump version to v4.3.0 2025-08-12 13:09:09 +00:00