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>
45 lines
1.3 KiB
Bash
45 lines
1.3 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
SKILL_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")"
|
|
source "$SKILL_ROOT/scripts/_common.sh"
|
|
|
|
: "${CF_API_TOKEN:=}"
|
|
: "${CF_ZONE_NAME:=}"
|
|
|
|
api() {
|
|
local method="$1"; shift
|
|
local url="$1"; shift
|
|
curl -sS -X "$method" "$url" \
|
|
-H "Authorization: Bearer $CF_API_TOKEN" \
|
|
-H "Content-Type: application/json" \
|
|
"$@"
|
|
}
|
|
|
|
main() {
|
|
confirm_gate
|
|
[[ -n "$CF_API_TOKEN" ]] || die "CF_API_TOKEN required."
|
|
[[ -n "$CF_ZONE_NAME" ]] || die "CF_ZONE_NAME required."
|
|
need jq
|
|
need curl
|
|
|
|
local ids_file="$SKILL_ROOT/outputs/cloudflare_record_ids.txt"
|
|
if [[ ! -f "$ids_file" ]]; then
|
|
log_warn "No cloudflare_record_ids.txt found; nothing to undo."
|
|
exit 0
|
|
fi
|
|
|
|
local zid; zid="$(api GET "https://api.cloudflare.com/client/v4/zones?name=$CF_ZONE_NAME" | jq -r '.result[0].id')"
|
|
[[ -n "$zid" && "$zid" != "null" ]] || die "Unable to resolve zone id."
|
|
|
|
while IFS= read -r rid; do
|
|
[[ -n "$rid" ]] || continue
|
|
log_warn "Deleting Cloudflare DNS record id: $rid"
|
|
api DELETE "https://api.cloudflare.com/client/v4/zones/$zid/dns_records/$rid" | jq -e '.success==true' >/dev/null || log_warn "Failed delete for $rid"
|
|
done < "$ids_file"
|
|
|
|
rm -f "$ids_file" || true
|
|
log_info "Cloudflare rollback complete."
|
|
}
|
|
main "$@"
|