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:
49
gitea-bootstrap/scripts/00_preflight.sh
Normal file
49
gitea-bootstrap/scripts/00_preflight.sh
Normal file
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
SKILL_ROOT="$(dirname "$SCRIPT_DIR")"
|
||||
source "$SCRIPT_DIR/_common.sh"
|
||||
|
||||
: "${MODE:=docker}"
|
||||
: "${ADMIN_USER:=}"
|
||||
: "${ADMIN_EMAIL:=}"
|
||||
: "${DATA_DIR:=$HOME/gitea}"
|
||||
: "${HTTP_PORT:=3000}"
|
||||
: "${SSH_PORT:=2222}"
|
||||
|
||||
main() {
|
||||
log_info "Starting 00_preflight.sh"
|
||||
[[ -n "$ADMIN_USER" ]] || die "ADMIN_USER is required."
|
||||
[[ -n "$ADMIN_EMAIL" ]] || die "ADMIN_EMAIL is required."
|
||||
|
||||
need curl
|
||||
need jq
|
||||
|
||||
if [[ "$MODE" == "docker" ]]; then
|
||||
need docker
|
||||
need docker-compose || log_warn "docker-compose not found; will use 'docker compose' if available."
|
||||
docker version >/dev/null 2>&1 || die "Docker not working."
|
||||
elif [[ "$MODE" == "native" ]]; then
|
||||
need sudo
|
||||
need systemctl
|
||||
else
|
||||
die "MODE must be 'docker' or 'native' (got: $MODE)"
|
||||
fi
|
||||
|
||||
mkdir -p "$SKILL_ROOT/outputs"
|
||||
mkdir -p "$SKILL_ROOT/outputs/backups"
|
||||
mkdir -p "$DATA_DIR"
|
||||
|
||||
# lightweight port sanity
|
||||
if command -v ss >/dev/null 2>&1; then
|
||||
if ss -ltn | awk '{print $4}' | grep -q ":$HTTP_PORT$"; then
|
||||
log_warn "HTTP_PORT $HTTP_PORT already in use."
|
||||
fi
|
||||
if ss -ltn | awk '{print $4}' | grep -q ":$SSH_PORT$"; then
|
||||
log_warn "SSH_PORT $SSH_PORT already in use."
|
||||
fi
|
||||
fi
|
||||
|
||||
log_info "Preflight OK."
|
||||
}
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user