Pulse/internal
rcourtman 97871bec82 feat: implement updates rollback logic (Phase 1 follow-up)
Implement complete rollback functionality for systemd/LXC deployments:

**Rollback Strategy:**
- Downloads old binary from GitHub releases
- Restores config from timestamped backups
- Service detection (pulse/pulse-backend/pulse-hot-dev)
- Comprehensive health verification

**Implementation:**

Main rollback flow:
1. Create rollback history entry
2. Detect active service name
3. Download old binary version from GitHub
4. Stop Pulse service
5. Create safety backup of current config
6. Restore config from backup directory
7. Install old binary
8. Start service
9. Wait for health check (30s timeout)
10. Update rollback history (success/failure)

**Helper Functions:**

- detectServiceName(): Auto-detect active service from candidates
- downloadBinary(): Download specific version from GitHub releases
  - Auto-detects architecture (amd64/arm64)
  - Validates download success
  - Sets executable permissions
- stopService/startService(): Systemctl service management
- restoreConfig(): Atomic config restoration
- installBinary(): Safe binary installation with backup
- waitForHealth(): Retry health endpoint with timeout

**Safety Features:**
- Safety backup before restore (rollback-safety timestamp)
- Pre-rollback binary backup (.pre-rollback)
- Health check verification post-rollback
- Comprehensive error logging
- History tracking for audit

**Limitations:**
- Binary backup deleted by install.sh (downloads from GitHub)
- Network dependency for binary retrieval
- Config-only backups from current install.sh

**Testing:**
- Compiles cleanly
- Ready for unit/integration tests

Closes Phase 1 technical debt - rollback capability now functional.

Part of Phase 1 Security Hardening follow-up work
2025-10-20 15:13:38 +00:00
..
adapters Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
alerts security: complete Phase 1 sensor proxy hardening 2025-10-20 15:13:37 +00:00
api feat: add professional logging with runtime configuration and performance optimization 2025-10-20 15:13:38 +00:00
auth Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
config feat: add professional logging with runtime configuration and performance optimization 2025-10-20 15:13:38 +00:00
crypto Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
discovery fix: improve discovery performance and reliability 2025-10-18 22:59:40 +00:00
dockeragent Docker agent: add arch-aware self-update download 2025-10-16 08:43:59 +00:00
errors Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
interfaces Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
logging feat: add professional logging with runtime configuration and performance optimization 2025-10-20 15:13:38 +00:00
mock Adjust backup and snapshot alert handling 2025-10-18 20:11:01 +00:00
models Adjust backup and snapshot alert handling 2025-10-18 20:11:01 +00:00
monitoring feat: enhance scheduler health API with rich instance metadata 2025-10-20 15:13:38 +00:00
notifications security: complete Phase 1 sensor proxy hardening 2025-10-20 15:13:37 +00:00
ssh/knownhosts security: complete Phase 1 sensor proxy hardening 2025-10-20 15:13:37 +00:00
tempproxy security: add resilience and error handling to tempproxy client 2025-10-19 16:37:11 +00:00
types Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
updates feat: implement updates rollback logic (Phase 1 follow-up) 2025-10-20 15:13:38 +00:00
utils Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
websocket Fix settings security tab navigation 2025-10-11 23:29:47 +00:00