Collection of operational skills for VaultMesh infrastructure including: - backup-sovereign: Backup and recovery operations - btc-anchor: Bitcoin anchoring - cloudflare-tunnel-manager: Cloudflare tunnel management - container-registry: Container registry operations - disaster-recovery: Disaster recovery procedures - dns-sovereign: DNS management - eth-anchor: Ethereum anchoring - gitea-bootstrap: Gitea setup and configuration - hetzner-bootstrap: Hetzner server provisioning - merkle-forest: Merkle tree operations - node-hardening: Node security hardening - operator-bootstrap: Operator initialization - proof-verifier: Cryptographic proof verification - rfc3161-anchor: RFC3161 timestamping - secrets-vault: Secrets management 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
83 lines
2.1 KiB
Bash
Executable File
83 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# === METADATA ===
|
|
SCRIPT_NAME="$(basename "$0")"
|
|
|
|
# === CONFIGURATION ===
|
|
: "${GITOPS_ROOT:=$HOME/infrastructure}"
|
|
|
|
# === FUNCTIONS ===
|
|
log_info() { echo "[INFO] $(date -Iseconds) $*"; }
|
|
log_warn() { echo "[WARN] $(date -Iseconds) $*" >&2; }
|
|
|
|
main() {
|
|
log_info "Starting $SCRIPT_NAME - ROLLBACK GitOps..."
|
|
|
|
# Expand ~
|
|
GITOPS_ROOT="${GITOPS_ROOT/#\~/$HOME}"
|
|
|
|
echo ""
|
|
echo "============================================"
|
|
echo " GITOPS ROLLBACK"
|
|
echo " Root: $GITOPS_ROOT"
|
|
echo "============================================"
|
|
echo ""
|
|
|
|
# Check what exists
|
|
local repos_found=0
|
|
for repo in config secrets manifests; do
|
|
if [[ -d "$GITOPS_ROOT/${repo}.git" ]]; then
|
|
echo " Found: ${repo}.git"
|
|
((repos_found++))
|
|
fi
|
|
done
|
|
|
|
if [[ $repos_found -eq 0 ]]; then
|
|
log_info "No GitOps repositories found - nothing to rollback"
|
|
exit 0
|
|
fi
|
|
|
|
echo ""
|
|
echo "This will ARCHIVE (not delete) the repositories to:"
|
|
echo " $GITOPS_ROOT/archived-$(date +%Y%m%d%H%M%S)/"
|
|
echo ""
|
|
|
|
read -p "Type 'CONFIRM' to proceed: " confirm
|
|
|
|
if [[ "$confirm" != "CONFIRM" ]]; then
|
|
log_info "Aborted - no changes made"
|
|
exit 0
|
|
fi
|
|
|
|
# Create archive directory
|
|
local archive_dir="$GITOPS_ROOT/archived-$(date +%Y%m%d%H%M%S)"
|
|
mkdir -p "$archive_dir"
|
|
|
|
# Move repositories to archive
|
|
for repo in config secrets manifests; do
|
|
if [[ -d "$GITOPS_ROOT/${repo}.git" ]]; then
|
|
mv "$GITOPS_ROOT/${repo}.git" "$archive_dir/"
|
|
log_info "Archived: ${repo}.git -> $archive_dir/"
|
|
fi
|
|
done
|
|
|
|
echo ""
|
|
echo "============================================"
|
|
echo " GITOPS ROLLBACK COMPLETE"
|
|
echo "============================================"
|
|
echo ""
|
|
echo "Repositories archived to: $archive_dir"
|
|
echo ""
|
|
echo "To permanently delete:"
|
|
echo " rm -rf $archive_dir"
|
|
echo ""
|
|
echo "To restore:"
|
|
echo " mv $archive_dir/*.git $GITOPS_ROOT/"
|
|
echo ""
|
|
|
|
log_info "Completed $SCRIPT_NAME"
|
|
}
|
|
|
|
[[ "${BASH_SOURCE[0]}" == "$0" ]] && main "$@"
|