OPERATIONS
guide
9 min read

Encrypted Backup, Restore & Safe Recovery Mode

OpenDash CMS includes built-in encrypted site backups (.odbackup.age), isolated restore staging, media reconciliation, and a fail-safe Safe Recovery Mode so operators can back up and migrate single-binary sites without external scripts or overwriting live roots in place.

Archive Encryption, Payload Kinds & Hard Bounds

Backups encrypt a deterministic ZIP stream inside an Age scrypt envelope (BACKUP_SCRYPT_WORK_FACTOR = 16) paired with a canonical BackupManifestV1. Passphrases require 16..=128 Unicode scalars (at most 512 UTF-8 bytes) and confirmation via confirm_passphrase.

Each archive bundles all 10 BackupFileKind classes: db (consistent SQLite snapshot), media_original, media_thumbnail, theme_package_file, plugin_package_file, smtp_secret, extension_secret, quarantine_object, portable_config (config/site.json), and language_pack.

Limit ConstantMaximumPurpose
MAX_BACKUP_ARTIFACTS10 archivesLocal retention cap on disk
MAX_BACKUP_DECRYPTED_ZIP_BYTES4 GiBProtects against ZIP bombs
MAX_BACKUP_DB_BYTES1 GiBSQLite database ceiling
MAX_BACKUP_SINGLE_FILE_BYTES512 MiBPer-entry media/asset ceiling
MAX_BACKUP_PAYLOADS20,000 entriesFile count limit in archive
MAX_BACKUP_MANIFEST_BYTES8 MiBCanonical manifest ceiling
MAX_SCHEMA_OBJECTS1024 objectsCompiled SQLite schema budget on restore

Admin-Only Auth & Maintenance Write Barrier

Starting a backup acquires a maintenance barrier via SiteCoordinator::begin_maintenance(OperationKind::Backup), draining active write leases cleanly so the SQLite snapshot and on-disk media/extensions match atomically. Requests accept a 64-hex request_id for per-actor/UTC-day idempotency and support background cancellation via POST /api/admin/operations/jobs/{id}/cancel.

Operations HTTP Endpoints

operations-routes.txt http
GET  /api/admin/operations/diagnostics
POST /api/admin/operations/reconcile/plan
POST /api/admin/operations/reconcile/apply
POST /api/admin/operations/quarantine/purge
GET|POST /api/admin/operations/backups
DELETE   /api/admin/operations/backups/{id}
GET      /api/admin/operations/backups/{id}/file
GET      /api/admin/operations/jobs/{id}
POST     /api/admin/operations/jobs/{id}/cancel
POST     /api/admin/operations/restore-uploads
POST     /api/admin/operations/restores
GET      /api/admin/operations/recovery/status
POST     /api/admin/operations/recovery/activate

Isolated Restore & Safe Recovery Mode Activation

OpenDash never overwrites a live running site root in place. Restores verify checksums and unpack into a clean isolated target under backups/restored/<job_id>/, writing a READY.json marker (RestoreReadyMarker) and setting recovery_safe_mode: true.

  1. Point your systemd unit or OPENDASH_SITE_ROOT at the validated target directory and boot opendash (check startup state via GET /api/admin/operations/recovery/status).
  2. Notice recovery_safe_mode: true keeps background automation locked down while Admins inspect restored pages, SMTP state, and media.
  3. Submit POST /api/admin/operations/recovery/activate with expected_generation (matching READY.json job_id) and the current Admin password. OpenDash atomically writes recovery_safe_mode: false to config/site.json and clears recovery mode.
Edit Source URL:

Search OpenDash

Use Arrow keys & Enter to navigate Full search page →