1 Commits

Author SHA1 Message Date
482cc46476 work on README.md
Some checks failed
Build and Push Docker Image / build (push) Failing after 10s
learning to use shields.io
2025-10-26 22:42:45 -07:00
3 changed files with 121 additions and 89 deletions

View File

@@ -0,0 +1,72 @@
name: Build and Push Docker Image
on:
push:
branches:
- main
tags:
- "v*"
jobs:
build:
runs-on: prodesk
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Gitea Docker Registry
uses: docker/login-action@v3
with:
registry: gitea.calahilstudios.com
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Gitea metadata
id: meta-gitea
uses: docker/metadata-action@v5
with:
images: gitea.calahilstudios.com/calahilstudios/${{ github.event.repository.name }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=sha
type=raw,value=latest,enable={{is_default_branch}}
- name: Docker Hub metadata
id: meta-dockerhub
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push to Gitea
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta-gitea.outputs.tags }}
labels: ${{ steps.meta-gitea.outputs.labels }}
- name: Build and push to Docker Hub
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta-dockerhub.outputs.tags }}
labels: ${{ steps.meta-dockerhub.outputs.labels }}

View File

@@ -1,77 +0,0 @@
name: Build and Push Docker Image
on:
push:
branches:
- main
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# 🧠 Login to Docker Hub
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ github.actor }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# 🧠 Login to GitHub Container Registry
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# 🧠 Login to Gitea
- name: Login to Gitea
uses: docker/login-action@v3
with:
registry: gitea.calahilstudios.com
username: ${{ github.actor }}
password: ${{ secrets.GITEA_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
gitea.calahilstudios.com/${{ github.repository }}
${{ github.repository }}
tags: |
# Always include short SHA
type=sha,format=short
# Include latest if on default branch (usually 'main' or 'develop')
type=raw,value=latest,enable={{is_default_branch}}
# If this is a semver tag (vX.X.X), add full + minor version tags
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Debug GitHub context
run: |
echo "Tags: ${{ steps.meta.outputs.tags }}"
echo "Labels: ${{ steps.meta.outputs.labels }}"
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@@ -3,8 +3,10 @@
![Docker Image Version (tag)](https://img.shields.io/docker/v/calahil/backupbot/latest?arch=amd64&style=for-the-badge&logo=docker&logoColor=white&labelColor=blue&color=green)
![Docker Pulls](https://img.shields.io/docker/pulls/calahil/backupbot?style=for-the-badge&logo=docker&logoColor=white&labelColor=blue&color=green)
![Docker Stars](https://img.shields.io/docker/stars/calahil/backupbot?style=for-the-badge&logo=docker&logoColor=white&labelColor=blue&color=green)
![GitHub License](https://img.shields.io/github/license/calahil/backupbot?style=for-the-badge&logo=docker&logoColor=white&labelColor=blue&color=green)
![GitHub License](https://img.shields.io/github/license/calahil/backupbot?style=social&logo=github&link=https%3A%2F%2Fraw.githubusercontent.com%2Fcalahil%2Fbackupbot%2Frefs%2Fheads%2Fmain%2FLICENSE)
![GitHub Release](https://img.shields.io/github/v/release/calahil/backupbot?display_name=release&style=for-the-badge&logo=github&labelColor=blue&color=green)
@@ -45,12 +47,19 @@ BackupBot is a comprehensive backup solution that automatically discovers and ba
cd backupbot
```
2. **Start the container:**
2. **Create environment file:**
```bash
cp .env.example .env
# Edit .env with your settings
nano .env
```
3. **Start the container:**
```bash
docker-compose up -d
```
3. **Access the interfaces:**
4. **Access the interfaces:**
- BackupBot Config: http://localhost:8201
- Duplicati Web UI: http://localhost:8200
@@ -60,6 +69,8 @@ BackupBot is a comprehensive backup solution that automatically discovers and ba
### Environment Variables
Create a `.env` file in the project root:
```env
# Duplicati encryption key (required)
KEY=your_encryption_key_here
@@ -110,16 +121,16 @@ Additional patterns can be added by modifying the `KNOWN_IMAGES` list in `backup
```yaml
volumes:
# Duplicati configuration
- /path/to/duplicati/config:/config
- /srv/appdata/duplicati/config:/config
# Backup storage (where dumps are stored)
- /path/to/backups:/backups:rshared
- /srv/backups:/backups:rshared
# Docker socket (for container discovery)
- /var/run/docker.sock:/var/run/docker.sock:ro
# Source data for snapshots (optional)
- /path/to/appdata:/source:ro
- /srv/appdata:/source/appdata:ro
```
---
@@ -147,12 +158,12 @@ docker logs -f backupbot
Backups are organized by container name:
```bash
ls -lh /backups/postgres_dumps/
ls -lh /srv/backups/postgres_dumps/
```
Example structure:
```
/backups/
/srv/backups/
├── postgres_dumps/
│ ├── myapp_db/
│ │ ├── 2024-10-23_03-00-00.sql
@@ -171,7 +182,7 @@ Example structure:
1. **Discovery Phase**: BackupBot scans running Docker containers and identifies PostgreSQL instances
2. **Extraction**: For each database, credentials are extracted from environment variables
3. **Backup**: `pg_dumpall` creates a complete SQL dump of all databases
4. **Snapshot**: A read-only btrfs snapshot is created of `/source`
4. **Snapshot**: A read-only btrfs snapshot is created of `/srv/appdata`
5. **Retention**: Old backups exceeding the retention period are automatically deleted
6. **Notification**: On failure after retries, Gotify notifications are sent (if configured)
@@ -193,6 +204,24 @@ Example structure:
---
## 🛠️ Development
### Building from Source
```bash
docker build -t backupbot:latest .
```
### CI/CD Pipeline
BackupBot uses Gitea Actions for automated builds:
- **Trigger**: Push to `main` or `develop` branches
- **Registry**: `gitea.calahilstudios.com`
- **Tags**: `develop` and commit SHA
---
## 📊 Monitoring
### Web Interfaces
@@ -224,7 +253,7 @@ Contributions are welcome! Please feel free to submit a Pull Request.
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request on Github
5. Open a Pull Request on Gitea
---
@@ -232,6 +261,12 @@ Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the GNU Affero General Public License v3.0 - see the [LICENSE](LICENSE) file for details.
**AGPL-3.0 Key Points:**
- ✅ Free to use, modify, and distribute
- ✅ Source code must be made available
- ✅ Network use is considered distribution
- ✅ Modifications must also be AGPL-3.0
---
## 🙏 Acknowledgments
@@ -244,7 +279,7 @@ This project is licensed under the GNU Affero General Public License v3.0 - see
## 📞 Support
- 🐛 **Issues**: [Report bugs on Github](https://github.com/calahil/backupbot/issues)
- 🐛 **Issues**: [Report bugs on Gitea](https://gitea.calahilstudios.com/owner/backupbot/issues)
- 📚 **Documentation**: This README and inline code comments
- 💬 **Discussions**: Open an issue for questions
@@ -262,4 +297,6 @@ This project is licensed under the GNU Affero General Public License v3.0 - see
---
**Made by Calahil Studios**
**Made with ❤️ by Calahil Studios**
[![Gitea](https://img.shields.io/badge/View%20on-Gitea-609926?style=for-the-badge&logo=gitea&logoColor=white)](https://gitea.calahilstudios.com)