Commit Graph

1056 Commits

Author SHA1 Message Date
rcourtman f9b8037486 fix: resolve install script unbound variables and add update command
Addresses #450, #451, #406

- Initialize all variables at top of script to prevent "unbound variable" errors with set -u
  - BUILD_FROM_SOURCE, SKIP_DOWNLOAD, IN_CONTAINER, IN_DOCKER now set at line 20-27
  - ENABLE_AUTO_UPDATES, FORCE_VERSION, FORCE_CHANNEL, SOURCE_BRANCH also moved to top
  - Removed duplicate assignments from argument parsing section

- Restore /bin/update command creation for ProxmoxVE LXC installations
  - Creates update script that re-runs install.sh for easy updates
  - Allows backend to properly detect ProxmoxVE deployment type
  - Users can now run "update" in LXC console as documented

- Update deployment detection to recognize install.sh in update command
  - Previously only looked for legacy "pulse.sh" reference
  - Now checks for both pulse.sh and install.sh
2025-09-30 16:16:10 +00:00
rcourtman 413ef73953 improve webhook system security and robustness
addresses security vulnerabilities and improves webhook reliability

Changes:
- Add SSRF protection with redirect controls and strict URL validation
- Add response size limits (1MB cap) to prevent memory exhaustion
- Fix race condition in SendTestNotification
- Add per-webhook rate limiting (10 req/min)
- Add Retry-After header support for proper backoff
- Extract magic numbers to configurable constants
- Block localhost, link-local, and cloud metadata endpoints
- Add secure HTTP client with redirect validation
- Remove duplicate function definitions
- Clean up unused code

Security improvements:
- Prevents SSRF attacks via redirect chains
- Protects against DoS via large responses
- Rate limits prevent webhook flooding
- Thread-safe webhook operations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-30 15:57:28 +00:00
rcourtman 552173b262 fix: improve alert system robustness and security
Addresses multiple issues identified during comprehensive alert system audit:

1. Fix ZFS device loop lock issue
   - Moved lock acquisition outside loop in checkZFSPoolHealth
   - Changed clearAlert to clearAlertNoLock when lock already held
   - Prevents multiple lock acquisitions in same iteration

2. Add alert deduplication on restore
   - Prevents duplicate alerts after service restart
   - Tracks seen alert IDs during LoadActiveAlerts
   - Logs warnings for any duplicates found

3. Add API input validation
   - validateAlertID function prevents DOS attacks
   - Limit alert ID length to 500 characters
   - Whitelist allowed characters (alphanumeric, -, _, :, /, .)
   - Cap history limit parameter at 10,000 records
   - Applied validation to acknowledge, unacknowledge, and clear endpoints

4. Add panic recovery to goroutines
   - All SaveActiveAlerts goroutines now have defer/recover
   - Cleanup goroutines protected from panics
   - Contextual error logging for each goroutine type

5. Document lock ordering
   - Added comprehensive documentation for Manager mutexes
   - Explains m.mu and resolvedMutex relationship
   - Clarifies acquisition rules to prevent deadlocks
   - Inline comments for resolvedMutex field

These fixes improve stability, security, data integrity, and maintainability
of the alert system without breaking API compatibility.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-30 15:35:39 +00:00
rcourtman 1def73499f chore: remove mock.env.good and improve gitignore patterns 2025-09-30 15:23:38 +00:00
rcourtman 1d987efcc9 docs: fix VM disk monitoring documentation and remove false token limitation claims
Corrected widespread misinformation claiming API tokens cannot access guest agent data on Proxmox 9.

Changes:
- Rewrote VM_DISK_MONITORING.md with accurate technical explanation
- Deleted VM_DISK_STATS_TROUBLESHOOTING.md (contained false information)
- Updated FAQ.md with correct quick reference and troubleshooting link
- Added comprehensive VM disk troubleshooting section to TROUBLESHOOTING.md
- Fixed README.md troubleshooting reference
- Updated frontend tooltip to show accurate permission requirements
- Corrected backend log messages to remove "known limitation" language
- Updated test-vm-disk.sh diagnostic script with accurate guidance

Key corrections:
- API tokens work fine for guest agent queries on both PVE 8 and 9
- Proxmox API returning disk=0 is normal behavior, not a bug
- Both tokens and passwords work equally well
- Only requirements: guest agent installed + proper permissions
- Permission issues are config problems, not authentication method limitations

