Verify B2

Path: codemode-gateway/scripts/verify-b2.shRelative: scripts/verify-b2.shSubproject: codemode-gatewayCategory: codemode-gateway
Lines: 43Bytes: 1,444Imports: 0Exports: 0

Content Preview

  1. #!/usr/bin/env bash
  2. # B2 live self-verification for codemode-gateway. Never prints the token.
  3. set -euo pipefail
  4. set -a; . /home/mikes/.env; set +a
  5. : "${CODEMODE_GATEWAY_TOKEN:?CODEMODE_GATEWAY_TOKEN missing}"
  6. URL="https://codemode-gateway.ceo-a53.workers.dev"
  7. # execute <label> <code> — POST /execute, retry once on cold-deploy 1042.
  8. execute() {
  9. local label="$1" code="$2"
  10. local body res
  11. body="$(jq -nc --arg c "$code" '{code:$c}')"
  12. for attempt in 1 2; do
  13. res="$(curl -s -X POST "$URL/e