# ============================================================
# Caveman stack configuration — single source of truth.
#
# Compose interpolates CAVEMAN_IMAGE / CAVEMAN_HOST_PORT and
# env_file injects every CAVEMAN_*, CAVE_*, LITELLM_* and bridge
# value into the containers. Committed like the other stacks so
# Portainer (Git + relative path volumes) auto-loads it.
# ============================================================

# --- Image (read by Compose) ---
# Pin the digest in production; see README "Supply chain". Resolve with:
#   docker buildx imagetools inspect ghcr.io/juliusbrussee/caveman-proxy:bin-v2.0.2
CAVEMAN_IMAGE=ghcr.io/juliusbrussee/caveman-proxy:bin-v2.0.2

# Source ref the MCP recovery bridge compiles caveman-mcp from. Keep it in step
# with the image tag above so the proxy and its recovery tool ship as a pair.
CAVEMAN_REF=bin-v2.0.2

# --- Host port ---
# Bound to the host for the VPS Caddy edge and LAN clients. Guarded by
# CAVEMAN_AUTH_TOKEN; keep it firewalled to the LAN/WireGuard.
CAVEMAN_HOST_PORT=8787

# --- Proxy runtime ---
# Inbound shared token. REQUIRED: the image listens on 0.0.0.0:8787 and refuses
# a non-loopback bind without it. Generate ONCE with: openssl rand -hex 32
# Every client sends it as x-cave-api-key or Authorization: Bearer.
CAVEMAN_AUTH_TOKEN=7b4f1c9e2a6d8053b1e7f4a9c2d6e8305f1b9a7c4e2d6803b5f1c9e7a4d2b608

# Proxy mode: record (pass-through) | compress | pixel
CAVEMAN_MODE=compress

# Loopback/private upstream allowlist. The compat.litellm mount dials LiteLLM on
# the compose network, and the outbound SSRF guard blocks private-range
# destinations without an exact entry. Provider endpoints are public and need
# none.
CAVE_SSRF_ALLOWLIST=litellm:4000

# --- Upstream credentials ---
# LiteLLM master key, read by the compat.litellm mount (api_key_env). Same value
# as litellm/.env on the litellm stack.
LITELLM_MASTER_KEY=V4aFWKdpcNWwyNRdRO7LIfV7srxJGd

# Server-side provider keys, read by the compat mounts and used as upstream
# fallbacks. A client that brings its own provider credential always wins.
#
# Read by the standalone DeepSeek mounts (compat.deepseek and
# compat.deepseek-anthropic): clients authenticate to caveman with the shared
# token, and caveman presents this key upstream.
DEEPSEEK_API_KEY=sk-ea580c92fbc04318ab1d31f2f01c0b04
# ANTHROPIC_API_KEY=
# GEMINI_API_KEY=

# --- MCP recovery bridge (stdio caveman-mcp -> streamable HTTP for n8n) ---
SUPERGATEWAY_VERSION=3.4.3
MCP_BRIDGE_PORT=8000
