Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ethanc/salvage
Backup Docker Compose files to GitHub and notify about changes.
https://github.com/ethanc/salvage
backup bot compose container discord docker docker-compose github monitor notifications notifier notify python script stacks watcher webhook yaml yml
Last synced: about 1 month ago
JSON representation
Backup Docker Compose files to GitHub and notify about changes.
- Host: GitHub
- URL: https://github.com/ethanc/salvage
- Owner: EthanC
- License: mit
- Created: 2023-06-11T06:04:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-25T04:27:26.000Z (3 months ago)
- Last Synced: 2024-10-13T22:41:43.631Z (about 1 month ago)
- Topics: backup, bot, compose, container, discord, docker, docker-compose, github, monitor, notifications, notifier, notify, python, script, stacks, watcher, webhook, yaml, yml
- Language: Python
- Homepage: https://hub.docker.com/r/ethanchrisp/salvage
- Size: 94.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Salvage
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/EthanC/Salvage/ci.yaml?branch=main) ![Docker Pulls](https://img.shields.io/docker/pulls/ethanchrisp/salvage?label=Docker%20Pulls) ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/ethanchrisp/salvage/latest?label=Docker%20Image%20Size)
Salvage backs up Docker Compose files to GitHub and notifies about changes.
## Setup
Although not required, a [Discord Webhook](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) is recommended for notifications.
Regardless of your chosen setup method, Salvage is intended for use with a task scheduler, such as [cron](https://crontab.guru/).
**Environment Variables:**
- `LOG_LEVEL`: [Loguru](https://loguru.readthedocs.io/en/stable/api/logger.html) severity level to write to the console.
- `LOG_DISCORD_WEBHOOK_URL`: [Discord Webhook](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) URL to receive log events.
- `LOG_DISCORD_WEBHOOK_LEVEL`: Minimum [Loguru](https://loguru.readthedocs.io/en/stable/api/logger.html) severity level to forward to Discord.
- `GITHUB_ACCESS_TOKEN` (Required): [Personal Access Token (Classic)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#personal-access-tokens-classic) for GitHub.
- `GITHUB_REPOSITORY` (Required): Name of the private GitHub repository to store backups.
- `DISCORD_WEBHOOK_URL`: [Discord Webhook](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) URL to receive Portainer Stack notifications.### Docker (Recommended)
Modify the following `compose.yaml` example file, then run `docker compose up`.
```yaml
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](https://www.python.org/) or greater.
1. Install required dependencies using [uv](https://github.com/astral-sh/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`