The check inverted its own semantics: setting *_HEALTHCHECK=true would disable the health check (the documented behaviour was the opposite). Flip the condition so "false" disables and any other value (including default unset) leaves it enabled.
4.6 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
Plutainer is a Docker image for running Plutonium, IW4x, and Alterware dedicated game servers (Call of Duty titles: T4/WaW, T5/BO1, T6/BO2, IW5/MW3, IW4x/MW2, T7x/BO3). It uses Wine on Debian to run the Windows game server binaries, configured entirely via environment variables.
Build & Test
# Build the Docker image locally
docker build -t plutainer .
# Run a Plutonium container example
docker run -e PLUTO_GAME=t6zm -e PLUTO_SERVER_KEY=<key> -e PLUTO_CONFIG_FILE=dedicated.cfg \
-v /path/to/game_files:/home/plutainer/gamefiles:ro \
-v ./server-data:/home/plutainer/app \
-p 4976:4976/udp plutainer
# Run an IW4x container example
docker run -e IW4X_GAME=iw4x -e IW4X_CONFIG_FILE=server.cfg \
-v /path/to/game_files:/home/plutainer/gamefiles:ro \
-v ./server-data:/home/plutainer/app \
-p 28960:28960/udp plutainer
There are no automated tests or linters. The CI pipeline (.github/workflows/docker-publish.yml) builds and pushes to ghcr.io on pushes to main and on releases.
Architecture
Everything runs as the plutainer user from /home/plutainer/.plutainer.
-
entrypoint.sh— Dispatcher that detects game type viaPLUTO_GAME,IW4X_GAME, orALTER_GAMEenv var and delegates to the appropriate entrypoint script. -
plutoentry.sh— Plutonium server entrypoint. Symlinks game-specific files from the read-only gamefiles mount, runs the plutonium-updater, validates env vars, resolves game-specific defaults, thenexecswine bin/plutonium-bootstrapper-win32.exe. -
iw4xentry.sh— IW4x server entrypoint. Similar flow: symlinks game files, runs iw4x-launcher for updates, validates env vars, thenexecswine iw4x.exe. -
alterentry.sh— Alterware server entrypoint (T7x/Black Ops 3). Symlinks game files, creates writablezone/directory with symlinked contents, downloadst7x.exefrom upstream, validates env vars, thenexecswine t7x.exe. -
game-config.sh— Shared shell library sourced by all other scripts. Single source of truth for game detection, port defaults, config path resolution, and RCON password extraction. -
log-watcher.sh— Background poller started by each entrypoint beforeexec wine. Discovers every*.logunder/home/plutainer/app/(excludingapp/logs/itself to avoid cycles) and maintains relative symlinks at/home/plutainer/app/logs/<basename>pointing at the active one. Active = newest mtime >= container boot time, so stale logs from prior sessions and abandoned mod dirs are ignored. Agnostic to log name (handles user-defined names likegames_koth.log). Symlinks are relative so they resolve the same on host, this container, or a sidecar IW4MAdmin container. Disable withPLUTAINER_LOG_SYMLINKS=false; poll interval viaPLUTAINER_LOG_POLL_INTERVAL(default 2s). -
healthcheck.sh— Sourcesgame-config.sh, then usespyquake3.pyto send an RCONstatuscommand. Enabled by default; disable withPLUTO_HEALTHCHECK=false,IW4X_HEALTHCHECK=false, orALTER_HEALTHCHECK=false. -
rcon-cli— Python script providing interactive and one-shot RCON access viadocker exec. Callsgame-config.shto resolve port/credentials. Supports Plutonium, IW4x, and Alterware. -
pyquake3.py— Python 3 Quake 3 protocol library (UDP). Used by the health check andrcon-clifor RCON queries.
Game-Specific Behavior
For Plutonium, BASE_GAME is derived by stripping the last two chars from PLUTO_GAME (e.g., t6zm → t6). This drives:
- Default ports: iw4x→28960, iw5→27016, t4/t5→28960, t6→4976, t7x→27017
- Config file paths: t4→
app/gamefiles/main/, iw5→app/gamefiles/admin/, iw4x→app/gamefiles/userraw/, t7x→app/gamefiles/zone/, others→app/plutonium/storage/{base_game}/ - Command args: iw5 uses
+set sv_configand+start_map_rotate; others use+execand+map_rotate - Game file symlinks differ per base game (see
plutoentry.shcase statement)
Container Layout
/home/plutainer/gamefiles— bind-mounted read-only game files from host/home/plutainer/app— persistent volume (gamefiles symlinks, plutonium data, configs, logs)/home/plutainer/app/logs— stable symlinks to active game logs, maintained bylog-watcher.sh. Host-side IW4MAdmin should bind-mount this dir and read logs from there instead of reaching into nested mod/storage paths./home/plutainer/.plutainer— working directory containing scripts, updaters, and pyquake3