Sentry plumbing, inert until a DSN exists

Server: errors-only @sentry/node behind SENTRY_DSN, capturing the
unhandled-protocol catch with its message type and room. Client:
errors-only @sentry/browser behind VITE_SENTRY_DSN baked at build.
Backup: Sentry Crons check-ins (in_progress/ok/error) when
/root/.wizwar-sentry-cron holds the check-in URL. No DSN, no behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015RCWSTnb1KYTPyL4GmhGnF
This commit is contained in:
Eric Wagoner
2026-09-01 09:58:26 -04:00
co-authored by Claude Fable 5
parent 68f171215d
commit b06da1f1f1
6 changed files with 368 additions and 6 deletions
+11 -2
View File
@@ -8,6 +8,10 @@ BUCKET="kestrel-wizwar-backups"
SRC="/var/lib/wizwar"
LOG="/var/log/wizwar/backup.log"
STAMP=$(date +%Y-%m-%d)
# Sentry Crons check-in: /root/.wizwar-sentry-cron holds the check-in URL
# (auto-creates the monitor on first ping). Absent file = no check-ins.
CRON_URL=$(cat /root/.wizwar-sentry-cron 2>/dev/null || true)
checkin() { [ -n "$CRON_URL" ] && curl -sf -o /dev/null "$CRON_URL?status=$1" || true; }
if grep -q CHANGE_ME /root/.config/rclone/rclone.conf; then
echo "$(date -Is) skipped: Spaces credentials not configured yet" >> "$LOG"
@@ -16,8 +20,13 @@ fi
{
echo "=== $(date -Is) backup start"
rclone sync "$SRC" "spaces:$BUCKET/wizwar/current" 2>&1
rclone copy "$SRC" "spaces:$BUCKET/wizwar/snapshots/$STAMP" 2>&1
checkin in_progress
if rclone sync "$SRC" "spaces:$BUCKET/wizwar/current" 2>&1 &&
rclone copy "$SRC" "spaces:$BUCKET/wizwar/snapshots/$STAMP" 2>&1; then
checkin ok
else
checkin error
fi
# Prune dated snapshots older than 90 days (by directory name).
CUTOFF=$(date -d "90 days ago" +%Y-%m-%d)
rclone lsf "spaces:$BUCKET/wizwar/snapshots/" --dirs-only 2>/dev/null | \