Files
proxmox/scripts/verify/check-dbis-core-gateway-rails.sh
defiQUG dbd517b279 Sync workspace: config, docs, scripts, CI, operator rules, and submodule pointers.
- Update dbis_core, cross-chain-pmm-lps, explorer-monorepo, metamask-integration, pr-workspace/chains
- Omit embedded publish git dirs and empty placeholders from index

Made-with: Cursor
2026-04-12 06:12:20 -07:00

47 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Internal smoke: DBIS Core SolaceNet gateway rails (authenticated).
# Usage:
# DBIS_CORE_API_BASE=https://dbis-api.d-bis.org \
# DBIS_CORE_BEARER_TOKEN=... \
# bash scripts/verify/check-dbis-core-gateway-rails.sh
# Or LAN: DBIS_CORE_API_BASE=http://192.168.11.x:3000 (example)
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
# shellcheck source=/dev/null
source "$ROOT/scripts/lib/load-project-env.sh" 2>/dev/null || true
BASE="${DBIS_CORE_API_BASE:-}"
TOKEN="${DBIS_CORE_BEARER_TOKEN:-${DBIS_API_TOKEN:-}}"
if [[ -z "$BASE" ]]; then
echo "check-dbis-core-gateway-rails: set DBIS_CORE_API_BASE (e.g. https://dbis-api.d-bis.org)" >&2
exit 2
fi
BASE="${BASE%/}"
URL="$BASE/api/v1/gateway/rails"
hdr=(-H "Accept: application/json")
if [[ -n "$TOKEN" ]]; then
hdr+=(-H "Authorization: Bearer $TOKEN")
fi
echo "GET $URL"
code=$(curl -sS -o /tmp/dbis-gateway-rails.json -w "%{http_code}" "${hdr[@]}" "$URL" || true)
body=$(cat /tmp/dbis-gateway-rails.json 2>/dev/null || true)
if [[ "$code" != "200" ]]; then
echo "check-dbis-core-gateway-rails: expected HTTP 200, got $code" >&2
echo "$body" >&2
exit 1
fi
if ! command -v jq >/dev/null 2>&1; then
echo "check-dbis-core-gateway-rails: OK (HTTP 200; install jq to assert JSON shape)"
exit 0
fi
echo "$body" | jq -e '.maintainer == "SolaceNet" and (.adapters | type == "array") and (.adapters | index("dbis.adapter.ktt-evidence") != null)' >/dev/null
echo "check-dbis-core-gateway-rails: OK (maintainer + adapters include ktt-evidence)"