Initial commit: Brass & Sigil monorepo

Self-hosted Minecraft modpack distribution + administration system.

- launcher/  Avalonia 12 desktop client; single-file win-x64 publish.
             Microsoft auth via XboxAuthNet, manifest+SHA-1 mod sync,
             portable install path, sidecar settings.
- server/    brass-sigil-server daemon (.NET 8, linux-x64). Wraps the
             MC subprocess, embedded Kestrel admin panel with cookie
             auth + rate limiting, RCON bridge, scheduled backups,
             BlueMap CLI integration with player markers + skin proxy,
             friend-side whitelist request flow, world wipe with seed
             selection (keep current / random / custom).
- pack/      pack.lock.json (Modrinth + manual CurseForge entries),
             data-only tweak source under tweaks/, build outputs in
             overrides/ (gitignored).
- scripts/   Build-Pack / Build-Tweaks / Update-Pack / Check-Updates
             plus Deploy-Brass.ps1 unified one-shot deploy with
             version-bump pre-flight and daemon-state detection.
This commit is contained in:
Matt Sijbers
2026-05-05 00:19:05 +01:00
commit a1331212cb
99 changed files with 12640 additions and 0 deletions
+105
View File
@@ -0,0 +1,105 @@
#!/usr/bin/env bash
# Sudo cleanup script -- review before running.
# Removes dormant game servers (ARK, Valheim, Terraria), trims journald logs,
# caps snap revision retention. Does NOT touch Bitbucket, TeamViewer, or the
# matt-wakeford.co.uk / sijbers.uk / diceheart.com websites.
#
# Run with: sudo bash /tmp/cleanup-sudo.sh
#
# Set -e: abort on first error so we don't cascade-damage state.
set -euo pipefail
echo "=== Pre-cleanup disk ==="
df -h / | grep -v Filesystem
# ────────────────────────────────────────────────
# 1. ARK server -- install, user, broken systemd unit
# ────────────────────────────────────────────────
echo
echo "=== ARK ==="
if systemctl list-unit-files ark.service &>/dev/null; then
echo " Disabling ark.service"
systemctl disable --now ark.service 2>/dev/null || true
fi
if [[ -f /lib/systemd/system/ark.service ]]; then
echo " Removing /lib/systemd/system/ark.service"
rm -f /lib/systemd/system/ark.service
fi
if [[ -f /etc/systemd/system/ark.service ]]; then
echo " Removing /etc/systemd/system/ark.service"
rm -f /etc/systemd/system/ark.service
fi
if id ark &>/dev/null; then
# Make sure no processes are running as ark before userdel.
pkill -u ark 2>/dev/null || true
sleep 1
echo " Removing 'ark' user + home"
userdel -r ark 2>/dev/null || userdel ark
fi
# ────────────────────────────────────────────────
# 2. Valheim (vhserver) -- LGSM stack
# ────────────────────────────────────────────────
echo
echo "=== Valheim (vhserver) ==="
if id vhserver &>/dev/null; then
pkill -u vhserver 2>/dev/null || true
sleep 1
echo " Removing 'vhserver' user + home (incl. orphaned LGSM backups)"
userdel -r vhserver 2>/dev/null || userdel vhserver
fi
# ────────────────────────────────────────────────
# 3. Terraria -- empty home, never used
# ────────────────────────────────────────────────
echo
echo "=== Terraria ==="
if id Terraria &>/dev/null; then
pkill -u Terraria 2>/dev/null || true
echo " Removing 'Terraria' user + home"
userdel -r Terraria 2>/dev/null || userdel Terraria
fi
# ────────────────────────────────────────────────
# 4. systemd reload to forget the gone units
# ────────────────────────────────────────────────
echo
echo "=== systemctl daemon-reload ==="
systemctl daemon-reload
systemctl reset-failed 2>/dev/null || true
# ────────────────────────────────────────────────
# 5. journald -- cap to 500 MB
# ────────────────────────────────────────────────
echo
echo "=== journald ==="
echo " Trimming /var/log/journal to 500 MB"
journalctl --vacuum-size=500M
# ────────────────────────────────────────────────
# 6. snap -- only keep current + 1 prior revision
# ────────────────────────────────────────────────
echo
echo "=== snap retention ==="
echo " Setting refresh.retain=2 (snap will auto-clean older revs over time)"
snap set system refresh.retain=2
# Force-clean orphaned _old.snap files older than 30 days. Snap will redo
# this organically but we can prod it now to reclaim immediately.
echo " Forcing snap to drop disabled revisions"
for snap in $(snap list --all | awk '/disabled/{print $1, $3}'); do
if [[ "$snap" == "disabled" ]]; then continue; fi
done
# Easier path: ask snap directly.
LANG=C snap list --all | awk '/disabled/{print $1, $3}' | \
while read -r name rev; do
echo " snap remove --revision=$rev $name"
snap remove --revision="$rev" "$name" || true
done
# ────────────────────────────────────────────────
echo
echo "=== Post-cleanup disk ==="
df -h / | grep -v Filesystem
echo
echo "Done. Bitbucket, TeamViewer, and websites untouched."