CI / check (push) Failing after 6m6s
tsc --noEmit (run standalone, not filtered through a shell wrapper that
silently swallowed the real exit code) caught what my own verification
missed the first time: c.req.param('name') is typed possibly-undefined
in this Hono router's inferred route map, and the podman build's own
`pnpm --filter server build` step (which runs the real tsc, unlike a
loosely-configured local check) failed on it — 1.2.10 was never
actually built with the :name/ai-config routes as a result. Added an
explicit guard (matches the 404 semantics of a missing param) to all
three new handlers.
Also bumps docker-compose.arena.yml to the 1.2.11 tag being built next.
Co-Authored-By: Claude <noreply@anthropic.com>
81 lines
4.2 KiB
YAML
81 lines
4.2 KiB
YAML
# docker-compose.arena.yml — the CANONICAL public BotFights arena
|
|
#
|
|
# This is the counterpart to docker-compose.yml (the local/dev stack). It runs
|
|
# ONLY the published registry image (no `build:` section — the arena runs exactly
|
|
# what nodes run, never a locally-built variant), with payments deliberately
|
|
# unconfigured and no reverse proxy in front (direct exposure on :9100, so the
|
|
# app's own rate limiter must see the real socket peer IP — see TRUSTED_PROXY note
|
|
# below).
|
|
#
|
|
# Deploy notes live in docs/arena-deployment.md — this file has no secrets. The
|
|
# JWT_SECRET value is generated on the host into /opt/botfights-arena/.env (0600,
|
|
# never committed).
|
|
#
|
|
# Arena-as-relay: this compose file is not special — it is the SAME image any
|
|
# node can run standalone (no ARENA_UPSTREAM_URL) to host its own public arena.
|
|
# The Foundation's VPS2 instance below is just the well-known default rendezvous,
|
|
# not a hardcoded authority. See docs/arena-deployment.md "Hosting your own arena".
|
|
|
|
services:
|
|
botfights-arena:
|
|
image: localhost:3000/lfg2025/botfights:1.2.11
|
|
container_name: botfights-arena
|
|
restart: unless-stopped
|
|
ports:
|
|
- "9100:9100"
|
|
volumes:
|
|
- botfights-arena-data:/app/server/data
|
|
# Explicit override (not just relying on the image's baked-in HEALTHCHECK):
|
|
# the currently published 1.1.0 tag predated the Dockerfile's HEALTHCHECK
|
|
# directive; kept for continuity across image rolls.
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "fetch('http://localhost:9100/api/health').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
start_period: 10s
|
|
retries: 3
|
|
environment:
|
|
- NODE_ENV=production
|
|
- PORT=9100
|
|
- FIGHT_LOOP_ENABLED=true
|
|
- PUBLIC_ARENA_URL=https://botfights.archipelago-foundation.org
|
|
# TRUSTED_PROXY=1 since 2026-07-30: the arena now sits behind
|
|
# nginx-proxy-manager at https://botfights.archipelago-foundation.org
|
|
# (Let's Encrypt cert, live). The app trusts X-Forwarded-For from NPM
|
|
# for its per-IP rate limiting instead of the raw socket peer (which
|
|
# would otherwise see every request as coming from NPM's own IP).
|
|
- TRUSTED_PROXY=1
|
|
# Auth — value comes from the host .env, never hardcoded here.
|
|
# Generated on VPS2 with: openssl rand -hex 32 (see docs/arena-deployment.md)
|
|
- JWT_SECRET=${JWT_SECRET}
|
|
- BOTFIGHTS_CREATOR_PUBKEYS=${BOTFIGHTS_CREATOR_PUBKEYS:-da5e0c1b646bdb13c2300f805b0ca3e5afe5b052c594ce78bac8978d21c3fa39}
|
|
# Deliberately OMITTED: this instance IS the upstream — never point it at
|
|
# another arena.
|
|
# - ARENA_UPSTREAM_URL=
|
|
# Encrypts stored per-user NWC connection strings at rest (AES-256-GCM,
|
|
# server/src/engine/crypto.ts) — without it, "Connect NWC" 500s
|
|
# immediately (getKey() throws under NODE_ENV=production). Generated on
|
|
# the host into /opt/botfights-arena/.env (0600, never committed),
|
|
# same pattern as JWT_SECRET above.
|
|
- BOTFIGHTS_WALLET_ENCRYPTION_KEY=${BOTFIGHTS_WALLET_ENCRYPTION_KEY}
|
|
# Mint for the planned Cashu fixed-stake entry fee ("winner takes all,
|
|
# 21 sats each, only ever"). Verified live: NUT-4 (mint, bolt11/sat),
|
|
# NUT-5 (melt), NUT-7 (spend-check — required to reject an
|
|
# already-spent posted token), NUT-11 (P2PK — lets a payout be locked
|
|
# to the winner's own pubkey with no interactive receive step). The
|
|
# mint's own description: "Do not use with large amounts of ecash" —
|
|
# good alignment with the 21-sat cap. Setting this alone moves no
|
|
# funds — the existing payout code path (server/src/engine/
|
|
# payments.ts) only reaches its cashu branch from ranked-mode fights,
|
|
# which still requires BOTFIGHTS_NWC_URL (unset) to even queue an
|
|
# entry fee. The actual "accept a posted token as a stake" capability
|
|
# does not exist in the codebase yet — still being scoped, see
|
|
# archy's 09-botfights-platform-upgrade/deferred-items.md.
|
|
- BOTFIGHTS_CASHU_MINT_URL=https://mint.minibits.cash/Bitcoin
|
|
# Still deliberately NOT set — the arena's own real-funds wallet:
|
|
# - BOTFIGHTS_NWC_URL=
|
|
# - BOTFIGHTS_DEV_PAYOUT_LNADDRESS=
|
|
|
|
volumes:
|
|
botfights-arena-data:
|