BOC v1.0: RS256 auth, Ledger integration, Prometheus metrics, CI/CD, backup

This commit is contained in:
Bernt
2026-07-28 23:08:32 +00:00
parent 0b4f160af1
commit af874040ca
11541 changed files with 1654104 additions and 1103 deletions
Executable
+46
View File
@@ -0,0 +1,46 @@
#!/bin/bash
set -euo pipefail
# BOC Rollback Script
# Rullar tillbaka till föregående version vid fel
echo "🔄 BOC Rollback Starting..."
# 1. Stoppa tjänsten
echo "🛑 Stopping BOC..."
sudo systemctl stop boc
# 2. Återställ från backup (om finns)
BACKUP_DIR="/opt/backups/boc"
if [ -d "$BACKUP_DIR" ]; then
LATEST=$(ls -t "$BACKUP_DIR" | head -1)
if [ -n "$LATEST" ]; then
echo "📦 Restoring from backup: $LATEST"
# Återställ databas
# pg_restore ...
fi
fi
# 3. Starta om med föregående binär
PREV_BIN="/home/bernt/.openclaw/workspace/boc/backend/bin/boc.prev"
if [ -f "$PREV_BIN" ]; then
echo "🔧 Using previous binary..."
cp "$PREV_BIN" /home/bernt/.openclaw/workspace/boc/backend/bin/boc
fi
# 4. Starta tjänsten
echo "▶️ Starting BOC..."
sudo systemctl start boc
sleep 3
# 5. Verifiera
echo "✅ Verifying rollback..."
if curl -sf https://boc.aamos.systems/health > /dev/null; then
echo "🎉 Rollback successful!"
else
echo "❌ Rollback failed — manual intervention required"
exit 1
fi
echo ""
echo "🎉 Rollback complete!"