Initial commit: VaultMesh Skills collection
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>
This commit is contained in:
38
disaster-recovery/scripts/21_restore_apply.sh
Normal file
38
disaster-recovery/scripts/21_restore_apply.sh
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
SKILL_ROOT="$(dirname "$SCRIPT_DIR")"
|
||||
source "$SCRIPT_DIR/_common.sh"
|
||||
|
||||
: "${BACKUP_SKILL_DIR:=}"
|
||||
: "${RUN_DIR:=}"
|
||||
: "${DR_TARGET_BASE:=$HOME/recovery-drills}"
|
||||
: "${AGE_IDENTITY_FILE:=}"
|
||||
|
||||
main() {
|
||||
confirm_gate
|
||||
[[ -n "$BACKUP_SKILL_DIR" ]] || die "BACKUP_SKILL_DIR is required."
|
||||
[[ -n "$AGE_IDENTITY_FILE" ]] || die "AGE_IDENTITY_FILE is required."
|
||||
|
||||
local run_dir; run_dir="$(resolve_run_dir "$BACKUP_SKILL_DIR" "$RUN_DIR")"
|
||||
local enc="$run_dir/archive.tar.gz.age"
|
||||
[[ -f "$enc" ]] || die "Missing: $enc"
|
||||
|
||||
local ts; ts="$(date -Iseconds | tr ':' '-')"
|
||||
local target="$DR_TARGET_BASE/restore_$ts"
|
||||
mkdir -p "$target"
|
||||
|
||||
local decrypted="$target/archive.tar.gz"
|
||||
log_info "Decrypting -> $decrypted"
|
||||
age -d -i "$AGE_IDENTITY_FILE" -o "$decrypted" "$enc"
|
||||
|
||||
mkdir -p "$target/extract"
|
||||
log_info "Extracting -> $target/extract"
|
||||
tar -xzf "$decrypted" -C "$target/extract"
|
||||
|
||||
echo "$target" > "$SKILL_ROOT/outputs/last_drill_target.txt"
|
||||
log_info "Saved drill target pointer: $SKILL_ROOT/outputs/last_drill_target.txt"
|
||||
log_info "Next: ./scripts/30_verify_restored.sh"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user