Salvage backs up Docker Compose files to GitHub and notifies about changes.
Although not required, a Discord Webhook is recommended for notifications.
Regardless of your chosen setup method, Salvage is intended for use with a task scheduler, such as cron.
Environment Variables:
LOG_LEVEL
: Loguru severity level to write to the console.LOG_DISCORD_WEBHOOK_URL
: Discord Webhook URL to receive log events.LOG_DISCORD_WEBHOOK_LEVEL
: Minimum Loguru severity level to forward to Discord.GITHUB_ACCESS_TOKEN
(Required): Personal Access Token (Classic) for GitHub.GITHUB_REPOSITORY
(Required): Name of the private GitHub repository to store backups.DISCORD_WEBHOOK_URL
: Discord Webhook URL to receive change notifications.GLOB_PATTERNS
: Comma-separated pathname pattern(s) to match in local file discovery. Default is**/compose.yaml
.
Modify the following compose.yaml
example file, then run docker compose up
.
services:
salvage:
container_name: salvage
image: ethanchrisp/salvage:latest
environment:
LOG_LEVEL: INFO
LOG_DISCORD_WEBHOOK_URL: https://discord.com/api/webhooks/YYYYYYYY/YYYYYYYY
LOG_DISCORD_WEBHOOK_LEVEL: WARNING
GITHUB_ACCESS_TOKEN: XXXXXXXX
GITHUB_REPOSITORY: XXXXXXXX
DISCORD_WEBHOOK_URL: https://discord.com/api/webhooks/XXXXXXXX/XXXXXXXX
GLOB_PATTERNS: **/compose.yaml,**/config.json
volumes:
- /home/username/stacks:/salvage/stacks:ro
Salvage is built for Python 3.13 or greater.
- Install required dependencies using uv:
uv sync
- Rename
.env.example
to.env
, then provide the environment variables. - Ensure the /stacks directory contains Docker Compose files.
- Start Salvage:
python salvage.py