Commit graph

345 commits

Author SHA1 Message Date
rcourtman
690cc94e17 Support local archives for Proxmox installs 2026-04-05 23:35:54 +01:00
rcourtman
0a68d79871 Make agent installs version-aware 2026-04-05 23:35:54 +01:00
Nguyễn Quang Vinh
e2b2c2be12
Fix finalize_plist_env_block function call 2026-04-02 16:16:36 +07:00
rcourtman
23c04284e0 Avoid duplicate release installation sections 2026-04-01 13:26:10 +01:00
rcourtman
0d16ee331a Add legacy sensor-proxy uninstall helper (#1363) 2026-03-26 23:09:16 +00:00
rcourtman
65092bea4e Persist rootless container runtime sockets in unified installer (#1200) 2026-03-26 22:51:29 +00:00
rcourtman
0f2982ce3f Fix auto-update leaving Pulse stopped in LXC installs (#1323) 2026-03-25 23:49:25 +00:00
rcourtman
a00081fce8 Accept legacy installer boolean flags (#1299) 2026-03-25 11:29:23 +00:00
rcourtman
c0b3a0e665 Restart Pulse service after failed auto-update (#1323)
The auto-update flow stops the Pulse service before applying updates.
If the update fails, the rollback path restored files but never
restarted the service. Since the main unit was explicitly stopped
(not crashed), systemd's Restart=always didn't rescue it.

Add restart-on-failure guards to both pulse-auto-update.sh and
install.sh so Pulse is always restarted after a failed update attempt.
2026-03-07 10:46:19 +00:00
rcourtman
01bf637d0d Fix QNAP agent duplicate processes during upgrades (#1317)
Add singleton watchdog with lock dir, pidfile tracking, and signal
traps to prevent multiple pulse-agent instances spawning on QNAP.
Tighten procfs matching to avoid killing unrelated processes.
2026-03-06 11:40:53 +00:00
rcourtman
499ab812e3 Fix post-release regressions and lock v5 to single-tenant runtime 2026-03-05 23:46:35 +00:00
rcourtman
cdceccef05 fix(agent): kill old QNAP agent processes during upgrade (#1317)
Add stop_qnap_agents() helper that kills wrapper scripts before binaries
to prevent watchdog respawn, and uses path-based pkill patterns that work
with BusyBox and match agents at both old and new install paths.
2026-03-05 10:01:43 +00:00
rcourtman
aae6035e66 fix(docs): audit and fix agent docs vs install script discrepancies (#1299)
- Split configuration table into "Installer flags" and "Agent-only flags"
  so users know which flags work with `curl | bash` vs the binary directly
- Add missing --cacert and --env flags to installer docs
- Fix --disable-auto-update example (install script doesn't accept it;
  use --env PULSE_DISABLE_AUTO_UPDATE=true instead)
- Add --disable-docker/kubernetes/proxmox and --proxmox-type to
  install.sh show_help()
- Fix --enable-docker=false in CENTRALIZED_MANAGEMENT.md
2026-02-27 21:20:54 +00:00
rcourtman
b1d58fc8aa fix(installer): avoid "No space left on device" on QNAP by writing binary to persistent storage
On QNAP, /usr/local/bin is a tiny RAM disk. The installer was downloading
the binary then mv'ing it there, which failed when the RAM disk was full.
The QNAP-specific logic that copies to the persistent data volume only
ran after that mv.

Move QNAP detection before the download step so INSTALL_DIR points to the
persistent data volume (e.g. /share/CACHEDEV1_DATA/.pulse-agent) directly.
The wrapper script still attempts to copy to /usr/local/bin at boot but
falls back to running from persistent storage if that fails.

Also fixes:
- pkill -f pattern in wrapper could match and kill the wrapper itself
  (path contains "pulse-agent"); switched to pkill -x for exact match
- Upgrade detection now checks /usr/local/bin for legacy QNAP installs
- Uninstall cleans up /usr/local/bin runtime copy
2026-02-27 20:41:32 +00:00
rcourtman
8298852483 feat(installer): add QNAP QTS/QuTS hero agent support (#1253)
QNAP wipes /etc/init.d on every reboot, so the agent needs persistent
storage on a data volume and autorun.sh boot persistence via the flash
config partition. Adds detection, install (with watchdog wrapper), and
clean uninstall paths. Flash config mount/umount is fail-safe via
subshell isolation to prevent leaving the partition mounted on write
errors.
2026-02-27 14:19:40 +00:00
rcourtman
3da224877c feat(agent): add --env flag for custom environment variables in service files (#1277)
Users can now pass --env KEY=VALUE (repeatable) to the install script to
inject custom environment variables into the agent's service file. Useful
for KUBECONFIG and similar paths not auto-detected by the installer.

The Settings UI adds a textarea for entering env vars that get appended
to the generated install command. Both frontend and script validate key
format and reject unsafe value characters.
2026-02-20 20:15:29 +00:00
rcourtman
1d07c1cd30 fix(agent): prevent duplicate PVE entries on agent re-registration (#1245)
Two changes to prevent duplicates in Settings > Virtual Environment:

1. Install script: only clear Proxmox state files on fresh installs,
   not upgrades. Previously every install forced re-registration.

2. Auto-register dedup: match agent re-registrations by server name
   when both the existing entry and new request have Pulse-created
   tokens (pulse-monitor@pam!pulse-*). This catches the case where
   the agent creates a new token after state files are cleared.
2026-02-20 19:38:03 +00:00
rcourtman
04d8c45ede fix(install): pass --cacert CA certificate to agent via SSL_CERT_FILE (#1201)
The --cacert flag was only used for curl during installation. On systems
with custom CA certificates (e.g. TrueNAS CORE with certs in
/etc/certificates/CA), the agent process had no way to trust the custom
CA and users had to fall back to --insecure.

Set SSL_CERT_FILE in the agent's runtime environment when --cacert is
provided. Go's crypto/x509 reads this natively, so the agent trusts the
custom CA without any binary changes. All service types are covered:
systemd, upstart, launchd, FreeBSD rc.d, OpenRC, SysV init, and Unraid.

Also validates the --cacert path at install time: directories and missing
paths now fail early with a clear message instead of silently proceeding.
2026-02-19 09:55:09 +00:00
rcourtman
cf047bd899 feat(install): add TrueNAS CORE (FreeBSD) support to install script (#1201)
Extends the TrueNAS SCALE installer to also support TrueNAS CORE
(FreeBSD-based). The installer auto-detects the platform and configures
the appropriate service manager: systemd for SCALE, rc.d for CORE.

- Rename is_truenas_scale() to is_truenas() with FreeBSD detection
- Add FreeBSD rc.d service script generation with placeholder substitution
- Add FreeBSD bootstrap script for Init/Shutdown task persistence
- Split install/uninstall paths by OS throughout the TrueNAS block
- Add --cacert <path> flag for custom CA bundles (wired to curl only,
  not passed to the agent binary)
- Fix --cacert incorrectly mapping to --insecure in exec args
- Fix missing closing quote on RCSCRIPT_LINK in FreeBSD bootstrap
- Fix unreachable echo after exit 0 in FreeBSD bootstrap

Co-authored-by: wilddev65 <wilddev65@users.noreply.github.com>
(cherry picked from commit affdbaeebaf2b1135431b232593122f464c6bb53)
2026-02-18 12:59:55 +00:00
rcourtman
3d0082c07e chore: update dev paths to /Volumes/Development
Migrated hardcoded paths from ~/Development to /Volumes/Development.
2026-02-07 19:20:37 +00:00
rcourtman
f253ed2778 fix(license): harden release key validation and fingerprint logging 2026-02-07 14:18:44 +00:00
rcourtman
cea2fdd40f fix: add FreeBSD binaries to release manifest and validation
The previous commit added FreeBSD binaries to the Docker build and
release directory but didn't update the manifest generator or validation
script. Without this, FreeBSD binaries would be built but not tracked
or validated, and release validation would fail on the new entries.

Related to #1051
2026-02-04 11:00:31 +00:00
rcourtman
7346d48872 fix: add FreeBSD agent binaries to Docker build and fix pfSense boot (#1051)
Two fixes for FreeBSD agent support:

1. The Docker image never built or included FreeBSD agent binaries, causing
   404 errors when FreeBSD clients requested the download. Added FreeBSD
   amd64/arm64 cross-compilation for both host-agent and unified-agent,
   plus COPY statements to include them in the image. Also added bare
   FreeBSD binaries to GitHub release assets for the redirect fallback.

2. pfSense does not use the standard FreeBSD rc.d boot system — scripts
   in /usr/local/etc/rc.d/ must end in .sh to run at boot. The installer
   now detects pfSense and creates a .sh boot wrapper alongside the
   standard rc.d script. Also added -r flag to daemon for auto-restart.

Related to #1051
2026-02-04 10:55:55 +00:00
rcourtman
1490a6e6e3 revert: remove dual-key license verification
Restored original license signing key from backup - key was never
compromised (private repo). Removes unnecessary dual-key complexity:

- Remove legacyPublicKey and SetLegacyPublicKey from license.go
- Simplify signature verification to single key
- Remove EmbeddedLegacyPublicKey from pubkey.go
- Remove PULSE_LICENSE_LEGACY_PUBLIC_KEY from Dockerfile and workflows
- Remove dual-key test
- Simplify mock.env
2026-02-03 21:29:21 +00:00
rcourtman
f810a003eb license: add dual-key verification 2026-02-03 20:45:00 +00:00
rcourtman
c2de5f7f4c Fix: add Windows uninstall command support for unified agent
The UI only showed a bash uninstall command which doesn't work on Windows.
Added PULSE_UNINSTALL env var support to install.ps1 and updated the UI
to display platform-specific uninstall commands for both Linux/macOS and
Windows.

Related to #1176
2026-02-03 12:03:06 +00:00
rcourtman
36ff16cd85 chore(test): fix test asset dependencies
- Add ensure_test_assets.sh script to generate dummy frontend assets for testing
- Update Makefile to run asset generation before tests
2026-02-02 14:53:41 +00:00
rcourtman
78cb794640 fix: add --hostname flag to agent installer scripts. Related to #1169
The agent binary supported --hostname but the installer scripts
didn't accept or forward it, causing "[ERROR] Unknown argument".
2026-02-02 14:08:28 +00:00
rcourtman
fa1b74792e docs: add comprehensive deep-dive documentation for AI subsystems
Adds detailed architecture documentation for Pulse Patrol and Pulse Assistant. Updates AI.md and PULSE_PRO.md. Also includes additional tests.
2026-02-02 10:29:07 +00:00
rcourtman
7926524a29 fix(build): use indexed arrays for POSIX shell compatibility
Replace bash associative arrays with parallel indexed arrays to ensure
the build script works on systems with older bash versions or when run
under /bin/sh.

Changes:
- Replace host_agent_builds associative array with host_agent_envs indexed array
- Replace builds associative array with build_envs indexed array
- Add array length validation to catch config mismatches early
- Use index-based iteration instead of key-based lookup
2026-02-01 23:26:51 +00:00
rcourtman
9b0fb527f5 feat(patrol): implement patrol findings, evaluation, and investigation logic
- Add core Patrol system for automated investigations
- Implement findings management and deduplication logic
- Add evaluation framework (patrol_eval) with quality assertions and scenarios
- Add patrol-specific tools and executor integration
- Add E2E test matrix script
2026-01-31 16:23:08 +00:00
rcourtman
ac97418159 chore: add evaluation scripts, CI workflow and dev tooling 2026-01-30 19:00:48 +00:00
rcourtman
17208cbf9d docs: update AI evaluation matrix and approval workflow documentation 2026-01-30 19:00:40 +00:00
rcourtman
6873913e64 fix: install script and docs improvements
- Fixed --disable-docker not being passed to systemd service file. Related to #1151
- Added init: true requirement to HTTPS/TLS docs for Docker. Related to #1166
2026-01-26 20:48:57 +00:00
rcourtman
4c19fa3c1b fix: resolve btrfs disk summing (#1158), podman disable flag (#1151), and diagnostics path (#1155) 2026-01-23 19:24:38 +00:00
rcourtman
66e8460196 chore: update dev scripts and mock configuration
- Improve hot-dev script
- Add sync-production-config script
- Update toggle-mock script
- Update mock environment
2026-01-22 22:32:45 +00:00
rcourtman
85f171290b Support: Add Kubernetes monitoring options to agent installers
- Added --kube-include-all-pods and --kube-include-all-deployments flags
- Added --help support to install.sh
- Moved root check in install.sh to allow viewing help as non-root
2026-01-22 16:41:40 +00:00
rcourtman
351bd0539e feat(dev): add file backup watcher status to dev-check 2026-01-22 14:27:14 +00:00
rcourtman
c743bd2c30 feat(dev): add optional file backup watcher to hot-dev
When scripts/watch-backup.sh exists (gitignored, local only), hot-dev
automatically starts a file watcher that backs up source files on every
save to ~/.pulse-backups/. Protects against accidental data loss from
git checkout or other mishaps, regardless of what tool makes the change.
2026-01-22 14:25:21 +00:00
rcourtman
2e0da42a81 chore: reliability and maintenance improvements
Host agent:
- Add SHA256 checksum verification for downloaded binaries
- Verify checksum file matches expected bundle filename

WebSocket:
- Add write failure tracking with graceful disconnection
- Increase write deadline to 30s for large state payloads
- Better handling for slow clients (Raspberry Pi, slow networks)

Monitoring:
- Remove unused temperature proxy imports
- Add monitor polling improvements
- Expand test coverage

Other:
- Update package.json dependencies
- Fix generate-release-notes.sh path handling
- Minor reporting engine cleanup
2026-01-22 00:45:04 +00:00
rcourtman
222c88f33c chore: Mac-compatible dev scripts
- hot-dev.sh: Fix hostname -I for macOS, use ifconfig instead
- hot-dev.sh: Fix PULSE_AUDIT_DIR for mock mode
- hot-dev.sh: Use PULSE_REPOS_DIR for Pro module detection
- dev-check.sh: Fix pgrep -c (not supported on macOS)
- dev-check.sh: Use /tmp/pulse-debug.log on macOS instead of journalctl
- Update internal/api docs to use env var paths
2026-01-22 00:30:15 +00:00
rcourtman
98d5a5684a chore(scripts): update build and install scripts
- build-release.sh: remove sensor proxy binary build
- install-docker.sh: simplify agent installation
- hot-dev.sh, cleanup.sh: remove proxy references
- validate-release.sh: update validation checks
2026-01-21 12:02:03 +00:00
rcourtman
d4a6c0d2e8 refactor: remove legacy pulse-sensor-proxy temperature monitoring
The sensor proxy approach for temperature monitoring has been superseded
by the unified agent architecture where host agents report temperature
data directly. This removes:

- cmd/pulse-sensor-proxy/ - standalone proxy daemon
- internal/tempproxy/ - client library
- internal/api/*temperature_proxy* - API handlers and tests
- internal/api/sensor_proxy_gate* - feature gate
- internal/monitoring/*proxy_test* - proxy-specific tests
- scripts/*sensor-proxy* - installation and management scripts
- security/apparmor/, security/seccomp/ - proxy security profiles

Temperature monitoring remains available via the unified agent approach.
2026-01-21 11:59:04 +00:00
rcourtman
56ea5d6493 feat: add verified bug fix detection to release notes
Finds commits referencing GitHub issues (#xxx) and verifies the
fix is still present in the final diff before including it.
This prevents mentioning features/fixes that were later reverted.
2026-01-20 22:29:05 +00:00
rcourtman
ce51b731d7 fix: auto-load Anthropic key from local secrets file 2026-01-20 22:19:09 +00:00
rcourtman
3cf96eb068 refactor: use code diffs instead of commit messages for release notes
The previous approach used commit messages which could include changes
that were later reverted. Now the script analyzes actual git diffs
between versions to identify user-facing changes.

Extracts diffs from:
- API handlers (new endpoints)
- Frontend components (new features)
- Config options (new settings)
- Alerts/notifications (webhook changes)
- Agent code (host/docker features)
- Install scripts

Passes structured diffs to LLM with instructions to write plain,
factual release notes without marketing language.
2026-01-20 22:13:38 +00:00
rcourtman
c48d15ccbd fix: Agent install URL case-sensitivity and nohup compatibility. Related to #1129, #1132
- Make URL validation case-insensitive to accept Http://, HTTP://, etc.
- Replace nohup with shell backgrounding for QNAP platform compatibility
- Add disown for SIGHUP protection where available

fix: AI chat mobile responsiveness. Related to #1131

- Use responsive width (full on mobile, 480px on larger screens)
- Add flex-wrap to header for better mobile layout
2026-01-20 21:36:14 +00:00
rcourtman
e5eb4517db fix: remove duplicate else in trigger-release.sh 2026-01-20 17:26:26 +00:00
rcourtman
fe3857f6ec chore(scripts): Remove OpenCode sidecar references from dev scripts
dev-check.sh:
- Remove OpenCode process detection and kill commands
- Remove MCP connection status checks
- OpenCode sidecar no longer used

hot-dev.sh:
- Remove pulse-sensor-proxy socket detection (deprecated)
- Remove OpenCode sidecar cleanup commands
- Remove PULSE_USE_OPENCODE environment variable
- Add self-restart check for script changes
- Simplify startup by removing sidecar dependencies

The native chat service (internal/ai/chat) handles AI directly
without needing an external OpenCode subprocess.
2026-01-19 19:22:25 +00:00
rcourtman
2c4d7edf58 feat(install): add watchdog restart loop for Unraid agents
Implements exponential backoff restart loop in the wrapper script
for Unraid/Slackware installations. When the agent exits unexpectedly,
it will automatically restart with increasing delays (5s -> 60s max).

This improves reliability for users who don't have systemd for
automatic service restarts.
2026-01-17 14:41:59 +00:00