diff --git a/depot/README.md b/depot/README.md index d5e84e7..6147307 100644 --- a/depot/README.md +++ b/depot/README.md @@ -57,3 +57,24 @@ any tags or notes**, so nothing needed migrating into wardrobegod's manifest. Ta `ssh://git@100.71.119.27:222/monster/3GOD.git` (Gitea on the old box) can be archived once this copy is committed. The running VPS service is unaffected — it is deployed, not sourced live from that checkout. ultra's `~/Documents/3GOD` is a dev copy holding 4 files and its `:8788` is closed. + +## Backup + +`archive.sh` (deployed to `ultra:~/depot-backups/archive.sh` — outside `~/Documents` because +launchd + TCC) follows the MeshGod flow: ultra rsyncs the VPS asset dir, then rclones to +**`gdrive:DB-BACKUP/3god-depot`**. 7.5 GB / 774 assets. + +**Not git.** Git has no delta compression for binary blobs, so 774 GLBs would grow the Gitea repo +without bound on every re-upload, and Gitea lives on the disk-tight old box. + +**Deliberate difference from the MeshGod flow: NO PRUNING.** MeshGod prunes VPS `.glb` older than +180 days because its gallery keeps thumb+index so stale entries still list. This depot is live +runtime infrastructure — thriftgod and procity fetch assets *by filename at runtime*, so deleting +an old GLB breaks a shipping game with a 404. Archive only, never prune. + +Verify freshness the same way as the other flows: +`rclone lsl gdrive:DB-BACKUP/3god-depot --include "*.glb" --max-age 36h` + +⚠️ Shares the whole-fleet risk noted in the backup-verify skill: the `gdrive:` remote uses +rclone's shared Google client_id, which Google retires during 2026. When it dies every Drive flow +breaks at once, this one included. diff --git a/depot/archive.sh b/depot/archive.sh new file mode 100644 index 0000000..3022063 --- /dev/null +++ b/depot/archive.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# 3GOD depot (now wardrobegod's depot/) → Google Drive. Mirrors ~/meshgod-backups/archive.sh: +# ultra pulls the VPS asset dir, pushes off-site to gdrive:DB-BACKUP. +# +# DELIBERATE DIFFERENCE FROM THE MESHGOD FLOW: **NO PRUNING.** meshgod prunes VPS .glb older than +# 180d because its gallery keeps thumb+index so old entries still list. This depot is LIVE RUNTIME +# INFRASTRUCTURE — thriftgod (web/index.html:1176) and procity (loaders.js:7) fetch assets from it +# by filename at runtime, so deleting an old .glb breaks a shipping game with a 404. Archive only. +# +# Lives outside ~/Documents on purpose (launchd + TCC), uses absolute homebrew paths. +set -u +LOCAL="$HOME/depot-backups"; REMOTE="gdrive"; DEST="DB-BACKUP/3god-depot" +VPS="root@100.94.195.115"; SRC="/opt/3god/assets" +LOG="$LOCAL/archive.log"; RCLONE=/opt/homebrew/bin/rclone +STAMP=$(date "+%Y-%m-%d %H:%M"); mkdir -p "$LOCAL/assets" + +if rsync -a --delete-excluded -e "ssh -o ConnectTimeout=15" "$VPS:$SRC/" "$LOCAL/assets/" 2>>"$LOG"; then + echo "$STAMP pulled depot from VPS ($(ls "$LOCAL/assets" | wc -l | tr -d ' ') files)" >> "$LOG" +else + echo "$STAMP WARN pull failed" >> "$LOG"; exit 1 +fi + +# meta.json carries the depot's tag/note sidecar — small but the only non-reconstructable bit. +if "$RCLONE" copy "$LOCAL/assets" "$REMOTE:$DEST" \ + --include "*.glb" --include "*.png" --include "*.jpg" --include "*.jpeg" --include "*.webp" \ + --include "meta.json" \ + --transfers 3 --checkers 4 --log-file "$LOG" --log-level INFO; then + N=$("$RCLONE" size "$REMOTE:$DEST" --json 2>/dev/null | /usr/bin/sed -n 's/.*"count":\([0-9]*\).*/\1/p') + echo "$STAMP pushed to $REMOTE:$DEST (remote now $N objects)" >> "$LOG" +else + echo "$STAMP WARN rclone push failed" >> "$LOG"; exit 1 +fi