#!/usr/bin/env bash
# Production health + API contract probe (wrapper).
# See scripts/prod_probe.py for logic.
#
# Usage:
#   bash scripts/prod_health_check.sh
#   NEXUS_PROBE_MODE=origin bash scripts/prod_health_check.sh   # skip external HTTPS
#
# One-time prod setup (probe password = admin login password):
#   NEXUS_TEST_ADMIN_PASSWORD='…' bash scripts/prod_probe_install.sh
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
SECRETS="${ROOT}/deploy/nexus-1panel.secrets.sh"
if [[ -f "$SECRETS" ]]; then
  # shellcheck disable=SC1090
  source "$SECRETS"
fi
MODE="${NEXUS_PROBE_MODE:-auto}"
exec python3 "${ROOT}/scripts/prod_probe.py" --mode "${MODE}"
