Compare commits
15 Commits
6f72c80511
...
v0.1.2
| Author | SHA1 | Date | |
|---|---|---|---|
| c1a7ffd9e8 | |||
| b528097b00 | |||
| 035811115e | |||
| f1ddee1b6e | |||
| 1b0631d4e8 | |||
| 6192b18a49 | |||
| fd222fc92a | |||
| bbc5245793 | |||
| cacd0086c1 | |||
| d13c54c8df | |||
| 874adb4e2e | |||
| f5d9f0e458 | |||
| 3a838a92f9 | |||
| 1d8c32eac3 | |||
| dd9d6feb57 |
@@ -4,8 +4,8 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
pull_request:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -24,12 +24,23 @@ jobs:
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: gitea.calahilstudios.com/${{ github.repository_owner }}/${{ 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 image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
gitea.calahilstudios.com/${{ github.repository_owner }}/${{ github.event.repository.name }}:develop
|
||||
gitea.calahilstudios.com/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
|
||||
[](https://www.gnu.org/licenses/agpl-3.0)
|
||||
[](https://www.docker.com/)
|
||||
[](https://gitea.calahilstudios.com/owner/backupbot)
|
||||
[](https://gitea.calahilstudios.com)
|
||||

|
||||

|
||||
|
||||
[](https://hub.docker.com/r/linuxserver/duplicati)
|
||||
[](https://hub.docker.com/r/linuxserver/duplicati)
|
||||
|
||||
> **Automated Docker backup system for PostgreSQL databases and application configurations with Duplicati integration**
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
TZ=America/Los_Angeles
|
||||
BACKUP_DIR=/backups/postgres
|
||||
LOG_FILE=/config/log/pgbackup.log
|
||||
MAX_RETRIES=3
|
||||
GOTIFY_URL=http://gotify.example.com
|
||||
GOTIFY_TOKEN=your_gotify_token_here
|
||||
BACKUP_HOUR=03
|
||||
BACKUP_MINUTE=00
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
import cgi
|
||||
import cgitb
|
||||
import os
|
||||
import json
|
||||
|
||||
cgitb.enable()
|
||||
print("Content-Type: application/json\n")
|
||||
|
||||
ENV_FILE = "/config/web/backupbot.env"
|
||||
|
||||
|
||||
def read_env():
|
||||
env = {}
|
||||
if os.path.exists(ENV_FILE):
|
||||
with open(ENV_FILE) as f:
|
||||
for line in f:
|
||||
line = line.strip()
|
||||
if not line or line.startswith("#") or "=" not in line:
|
||||
continue
|
||||
key, val = line.split("=", 1)
|
||||
key = key.strip()
|
||||
val = val.strip().split("#")[0].strip() # strip inline comments
|
||||
env[key] = val
|
||||
return env
|
||||
|
||||
|
||||
def write_env(env):
|
||||
with open(ENV_FILE, "w") as f:
|
||||
for key, val in env.items():
|
||||
f.write(f"{key}={val}\n")
|
||||
|
||||
|
||||
form = cgi.FieldStorage()
|
||||
action = form.getvalue("action")
|
||||
|
||||
if action == "get":
|
||||
env = read_env()
|
||||
print(json.dumps(env))
|
||||
elif action == "set":
|
||||
try:
|
||||
raw = os.environ.get("CONTENT_LENGTH")
|
||||
length = int(raw) if raw else 0
|
||||
data = json.loads(os.read(0, length))
|
||||
write_env(data)
|
||||
print(json.dumps({"status": "ok", "message": "Configuration saved."}))
|
||||
except Exception as e:
|
||||
print(json.dumps({"status": "error", "message": str(e)}))
|
||||
else:
|
||||
print(json.dumps({"status": "error", "message": "Invalid action"}))
|
||||
Reference in New Issue
Block a user