Backups & recovery
Back up MongoDB and uploads together so database media paths match the files. Redis should also be retained when scheduled/pending jobs matter.
What a backup archive contains
Section titled “What a backup archive contains”The application’s own backup feature (Settings → Backups) writes one unencrypted .tar.gz per run: manifest.json, every MongoDB collection as newline-delimited Extended JSON, and the gallery/ files.
Treat that archive as a bearer bundle and protect it accordingly. It contains credential ciphertext (the WhatsApp session, backup/webhook credentials, and the Telegram bot token are AES-256-GCM ciphertext — unreadable without the encryption secret, but decryptable by anyone who also holds that secret), AdminUser Argon2id password hashes, ApiKey SHA-256 hashes, and the audit log. Anyone holding the archive and the server’s secrets holds the accounts. Store archives encrypted at rest, behind access control that only the operator has, and never in a shared bucket or a public location. Backup archives are not encrypted by the application itself; archive-level encryption (for example an opt-in passphrase) is a follow-up, not part of this release.
Restoring an archive also restores the ciphertext as-is, so a restored install still needs the same encryption secret to use its stored credentials.
Destinations
Section titled “Destinations”Backups go to Google Drive, S3, and S3-compatible storage (including Cloudflare R2 and MinIO). There is no local-filesystem backup destination. Destinations, credentials, and schedules are configured from the Backups page and stored (encrypted) in MongoDB.
S3-compatible destinations and private endpoints
Section titled “S3-compatible destinations and private endpoints”The endpoint credential is optional: without it the client uses https://s3.<region>.amazonaws.com. An endpoint with no scheme defaults to https:; only http: and https: are accepted, and redirects are never followed.
An endpoint that is — or resolves to — a private or loopback address is refused by default. A self-hosted MinIO on http://localhost:9000, 10.x, or 192.168.x is nevertheless a legitimate deployment, so the refusal is per destination, not global: set the destination credential allowPrivateEndpoint to "true" to opt that one destination in. Never set it on a destination whose endpoint you do not control.
MongoDB, state, and Redis
Section titled “MongoDB, state, and Redis”# MongoDBdocker compose exec -T mongodb \ mongodump --archive --gzip --db leviro-relay > leviro-relay.mongodb.gz
# Application state (one volume: uploads, gallery, data, logs)docker run --rm \ --volume leviro-relay_state:/source:ro \ --volume "$PWD":/backup \ alpine tar -czf /backup/leviro-relay.state.tgz -C /source .
# Redis — persist, then archive the volume while the stack is stoppeddocker compose exec redis redis-cli BGSAVEdocker compose stop api worker redisdocker compose start redis api workerTest restores in a separate environment. Restoring over a live production database is destructive — do it only during a maintenance window. Never treat docker compose down -v as routine cleanup; it deletes all named volumes.
If the application starts but cannot send
Section titled “If the application starts but cannot send”- Confirm MongoDB and Redis report healthy.
- Confirm the worker is running and not restarting.
- Open Session and inspect the connection state.
- Review worker logs for authentication, media, or retry errors.
- Confirm the
statevolume is mounted at/app/statein both the API and the worker. A worker that cannot see the API’suploads/fails every media job with a missing file. - If WhatsApp explicitly logged the device out, pair again. Do not delete valid credentials merely to troubleshoot a temporary network outage.