build a template website

This commit is contained in:
rainyy21
2026-10-05 19:40:24 -04:00
commit c86f93f4ca
36 changed files with 2581 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
FROM postgres:16-alpine
RUN apk add --no-cache rsync openssh-client
COPY backup/backup.sh backup/entrypoint.sh /backup/
ENTRYPOINT ["/backup/entrypoint.sh"]
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
set -eu
. /etc/backup.env
push() { [ -n "${KUMA_BACKUP_PUSH_URL:-}" ] && wget -qO- "$KUMA_BACKUP_PUSH_URL?status=$1&msg=$2" >/dev/null 2>&1 || true; }
run() {
f="/tmp/rainhub-$(date +%Y%m%d-%H%M%S).dump"
PGPASSWORD="$POSTGRES_PASSWORD" pg_dump -h db -U "$POSTGRES_USER" -Fc "$POSTGRES_DB" > "$f"
rsync -e "ssh -i /ssh/id_ed25519 -p ${BACKUP_PORT:-22} -o StrictHostKeyChecking=accept-new" "$f" "$BACKUP_TARGET/"
rm -f "$f"
}
if run; then push up OK; echo "backup ok"; else push down backup-failed; echo "backup FAILED"; exit 1; fi
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
printenv | sed "s/'/'\\\\''/g; s/^\([^=]*\)=\(.*\)$/export \1='\2'/" > /etc/backup.env
echo "0 3 * * * /backup/backup.sh >> /proc/1/fd/1 2>&1" | crontab -
exec crond -f -l 8