Skip to content

Recovery Service

The Recovery Service is Nova’s resilience layer. It is designed to stay alive when all other Nova services are down, providing backup/restore, factory reset, service management, and environment configuration capabilities.

PropertyValue
Port8888
FrameworkFastAPI + asyncpg + Docker SDK
DependenciesPostgreSQL + Docker socket only
Sourcerecovery-service/

The Recovery Service intentionally has minimal dependencies. It connects directly to PostgreSQL (for backups) and the Docker socket (for container management). It does not depend on Redis, the Orchestrator, or any other Nova service — this ensures it remains operational even during a complete system failure.

  • Database backup — create, list, restore, and delete PostgreSQL backups
  • Factory reset — selective or complete data reset by category
  • Service management — list container status, restart individual services or all services
  • Environment management — read and update .env file variables (whitelist enforced, secrets masked)
  • Compose profile management — start/stop optional Docker Compose profiles (Cloudflare Tunnel, Tailscale)
  • System status — rich overview combining service health, database stats, and backup info
MethodPathDescription
GET/api/v1/recovery/statusRich status overview: services, DB stats, backup info
MethodPathAuthDescription
GET/api/v1/recovery/servicesList all Nova containers and their status
POST/api/v1/recovery/services/{name}/restartAdminRestart a specific service
POST/api/v1/recovery/services/restart-allAdminRestart all services
MethodPathAuthDescription
GET/api/v1/recovery/backupsList available backups
POST/api/v1/recovery/backupsAdminCreate a new backup
POST/api/v1/recovery/backups/{filename}/restoreAdminRestore from a backup
DELETE/api/v1/recovery/backups/{filename}AdminDelete a backup
MethodPathDescription
GET/api/v1/recovery/factory-reset/categoriesList data categories available for reset
MethodPathAuthDescription
GET/api/v1/recovery/envAdminRead whitelisted env vars (secrets masked)
PATCH/api/v1/recovery/envAdminUpdate .env keys (whitelist enforced)
MethodPathAuthDescription
POST/api/v1/recovery/compose-profilesAdminStart/stop a compose profile (e.g., cloudflare-tunnel, tailscale)
MethodPathDescription
GET/health/liveLiveness probe
GET/health/readyReadiness probe (checks DB connectivity)
VariableDescriptionDefault
DATABASE_URLPostgreSQL connection string
ADMIN_SECRETAdmin authentication secret
BACKUP_DIRDirectory for storing backups/backups
PORTService port8888

Backups are full PostgreSQL dumps stored in the configured backup directory (mounted as a Docker volume at /backups, mapped to ./backups/ on the host).

Create a backup via the API:

Terminal window
curl -X POST http://localhost:8888/api/v1/recovery/backups \
-H "X-Admin-Secret: your-admin-secret"

Or via the command line:

Terminal window
make backup # Create a backup
make restore # List available backups
make restore F=<file> # Restore a specific backup

The Recovery page in the Dashboard provides a visual interface for the same operations.

  • Docker SDK — uses the Docker SDK for Python to interact with containers via the Docker socket, enabling container inspection, restart, and status checks
  • Whitelist enforcement — environment variable reads and writes are restricted to a whitelist of known Nova configuration keys; arbitrary env vars cannot be accessed
  • Secret masking — when reading env vars, sensitive values (API keys, secrets) are masked in the response
  • Auth — all mutating endpoints require the X-Admin-Secret header; read-only endpoints (service list, backup list) are open
  • Compose profiles — the service manages Docker Compose profiles for optional services like Cloudflare Tunnel and Tailscale, enabling the Remote Access page in the Dashboard to start/stop these services