wardrobegod/depot/archive.sh
type-two 03772cff9b Depot backup to Drive, and publish the first asset through the hub
PUBLISHED. wg-harvest-demo.glb (a dressed character: character_kit body + a garment harvested off
a Ready Player Me donor) went to the live depot through wardrobegod's own export hub. 773 -> 774
assets, and fetching it back over the PUBLIC Cloudflare front — exactly what thriftgod does at
runtime — returns 200, the exact byte count, and valid glTF magic. The whole publish path is
proven end to end, not just the upload half.

BACKUP. depot/archive.sh, deployed to ultra:~/depot-backups/ (outside ~/Documents because of the
launchd TCC trap, absolute homebrew paths), following the existing MeshGod flow: ultra rsyncs the
VPS asset dir, rclone pushes to gdrive:DB-BACKUP/3god-depot alongside the sibling archives.

Not Gitea: git has no delta compression for binary blobs, so 774 GLBs would grow that repo
without bound on every re-upload, and Gitea sits on the disk-tight old box. Wrong tool for 7.5 GB
of meshes that only ever get added to.

One deliberate divergence from the MeshGod script it is modelled on: NO PRUNING. MeshGod deletes
VPS .glb older than 180 days because its gallery keeps thumb+index so stale entries still list.
This depot is live runtime infrastructure — two shipping games resolve assets from it BY FILENAME
at runtime, so pruning an old mesh is a 404 in a released game. Archive only.

Also inherits the fleet-wide risk already logged in the backup-verify skill: gdrive: uses
rclone's shared Google client_id, retired by Google during 2026, and every Drive flow dies with it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 22:35:26 +10:00

33 lines
1.7 KiB
Bash

#!/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