Documentation now provides clear user journey: FAQ → Troubleshooting → Full Guide

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-30 15:14:23 +00:00
Pulse Monitor 6f0bcf207d fix: resolve alert manager deadlock and add demo server link
- Fix deadlock in checkEscalations by releasing lock before processing alerts
- Add timeout protection in GetState when calling GetActiveAlerts
- Add read-only demo mode with middleware blocking modifications
- Add demo banner component for frontend
- Add demo server link to README (https://demo.pulserelay.pro)

addresses potential broadcast hangs in production environments

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-30 14:58:54 +00:00
Pulse Monitor e0e5528fe3 feat: add demo mode with read-only protection
Adds DEMO_MODE environment variable that blocks all write operations
while allowing full read/view functionality. Includes banner notification
in UI when demo mode is active.

Addresses need for safe public demo instances.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-30 14:46:20 +00:00
Pulse Monitor 3331e1f2ab feat: add real-time streaming discovery and improve dev/mock mode switching
- Added streaming discovery that shows servers as they're found
- Backend sends WebSocket updates for each discovered server
- Frontend displays servers immediately without waiting for full scan
- Created sync-production-config.sh to preserve nodes when switching modes
- Updated toggle-mock.sh to sync config when disabling mock mode
- Dev environment now maintains separate config that syncs from production
- Enabled discovery service in dev environment by default

addresses real-time discovery UX and mock/production mode configuration persistence
2025-09-30 13:13:32 +00:00
Pulse Monitor 347aa9e6d6 fix: add missing SKIP_DOWNLOAD initialization
Addresses #459 #461 - Consolidates variable initialization at the top
of the script alongside other defaults. Removes redundant BUILD_FROM_SOURCE
initialization from argument parsing section.
2025-09-30 10:50:59 +00:00
Pulse Monitor d7d9a9e1f4 fix: correct error variable names in Login component
Fix TypeScript errors where catch blocks used _err but referenced err
in console.error calls. This was causing CI type-check failures.

Changes:
- Remove underscore prefix from error variables since they're used
- Fixes TS2552: Cannot find name 'err' errors

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-30 10:47:44 +00:00
Pulse Monitor 5b1b04ca5c chore: remove abandoned Pulse+ references and old changelog
- Remove old RC changelog (v4.15.0-rc.6)
- Update .gitignore comment for experimental features
- Clean up repo of unused files

Pulse+ / cloud relay feature was abandoned, no telemetry or cloud
features are part of Pulse. All monitoring stays local.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-30 10:41:37 +00:00
Pulse Monitor e98fe46a31 fix: repair hot-dev script and mock data system
- Fix port conflict: backend now uses 7656, frontend uses 7655
- Fix mock mode not loading: use load_env_file for proper export
- Fix pipefail crashes on port checks: disable during lsof checks
- Add error handling for /etc/pulse/.env permission issues
- Update .gitignore to exclude sensitive files and temp scripts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-30 10:38:35 +00:00
rcourtman 5470d2350b Add runtime mock toggles and auth-safe dev assets 2025-09-30 10:02:26 +00:00
rcourtman 013431a139 chore: tidy repo formatting and linting 2025-09-29 20:19:18 +00:00
rcourtman 644d8b1520 Tighten dashboard table spacing 2025-09-29 18:11:33 +00:00
rcourtman c6c7797aad Improve storage and backups sorting UX 2025-09-29 18:09:41 +00:00
rcourtman e72d12d86e Refine security settings UI and credential rotation flow 2025-09-29 17:42:10 +00:00
rcourtman 39ba5b60ce Document new Docker public URL guidance and bundled disk helper 2025-09-29 16:47:06 +00:00
rcourtman 8910e1e379 Fix installer defaults, auth fallbacks, alert persistence, and docs helper 2025-09-29 16:36:33 +00:00
rcourtman c98ba66435 Stretch Guest URLs table to full width 2025-09-29 16:30:49 +00:00
rcourtman a79c570940 Fix discovery list indicator alignment 2025-09-29 16:22:59 +00:00
rcourtman 35054acea2 Improve discovery UX on PVE/PBS settings 2025-09-29 16:16:37 +00:00
rcourtman 3d78c0a9fa Improve security settings UX and fix alerts typing 2025-09-29 15:52:03 +00:00
rcourtman 9852ef9047 Align dev ports and improve auto-register UX 2025-09-29 15:05:59 +00:00
rcourtman f3e52cde19 Improve alerts defaults and websocket cleanup 2025-09-29 13:23:35 +00:00
rcourtman 97f08798b4 Fix frontend typings and update notifications layout 2025-09-29 12:48:04 +00:00
rcourtman 645c793f82 feat: add OIDC single sign-on 2025-09-29 10:22:27 +00:00
rcourtman 98913040c5 docs: clarify optional OIDC 2025-09-29 10:14:20 +00:00
rcourtman 89809e64de docs: expand OIDC guidance 2025-09-29 10:10:25 +00:00
rcourtman 8f731e8d76 fix: make guest url actions react instantly 2025-09-28 19:24:04 +00:00
rcourtman 4d97fbe3cc fix: make guest url actions react instantly 2025-09-28 19:16:30 +00:00
rcourtman 6ae8a27a03 style: surface guest URL actions in settings 2025-09-28 19:07:59 +00:00
rcourtman 2fef77cd01 fix: resolve guest URL action visibility 2025-09-28 18:52:14 +00:00
rcourtman 6f4771ae2d feat: unify styling and improve cluster detection 2025-09-28 18:46:52 +00:00
Pulse Monitor 9331ef53ae Revert "fix: only use cluster/resources when IsCluster is true (addresses #448)"
This reverts commit 4a9912f410.
2025-09-11 20:21:08 +00:00
Pulse Monitor 6e8e2d14f5 fix: only use cluster/resources when IsCluster is true (addresses #448)
The aggressive use of cluster/resources was breaking storage collection
for setups with multiple standalone nodes or improperly clustered nodes.
Now only uses cluster/resources when explicitly configured as a cluster,
falling back to traditional node-by-node polling otherwise.

This should fix the missing storage issue where one node's storage
wasn't showing after upgrading to rc5.
2025-09-11 20:18:18 +00:00
Pulse Monitor 1f115897c7 fix: use correct binary path after build
The Makefile builds to ./pulse not bin/pulse. Updated the install script
to copy from the correct location.
2025-09-11 16:42:17 +00:00
Pulse Monitor 63f51984aa fix: export Go path before building from source
The build was failing because Go wasn't in PATH after installation. Now
exports PATH=/usr/local/go/bin:/home/pulse/.local/bin:/home/pulse/.local/bin:/home/pulse/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games before running make build.
2025-09-11 16:39:15 +00:00
Pulse Monitor cc75318340 fix: install npm dependencies before building from source
The build was failing because npm packages weren't installed. Now runs
npm install in frontend-modern directory before running make build.
2025-09-11 16:36:52 +00:00
Pulse Monitor 688627756c fix: inline Go installation code to fix undefined install_go function
The --main flag was calling install_go which didn't exist. Now properly
installs Go 1.23 when needed during source builds.
2025-09-11 16:31:17 +00:00
Pulse Monitor b3c5343f8c fix: handle --main flag properly for existing installations (addresses #448)
The install script now correctly builds from source when --main is specified,
even if Pulse is already installed. Previously it would go into the update
prompt instead of building from source.
2025-09-11 16:29:42 +00:00
Pulse Monitor 1412105f99 fix: preserve storage when node returns empty result but has existing data (addresses #448)
The issue was that when a node was successfully polled but returned empty storage
(e.g., due to API permissions), it was still marked as 'successfully polled'.
This prevented the preservation logic from keeping existing storage data.

Now if a node returns empty storage but we have existing storage for that node,
we don't mark it as polled, allowing the preservation logic to keep the data.

This should fix the issue where storage disappears from one node in #448.
2025-09-11 16:00:25 +00:00
Pulse Monitor d514458fbb fix: improve storage collection resilience when nodes timeout (addresses #448)
- Send error result to channel when storage query times out so preservation logic works
- Ensures storage data is preserved for nodes that experience timeouts
- Fixes issue where storage/backups would disappear when a node times out
2025-09-11 15:51:37 +00:00
Pulse Monitor cdbb92f01c fix: correct binary path when building from source
The Makefile builds to 'pulse' not 'bin/pulse', updated the install
script to copy from the correct location.
2025-09-11 15:41:01 +00:00
Pulse Monitor d203a746e8 fix: install Go 1.23 when building from source if system Go is too old
- Checks if system Go version meets minimum requirement (1.21+)
- Downloads and installs Go 1.23 from official releases if needed
- Supports amd64, arm64, and armv6l architectures
- Ensures Go is in PATH for the build process

This fixes build failures on Debian 12 which ships with Go 1.19
2025-09-11 15:35:03 +00:00
Pulse Monitor 8db2ab264a fix: handle missing argument for --main option
Fixed 'unbound variable' error when using --main without additional arguments.
Added check for argument count before accessing $2.
2025-09-11 15:20:39 +00:00
Pulse Monitor 12ab1b0c6f docs: document --main install option for testing latest fixes
- Added to README.md Quick Start section
- Added comprehensive docs in INSTALL.md
- Explains when and why to use --main option
- Notes build dependencies requirement
2025-09-11 15:19:57 +00:00
Pulse Monitor 2bc834de70 improve: add --main as primary option for building from source
- --main is now the primary option (clearer intent)
- --source, --from-source, --branch remain as aliases
- Help text shows --main first for better discoverability

Usage: curl -fsSL https://raw.githubusercontent.com/rcourtman/Pulse/main/install.sh | bash -s -- --main
2025-09-11 15:16:40 +00:00
Pulse Monitor b45220600b feat: add --source option to install script for building from source
- Added --source, --from-source, and --branch options (all equivalent)
- Allows building and installing Pulse from source code
- Optional branch parameter (defaults to main)
- Builds frontend and backend locally before installing
- Removes separate install-from-main.sh script - integrated into main script

Usage:
  curl -fsSL https://raw.githubusercontent.com/rcourtman/Pulse/main/install.sh | bash -s -- --source
  curl -fsSL https://raw.githubusercontent.com/rcourtman/Pulse/main/install.sh | bash -s -- --source develop
2025-09-11 15:15:27 +00:00
Pulse Monitor 35c6166354 feat: add script to install Pulse from main branch source
Allows users to test latest changes without waiting for a release.
Usage: curl -sSL https://raw.githubusercontent.com/rcourtman/Pulse/main/scripts/install-from-main.sh | sudo bash
2025-09-11 15:10:56 +00:00