Questi contenuti non sono ancora disponibili nella tua lingua.
Backups and Recovery
ALTCHA Sentinel is distributed as a Docker image that requires a persistent storage volume for database data. You have two options for backing up this volume:
- Standard volume backup tools – Take a snapshot of the entire persistent volume.
- Built-in database backup – Upload database snapshots to AWS S3 or Azure Blob Storage.
Standard Volume Backup Tools
The backup process depends on your deployment runtime. Follow official Docker documentation or use third-party solutions to back up your volumes.
Recommended solution:
Azure App Services
When hosting on Azure App Services, the persistent volume is mounted using Azure Storage. For data protection, configure your storage with appropriate redundancy.
About Redundancy:
- Protects against hardware failures, network/power outages, and regional disasters.
- Does not protect against accidental deletion or human error.
Recommendation:
Enable automated database snapshots (as described in the Built-in Database Snapshots section) for additional backup protection.
Built-in Database Snapshots
The built-in backup mechanism lets you schedule automatic snapshots and upload them to remote storage (AWS S3 or Azure Blob Storage).
Manual Backups via the Admin App
- Navigate to Admin → Snapshots.
- Click Create Snapshot.
- Select the database to back up:
- Main database – Contains primary data (users, API keys, etc.).
- Redis – Contains short-lived data (rate limiters, etc.).
- Click Create to generate and upload the snapshot.
Configuring Automated Snapshots
Set these environment variables to enable scheduled backups:
Variable | Description |
---|---|
SNAPHOSTS_CRON_SCHEDULE | Cron expression for backup frequency (e.g., 0 0 * * * for daily at midnight). |
SNAPHOSTS_STORAGE_PROVIDER | Supported: s3 , azure , or local . |
SNAPHOSTS_STORAGE_* | Provider-specific credentials (e.g., SNAPHOSTS_STORAGE_AZURE_CONNECTION_STRING ). |
SNAPHOSTS_DB_PREFIX | (Optional) Remote storage path prefix for snapshots (defaults to altcha-sentinel-backups/db/${iso_date()} ). |
SNAPSHOTS_ENCRYPTION_KEY | (Optional) Encryption key for snapshots. |
Refer to the Storage Providers documentation for more details.
Example (Azure Blob Storage):
SNAPHOSTS_CRON_SCHEDULE="0 0 * * *"SNAPHOSTS_STORAGE_PROVIDER=azureSNAPHOSTS_STORAGE_AZURE_CONTAINER=backupsSNAPHOSTS_STORAGE_AZURE_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=test;AccountKey=XXXX;EndpointSuffix=core.windows.net
Restoring a Snapshot
Via the Admin App:
- Go to Admin → Snapshots.
- Click Restore Snapshot.
- Enter the remote snapshot URI (e.g.,
/altcha-sentinel-backups/db/...
). - Click Restore – the server will reload after restoration.
Via API:
Use these endpoints for programmatic backup/restore:
- Create:
POST /v1/admin/snapshots/create
- Restore:
POST /v1/admin/snapshots/restore
For details, see the API Documentation.