5.2 KiB
Server control room
The server includes a themed web control panel. It ships in the server distribution and needs no separate frontend build, hosting service, or JavaScript runtime.
Control panel preview, captured during isolated browser QA against a disposable mock inference backend.
Open the panel
Start the server with JDK 17:
./gradlew -PserverOnly :server:installDist
./server/build/install/server/bin/server
Open http://127.0.0.1:1337/admin. On first start, the server creates a private admin.key inside DATA_DIR (default ./data). Its startup message shows the file's location, without printing the key. Copy the key from that file into the panel's login field.
For deployments that supply their own secret, set ADMIN_TOKEN to at least 24 printable characters. This replaces file-based authentication for that process. The admin key is separate from player tokens and backend API keys.
The browser remembers operator clearance for the current tab session. Lock console clears it and clears the form. The panel does not download or display the saved backend API key. Use HTTPS or an SSH tunnel when administering across an untrusted network.
Admin routes now default to local connections only. For internet hosting, use the private SSH access and HTTPS proxy layout; the public proxy deliberately does not expose this panel. Backend tests/model discovery are rate-limited, so wait after repeated diagnostics return 429.
Configure inference
- Choose a connection profile (llama.cpp, LM Studio, Ollama's OpenAI-compatible endpoint, or custom).
- Enter the complete chat-completions endpoint, reachable from the server, such as
http://127.0.0.1:8081/v1/chat/completions. - Use Find models to query the corresponding
/modelsroute, or enter a model ID manually. Some compatible backends do not implement model discovery; manual entry still works. - Enter an API key if required. A blank field preserves the existing key. Clear saved key removes it when the configuration is saved.
- Use Test backend to generate a small sample from the current form, without saving it. This intentionally contacts the selected backend, even when LLM narration is currently disabled.
- Enable LLM narration and save the configuration.
Temperature, response token limit, request timeout, and style direction apply to the next narration call. In-flight calls finish with the settings they captured when they started. The fixed narration contract keeps rolls, objectives, and game outcomes authoritative; style direction adds atmosphere within that contract.
Settings are written atomically to DATA_DIR/server-settings.json, including any backend key, with owner-only file permissions on supported filesystems. This file is private, not encrypted. Preserve the data directory across server upgrades. LLM_URL, LLM_MODEL, and LLM_API_KEY seed settings only when no saved settings file exists; saved configuration takes precedence on later starts.
Relay status and crew intake
The overview shows active crews, recorded transmissions, server uptime, and successful/fallback narration counts. Counters reset on server restart; rooms and configuration persist. Probe requests do not count as game narration.
The crew manifest includes room code, phase, crew count, round, and remaining pressure. It excludes player credentials and pending action text. Accept new transmissions controls new room creation; turning it off lets existing rooms continue, including joining a lobby that already exists.
Changes apply without restarting. Revision checks reject saves from a stale browser tab; use Discard changes to reload the current saved configuration before editing again.
Admin API
All /admin/api/* endpoints require Authorization: Bearer <admin key>. Writes require Content-Type: application/json. The browser uses only same-origin requests; no CORS access is enabled.
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /admin/api/settings |
Redacted saved settings and revision |
| POST | /admin/api/settings |
Validate and save settings |
| GET | /admin/api/status |
Uptime, narrator counters, room summaries |
| POST | /admin/api/probe |
Test draft settings with one generation |
| POST | /admin/api/models |
Discover model IDs using draft settings |
The panel serves its CSS, JavaScript, and branding locally under /admin/. A restrictive content security policy disallows external scripts, external assets, and framing. Backend requests happen on the Kotlin server, so backend credentials stay out of browser requests to inference services.
Verification
./gradlew -PserverOnly :server:test :server:distZip
node --check server/src/main/resources/admin/app.js
python3 scripts/smoke.py http://127.0.0.1:1337
Automated tests cover admin authentication, credential redaction and retention/removal, settings persistence, stale-write rejection, URL and generation-limit validation, runtime narration updates, model discovery, and pausing only new rooms. Existing campaign and narration tests remain in place. Browser QA uses an isolated data directory and a disposable mock backend.