#!/usr/bin/env bash # Show API key and step-by-step browser instructions for Server UI. set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" STACK_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)" REPO_ROOT="$(cd "${STACK_DIR}/../.." && pwd)" PROD_ENV="/opt/control-plane/.env" DEV_ENV="${REPO_ROOT}/stacks/control-plane/.env" UI_PORT=8091 if [[ -f "${DEV_ENV}" ]]; then UI_PORT="$(grep '^SERVER_UI_PORT=' "${DEV_ENV}" 2>/dev/null | cut -d= -f2- || echo 8091)" fi # Prefer dev copy when readable (same key after sync); else production. ENV_FILE="${DEV_ENV}" if [[ ! -r "${ENV_FILE}" ]]; then ENV_FILE="${PROD_ENV}" fi # shellcheck source=print-api-key-instructions.sh source "${SCRIPT_DIR}/print-api-key-instructions.sh" print_api_key_instructions "${ENV_FILE}" "${UI_PORT}"