view mrjunejune/test/inference_stack_config_test.sh @ 279:b3b547563ec7

Add Google connector service and agent wiki Implement the C/Seobeo Google Drive and Gmail connector with encrypted OAuth storage, Zenbu authentication, browser testing, AI tool discovery, chunked HTTP decoding, and Bazel coverage. Consolidate repository guidance into progressive wiki documentation and enforce arena-first allocation for new first-party C code. Co-authored-by: Copilot <[email protected]> Copilot-Session: 84c338fd-0939-4bb3-b7f3-1062eb213e5d
author MrJuneJune <me@mrjunejune.com>
date Mon, 17 Aug 2026 22:22:36 -0700
parents 13d61401c57d
children
line wrap: on
line source

#!/usr/bin/env bash
set -euo pipefail

source_script="$(realpath "$1")"
root="$(mktemp -d)"
trap 'rm -rf "$root"' EXIT
mkdir -p "$root/mrjunejune"
for file in server launcher sidecar copilot litellm config python mock; do
  touch "$root/$file"
done

cat > "$root/mrjunejune/.config" <<EOF
AUTH_COOKIE_SECRET=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
AUTH_BOOTSTRAP_USERNAME=admin
AUTH_BOOTSTRAP_PASSWORD_HASH=zenbu-scrypt\$v=1\$N=32768\$r=8\$p=1\$salt\$hash
LITELLM_MASTER_KEY=sk-test-only-value
GITHUB_COPILOT_TOKEN_DIR=$root/token-dir
MRJUNEJUNE_INFERENCE_STATE=$root
MRJUNEJUNE_ALLOW_GUEST_INFERENCE=true
SERVER_HOST=127.0.0.1
EOF

output="$(
  MRJUNEJUNE_ALLOW_GUEST_INFERENCE=false \
    BUILD_WORKSPACE_DIRECTORY="$root" \
    "$source_script" \
      "$root/server" \
      "$root/launcher" \
      "$root/sidecar" \
      "$root/copilot" \
      "$root/litellm" \
      "$root/config" \
      "$root/python" \
      "$root/mock" \
      --check-config
)"
grep -q "config=$root/mrjunejune/.config" <<<"$output"
grep -q '^litellm_master_key=set$' <<<"$output"
grep -q "copilot_token_dir=$root/token-dir" <<<"$output"
grep -q "copilot_cache_dir=$root/cache" <<<"$output"
grep -q '^guest_inference=true$' <<<"$output"
if grep -q 'sk-test-only-value' <<<"$output"; then
  echo "Config check leaked the LiteLLM master key" >&2
  exit 1
fi

echo 'UNSUPPORTED_SETTING=value' >> "$root/mrjunejune/.config"
if BUILD_WORKSPACE_DIRECTORY="$root" \
    "$source_script" \
      "$root/server" \
      "$root/launcher" \
      "$root/sidecar" \
      "$root/copilot" \
      "$root/litellm" \
      "$root/config" \
      "$root/python" \
      "$root/mock" \
      --check-config >/dev/null 2>&1; then
  echo "Unsupported config key was accepted" >&2
  exit 1
fi

if grep -Eq '(^|[[:space:]])(source|eval)[[:space:]]' "$source_script"; then
  echo "Inference config parser must not source or eval config files" >&2
  exit 1
fi