#!/usr/bin/env bash # scripts/region-service-gate.sh [ ...] # # Nearest-region spec §17 step 6: before CONSOLE_APP_REGIONS goes on, every # eligible region must serve a fresh probe instance through the REAL public # path — from outside through public DNS (skip with GATE_SKIP_PUBLIC=1), and # through every armed edge that is NOT the instance's box. Passes only on # 2xx with X-Carlos-Version equal to the deployed build. Proxies are # disabled and ~/.curlrc ignored, and each explicit-edge check verifies it # connected to the EIP it named, so no intermediary can stand in for an # edge. GATE_PORT and GATE_INSECURE exist for tests only. set -uo pipefail host="${1:?usage: region-service-gate.sh [ ...]}" want="${2:?usage: region-service-gate.sh [ ...]}" shift 2 port="${GATE_PORT:-443}" insecure="" [ "${GATE_INSECURE:-}" = 1 ] && insecure="-k" unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY all_proxy hdr="$(mktemp "${TMPDIR:-/tmp}/region-gate.XXXXXX")" trap 'rm -f "$hdr"' EXIT fail=0 check() { #