Sign inSign up

ethanchrisp/salvage

By ethanchrisp

Updated 10 months ago

Backup Docker Compose files to GitHub and notify about changes.

Image
0

10K+

ethanchrisp/salvage repository overview

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 change notifications.
  • GLOB_PATTERNS: Comma-separated pathname pattern(s) to match in local file discovery. Default is **/compose.yaml.
  • PROJECTS_DIRECTORY: Directory in which projects are stored. Default is ./projects.

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/projects:/salvage/projects:ro
Standalone

Salvage is built for Python 3.13 or greater.

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

Tag summary

Content type

Image

Digest

sha256:29e762c0e

Size

71.1 MB

Last updated

10 months ago

docker pull ethanchrisp/salvage