Verify B2
Path:
codemode-gateway/scripts/verify-b2.shRelative: scripts/verify-b2.shSubproject: codemode-gatewayCategory: codemode-gatewayLines: 43Bytes: 1,444Imports: 0Exports: 0
Content Preview
- #!/usr/bin/env bash
- # B2 live self-verification for codemode-gateway. Never prints the token.
- set -euo pipefail
- set -a; . /home/mikes/.env; set +a
- : "${CODEMODE_GATEWAY_TOKEN:?CODEMODE_GATEWAY_TOKEN missing}"
- URL="https://codemode-gateway.ceo-a53.workers.dev"
- # execute <label> <code> — POST /execute, retry once on cold-deploy 1042.
- execute() {
- local label="$1" code="$2"
- local body res
- body="$(jq -nc --arg c "$code" '{code:$c}')"
- for attempt in 1 2; do
- res="$(curl -s -X POST "$URL/e