Pulse/scripts
rcourtman 804a638ea3 fix(sensor-proxy): critical Phase 2 locking and validation fixes
Fixes critical issues found by Codex code review:

**1. Fixed file locking race condition (CRITICAL)**
- Lock file was being replaced by atomic rename, invalidating the lock
- New approach: lock a separate `.lock` file that persists across renames
- Ensures concurrent writers (installer + self-heal timer) are properly serialized
- Without this fix, corruption was still possible despite Phase 2

**2. Fixed validation to honor configured allowed_nodes_file path**
- validate command now uses loadConfig() to read actual config
- Respects allowed_nodes_file setting instead of assuming default path
- Prevents false positives/negatives when path is customized

**3. Allow empty allowed_nodes lists**
- Empty lists are valid (admin may clear for security, or rely on IPC validation)
- validate no longer fails on empty lists
- set-allowed-nodes --replace with zero nodes now supported
- Critical for operational flexibility

**4. Installer error propagation**
- update_allowed_nodes failures now exit installer with error
- Prevents silent failures that leave stale allowlists
- Self-heal will abort instead of masking CLI errors

**Technical Details:**
- withLockedFile() now locks `<path>.lock` instead of target file
- Lock held for entire duration of read-modify-write-rename
- atomicWriteFile() completes while lock is still held
- Empty lists represented as `allowed_nodes: []` in YAML

**Testing:**
 Lock file created and persists across operations
 Empty list can be written with --replace
 Validation passes with empty lists
 Config path from allowed_nodes_file honored
 Concurrent operations properly serialized

These fixes ensure Phase 2 actually eliminates corruption by design.

Identified by Codex code review
Related to Phase 2 commit 3dc073a28
2025-11-19 09:47:43 +00:00
..
dev Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
lib feat: add shared script library system and refactor docker-agent installer 2025-10-20 15:13:38 +00:00
systemd Fix temperature monitoring on standalone Proxmox nodes (addresses #571) 2025-11-13 13:02:15 +00:00
tests Improve temperature proxy diagnostics and tests 2025-11-13 22:31:53 +00:00
.go-version Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
backup-claude-md.sh Fix critical version embedding issues for 4.26 release 2025-11-06 11:42:52 +00:00
build-release.sh Release workflow guardrails (related to #695) 2025-11-11 22:34:00 +00:00
bundle.manifest feat: add shared script library system and refactor docker-agent installer 2025-10-20 15:13:38 +00:00
bundle.sh feat: add shared script library system and refactor docker-agent installer 2025-10-20 15:13:38 +00:00
clean-mock-alerts.sh Add guest agent caching and update doc hints (refs #560) 2025-10-16 08:15:49 +00:00
cleanup.sh Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
codex-router.sh Update Pulse install flow and related components 2025-10-21 19:58:53 +00:00
create-sensor-user.sh security: complete Phase 1 sensor proxy hardening 2025-10-20 15:13:37 +00:00
docker-build.sh security: complete Phase 1 sensor proxy hardening 2025-10-20 15:13:37 +00:00
generate-release-notes.sh Polish release notes fallback 2025-11-13 09:10:43 +00:00
harden-sensor-proxy.sh security: complete Phase 1 sensor proxy hardening 2025-10-20 15:13:37 +00:00
hot-dev.sh chore: snapshot current changes 2025-11-02 22:47:55 +00:00
install-container-agent.sh Add support for linux-386 and linux-armv6 architectures (related to #674) 2025-11-09 08:35:24 +00:00
install-docker-agent-v2.sh Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
install-docker-agent.sh Improve host agent binary handling and docker installer purge (Related to #693) 2025-11-18 22:11:44 +00:00
install-docker.sh Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
install-go-toolchain.sh Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
install-host-agent.ps1 Related to #710: harden Windows installer arch detection 2025-11-14 10:50:56 +00:00
install-host-agent.sh Fix SELinux compatibility in host agent installer 2025-11-11 21:13:33 +00:00
install-sensor-proxy.sh fix(sensor-proxy): critical Phase 2 locking and validation fixes 2025-11-19 09:47:43 +00:00
migrate-sensor-proxy-control-plane.sh Improve temperature proxy control-plane flow 2025-11-15 21:49:51 +00:00
migrate-temperature-proxy.sh Auto-deploy proxy for standalone temp monitoring 2025-11-16 09:47:07 +00:00
package-helm-chart.sh release: prepare v4.25.0 2025-10-22 10:46:18 +00:00
pulse-auto-update.sh Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
pulse-proxy-rotate-keys.sh refactor: Rename pulse-temp-proxy to pulse-sensor-proxy 2025-10-13 13:17:05 +00:00
pulse-sensor-cleanup.sh Extend node cleanup to fully remove Pulse footprint 2025-11-14 22:58:50 +00:00
pulse-sensor-proxy.service Fix temperature monitoring for clustered and LXC Proxmox environments (addresses #571) 2025-11-13 13:25:27 +00:00
run-tests-mock.sh Adopt multi-token auth across docs, UI, and tooling 2025-10-14 15:47:49 +00:00
secure-sensor-files.sh security: complete Phase 1 sensor proxy hardening 2025-10-20 15:13:37 +00:00
setup-log-forwarding.sh docs: highlight runbooks in index and script verification checklist 2025-11-14 10:39:10 +00:00
sync-production-config.sh refactor: remove legacy DISABLE_AUTH flag and enhance authentication UX 2025-10-27 19:46:51 +00:00
test-vm-disk.sh Update Proxmox guest agent permissions docs and tooling (refs #548) 2025-10-14 10:21:52 +00:00
toggle-mock.sh refactor: remove legacy DISABLE_AUTH flag and enhance authentication UX 2025-10-27 19:46:51 +00:00
trigger-release.sh Fix remote sync check in release trigger script 2025-11-13 11:43:36 +00:00
uninstall-host-agent.ps1 Refine Windows host installer logging (related to #709) 2025-11-13 23:09:22 +00:00
uninstall-host-agent.sh feat: enhance macOS/Linux agent installation to match Windows quality 2025-10-23 22:23:23 +00:00
validate-published-release.sh Related to #698: harden installer release detection 2025-11-12 17:56:16 +00:00
validate-release.sh Fix Windows/macOS host agent downloads for bare metal installs (related to #684) 2025-11-11 21:26:33 +00:00