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 |
||
|---|---|---|
| .. | ||
| adapter_installsh.go | ||
| history.go | ||
| manager.go | ||
| manager_test.go | ||
| updater.go | ||
| version.go | ||
| version_test.go | ||