Skip to content

EthanC/Salvage

Repository files navigation

Salvage

GitHub Workflow Status Docker Pulls Docker Image Size (tag)

Salvage backs up Docker Compose files to GitHub and notifies about changes.

Setup

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 Portainer Stack notifications.

Docker (Recommended)

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
    volumes:
      - /home/username/stacks:/salvage/stacks:ro

Standalone

Salvage is built for Python 3.12 or greater.

  1. Install required dependencies using uv: uv sync
  2. Rename .env.example to .env, then provide the environment variables.
  3. Ensure the /stacks directory contains Docker Compose files.
  4. Start Salvage: python salvage.py