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.5 KiB
Bash
45 lines
1.5 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:=}"
|
|
: "${ZONE_NAME:=}"
|
|
: "${HOSTNAME:=}"
|
|
: "${CONFIG_DIR:=$SKILL_ROOT/outputs/config}"
|
|
|
|
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 is required."
|
|
[[ -n "$ZONE_NAME" ]] || die "ZONE_NAME is required."
|
|
[[ -n "$HOSTNAME" ]] || die "HOSTNAME is required."
|
|
need jq
|
|
need curl
|
|
|
|
local z; z="$(api GET "https://api.cloudflare.com/client/v4/zones?name=$ZONE_NAME" | jq -r '.result[0].id')"
|
|
[[ -n "$z" && "$z" != "null" ]] || die "Unable to resolve zone id for $ZONE_NAME"
|
|
|
|
local rec; rec="$(api GET "https://api.cloudflare.com/client/v4/zones/$z/dns_records?type=CNAME&name=$HOSTNAME")"
|
|
local rec_id; rec_id="$(echo "$rec" | jq -r '.result[0].id')"
|
|
if [[ -n "$rec_id" && "$rec_id" != "null" ]]; then
|
|
log_warn "Deleting DNS record id: $rec_id ($HOSTNAME)"
|
|
api DELETE "https://api.cloudflare.com/client/v4/zones/$z/dns_records/$rec_id" | jq -e '.success==true' >/dev/null || die "Failed to delete DNS record."
|
|
else
|
|
log_warn "No DNS record found for $HOSTNAME"
|
|
fi
|
|
|
|
rm -f "$CONFIG_DIR/dns_route.json" || true
|
|
log_info "DNS rollback complete."
|
|
}
|
|
main "$@"
|