mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-08 11:16:47 +00:00
The only backups of the panel were the ones taken by hand before an update. Now `manage.py backup` writes a new directory under backups/ with a consistent copy of the sqlite database (the backup API, while the panel runs, checked with PRAGMA integrity_check), the secret key, the worker's node_id, settings.py, the SSH keys of the panel's user and, outside Docker, the commit. It keeps the newest 7 (--keep N) and deletes older ones only after a good backup; a failed one leaves nothing, and a second run while one runs fails. Files are mode 600, directories 700: the database holds compute passwords and keys. With PostgreSQL the database is left out. It runs daily at 03:15: in Docker from the image's cron into a new volume, webvirtcloud-backups; otherwise from webvirt-backup.timer, which the installer and the manual steps install. A backup has the layout of the update backups, so the restore steps take either.
43 lines
1.6 KiB
YAML
43 lines
1.6 KiB
YAML
services:
|
|
webvirtcloud:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
image: webvirtcloud:latest
|
|
container_name: webvirtcloud
|
|
restart: unless-stopped
|
|
# above my_init's 80 s, which is above the worker's 60 s drain
|
|
stop_grace_period: 95s
|
|
ports:
|
|
- "80:80"
|
|
environment:
|
|
# Optional: custom Django secret key. If unset, automatically generated at first launch.
|
|
# - SECRET_KEY=your-custom-secret-key-here
|
|
# Optional: comma-separated trusted CSRF origins (e.g. http://wvc.example.com,https://wvc.example.com)
|
|
# - CSRF_TRUSTED_ORIGINS=http://localhost,http://127.0.0.1
|
|
# Optional: PostgreSQL instead of the bundled sqlite (also WEBVIRTCLOUD_DB_PORT/_NAME/_USER)
|
|
# - WEBVIRTCLOUD_DB_HOST=db.example.com
|
|
# - WEBVIRTCLOUD_DB_PASSWORD=change-me
|
|
# Optional: SMTP for e-mail OTP (also EMAIL_PORT, EMAIL_USE_TLS=0/1)
|
|
# - EMAIL_HOST=smtp.example.com
|
|
# - EMAIL_HOST_USER=webvirtcloud@example.com
|
|
# - EMAIL_HOST_PASSWORD=change-me
|
|
# Host names/IPs the panel is reached by (comma-separated; "*" accepts any).
|
|
# Without it only localhost works. Set it in docker-compose.override.yml.
|
|
- ALLOWED_HOSTS=localhost
|
|
- TZ=UTC
|
|
volumes:
|
|
# Persistent SQLite database and runtime data
|
|
- webvirtcloud-data:/srv/webvirtcloud/data
|
|
# Persistent SSH keys for compute node authentication
|
|
- webvirtcloud-ssh:/var/www/.ssh
|
|
# Daily backups of both (manage.py backup)
|
|
- webvirtcloud-backups:/srv/webvirtcloud/backups
|
|
|
|
volumes:
|
|
webvirtcloud-data:
|
|
driver: local
|
|
webvirtcloud-ssh:
|
|
driver: local
|
|
webvirtcloud-backups:
|
|
driver: local
|