https://github.com/0xerr0r/gh-backup-docker
GitHub backup as a docker job
https://github.com/0xerr0r/gh-backup-docker
backup docker github
Last synced: 2 months ago
JSON representation
GitHub backup as a docker job
- Host: GitHub
- URL: https://github.com/0xerr0r/gh-backup-docker
- Owner: 0xERR0R
- Created: 2020-10-04T19:59:14.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-11-16T21:08:02.000Z (over 4 years ago)
- Last Synced: 2025-02-13T08:23:47.207Z (over 1 year ago)
- Topics: backup, docker, github
- Language: Shell
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# GitHub backup
Creates backup of all relevant GitHub user data.
## Configuration
Please set following environment variables:
**GH_USER** GitHub username
**GH_ACCESS_TOKEN** Access Token (Settings -> Developer settings -> Personal Access Token. Should have repo and workflow priveleges)
**DEFAULT_BACKUP_ENTITIES** Optional parameter, which entities should be backed up. See https://github.com/josegonzalez/python-github-backup
Default if not set: `--starred --watched --followers --following --issues --labels --milestones --repositories --wikis --gists --starred-gists --private --releases`
Backup zip will be stored in `/out`. Should be mapped as volume (e.g. samba/nfs mount)
## Complete example with docker-compose
create backup.env with following content:
```bash
GH_USER=xxx
GH_ACCESS_TOKEN=xxx
```
Following `docker-compose.yml` starts backup (once). You should trigger the execution per cron `docker-compose run backup` or by using of external tools like [crony](https://github.com/0xERR0R/crony). You can also use this image as a Kubernetes CronJob. Following `docker-compose.yml` will store backup on a samba mounted directory (NAS).
```yaml
version: '2.2'
services:
backup:
image: spx01/gh-backup
env_file:
- backup.env
container_name: gh-backup
init: true
volumes:
- backup:/out
volumes:
bitwarden:
backup:
driver: local
driver_opts:
type: cifs
o: username=xx,password=xx,rw
device: //IP_NAS/path/to/folder
```
Credits: Thanks to `josegonzalez` for the github-backup: https://github.com/josegonzalez/python-github-backup