Environment Variables
Source of truth: the .env.example file in each app directory. This page
collects them in one place for grep-ability. When the two disagree, the
.env.example wins — please update this page in the same PR.
apps/weiqi-server
Section titled “apps/weiqi-server”DATABASE_URL=postgresql://user:password@localhost:54320/weiqi_devPORT=3002AUTH_SERVICE_URL=http://localhost:3004CORS_ORIGINS=http://localhost:3001,https://game.weiqi.appSITE_PARSER_CRON_PATTERN=0 3 * * *NODE_ENV=developmentRECOGNITION_SERVICE_URL=http://localhost:4010AWS_S3_ENDPOINT=http://localhost:9000AWS_S3_FORCE_PATH_STYLE=trueAWS_S3_BUCKET_NAME=weiqi.boards.localAWS_S3_BUCKET_URL=http://localhost:9000/weiqi.boards.localAWS_REGION=us-east-1AWS_ACCESS_KEY_ID=dev-access-keyAWS_SECRET_ACCESS_KEY=dev-secret-key| Key | Purpose |
|---|---|
DATABASE_URL | Postgres connection. Matches docker-compose.yml (port 54320). |
PORT | HTTP listen port. Default 3002. |
AUTH_SERVICE_URL | Base URL of auth-app. Used for session validation. |
CORS_ORIGINS | Comma-separated allow-list. |
SITE_PARSER_CRON_PATTERN | Standard 5-field cron for the GoProblems sync job. Default daily at 03:00. |
NODE_ENV | development / production / test. |
RECOGNITION_SERVICE_URL | URL of recognition-service. |
AWS_S3_* | MinIO (dev) or real S3 (prod). |
apps/auth-app
Section titled “apps/auth-app”DB_CONNECTION_STRING=postgresql://auth_user:auth_password@localhost:5433/auth_devBETTER_AUTH_URL=http://localhost:3004AUTH_DOMAIN=http://localhost:3004NEXT_PUBLIC_AUTH_URL=http://localhost:3004COOKIE_DOMAIN=localhostBETTER_AUTH_SECRET=<openssl rand -hex 32>GOOGLE_CLIENT_ID=<...>GOOGLE_CLIENT_SECRET=<...>RESEND_API_KEY=<...>AWS_REGION=eu-central-1AWS_S3_ENDPOINT=http://localhost:9000AWS_S3_FORCE_PATH_STYLE=trueAWS_ACCESS_KEY_ID=dev-access-keyAWS_SECRET_ACCESS_KEY=dev-secret-keyAWS_S3_BUCKET_NAME=weiqi.accounts.localAWS_S3_BUCKET_URL=http://localhost:9000/weiqi.accounts.localBILLING_DOMAIN_NAME=Weiqi BillingBILLING_DOMAIN_VERSION=1PRO_UPGRADE_PRICE_WEI=10000000000000000TOPUP_PRICE_PER_ENERGY_WEI=100000000000000COMMON_DAILY_ENERGY=50PRO_DAILY_ENERGY=1000PRO_TIER_DURATION_DAYS=30PRO_TIER_GRACE_DAYS=3NONCE_TTL_SECONDS=900BILLING_TREASURY_ADDRESS=0x1111111111111111111111111111111111111111BETTER_AUTH_SECRET must be at least 32 chars and must not contain
placeholder words like dev-secret. Generate with
openssl rand -hex 32.
apps/billing-indexer
Section titled “apps/billing-indexer”DATABASE_URL=postgresql://billing_user:billing_password@localhost:5435/billing_devBILLING_TREASURY_ADDRESS=0x0000000000000000000000000000000000000000BASE_RPC_URL=BASE_RPC_WSS_URL=ETHEREUM_RPC_URL=ETHEREUM_RPC_WSS_URL=POLYGON_RPC_URL=POLYGON_RPC_WSS_URL=ARBITRUM_RPC_URL=ARBITRUM_RPC_WSS_URL=OPTIMISM_RPC_URL=OPTIMISM_RPC_WSS_URL=AUTH_APP_WEBHOOK_URL=http://localhost:3004/api/internal/billing/webhookBILLING_INDEXER_WEBHOOK_PRIVATE_KEY=<32-byte hex>BILLING_INDEXER_KEY_ID=local-key-1BILLING_WEBHOOK_TIMEOUT_MS=5000BILLING_WEBHOOK_MAX_ATTEMPTS=6BILLING_INDEXER_START_BLOCK_8453=12000000BILLING_INDEXER_START_BLOCK_84532=5000000BILLING_INDEXER_START_BLOCK_1=0BILLING_INDEXER_START_BLOCK_137=0BILLING_INDEXER_START_BLOCK_42161=0BILLING_INDEXER_START_BLOCK_10=0PORT=9090Per-chain RPC URLs are optional; leave blank to skip a chain.
apps/katago-service
Section titled “apps/katago-service”PORT=4011GRPC_PORT=50051KATAGO_PATH=katagoKATAGO_MODEL_PATH=KATAGO_CONFIG_PATH=QUEUE_MODE=noneREDIS_URL=redis://localhost:6379Set QUEUE_MODE=bullmq when running multiple weiqi-server replicas that
need to share a KataGo budget.
apps/mcp-bridge
Section titled “apps/mcp-bridge”MCP_ENABLED=trueMCP_TRANSPORT=httpMCP_PORT=3003MCP_API_KEY=WEIQI_URL=http://localhost:3002WEIQI_TIER=proAUTH_APP_URL=http://localhost:3004ADMIN_EMAIL=admin@admin.localADMIN_PASSWORD=adminADMIN_NAME=AI Bridge Test UserMCP_ENABLED=false makes the process exit without binding any port — use
this in prod-by-default deployments.
apps/recognition-service
Section titled “apps/recognition-service”PORT=4010REDIS_URL=redis://localhost:6379The model URL, input size, and threshold are hard-coded in
src/adapters/inference/moku-v3.constants.ts.
apps/main-app-astro
Section titled “apps/main-app-astro”PUBLIC_GA_MEASUREMENT_ID=Leave empty in dev/preview to disable Google Analytics loading entirely.
PUBLIC_* keys are inlined into the client bundle at build time.
apps/game-web
Section titled “apps/game-web”VITE_SERVER_URL=http://localhost:3012VITE_AUTH_SIGNIN_URL=https://accounts.weiqi.app/auth/sign-in# VITE_RECOGNITION_URL=http://localhost:4010 # optional direct bypassVITE_SERVER_URL is the weiqi-server base URL. VITE_AUTH_SIGNIN_URL
points at the Better-Auth sign-in page.
Deploy-time secrets (Cloudflare Pages)
Section titled “Deploy-time secrets (Cloudflare Pages)”These are not in any .env.example. They live in the deploy secret store
(GitHub Secrets / Cloudflare Pages dashboard):
CLOUDFLARE_API_TOKEN— Pages deploy token.CLOUDFLARE_ACCOUNT_ID— account holding the Pages projects.*_ENV(per app) — the contents of the app’s.envfile, piped in by the deploy workflow.