panel v0.9.1 — open-source game server manager
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
# panel-native Enshrouded runtime image.
|
||||
#
|
||||
# Enshrouded's dedicated server is WINDOWS-ONLY (SteamCMD app 2278520 has no
|
||||
# Linux depot — "Invalid platform"; AMP runs the exe under Proton GE). We run
|
||||
# it under Wine + Xvfb, same pattern as the verified windrose module.
|
||||
#
|
||||
# Expected runtime layout inside the container:
|
||||
# /game — SteamCMD-installed Windows build (panel volume)
|
||||
# /game/enshrouded_server.exe — dedicated server binary
|
||||
# /game-saves — enshrouded_server.json + savegame/ + logs/
|
||||
# /entrypoint.sh — boot Xvfb, launch exe under Wine
|
||||
|
||||
FROM debian:12-slim
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive \
|
||||
TZ=Etc/UTC \
|
||||
LANG=en_US.UTF-8 \
|
||||
LC_ALL=en_US.UTF-8 \
|
||||
WINEDEBUG=-all \
|
||||
WINEPREFIX=/home/panel/.wine \
|
||||
DISPLAY=:99
|
||||
|
||||
# winehq-stable (Wine 9+) rather than Debian's wine 8.0~repack — matches the
|
||||
# windrose module's rationale (IOCP fixes, and what CubeCoders' AMP wine
|
||||
# images ship). cabextract + winbind are commonly needed by Wine helpers.
|
||||
RUN dpkg --add-architecture i386 \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
locales \
|
||||
tini \
|
||||
curl \
|
||||
gnupg \
|
||||
xvfb \
|
||||
xauth \
|
||||
winbind \
|
||||
cabextract \
|
||||
procps \
|
||||
&& mkdir -pm755 /etc/apt/keyrings \
|
||||
&& curl -fsSL https://dl.winehq.org/wine-builds/winehq.key \
|
||||
| gpg --dearmor -o /etc/apt/keyrings/winehq-archive.key \
|
||||
&& curl -fsSL https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources \
|
||||
-o /etc/apt/sources.list.d/winehq-bookworm.sources \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends winehq-stable \
|
||||
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
|
||||
&& locale-gen \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN groupadd -g 1000 panel \
|
||||
&& useradd -u 1000 -g 1000 -m -s /bin/bash panel \
|
||||
&& mkdir -p /game /game-saves \
|
||||
&& chown -R panel:panel /game /game-saves /home/panel
|
||||
|
||||
# Pre-warm the Wine prefix during the image build (skip Mono/Gecko — the
|
||||
# server doesn't need .NET/HTML). See windrose Dockerfile for the full
|
||||
# rationale (interrupted first-boot wineboot leaves a broken prefix that
|
||||
# crash-loops with kernel32 c0000135).
|
||||
USER panel
|
||||
ENV HOME=/home/panel WINEPREFIX=/home/panel/.wine WINEDEBUG=-all
|
||||
RUN Xvfb :99 -screen 0 1024x768x24 -nolisten tcp & XVFB_PID=$! \
|
||||
&& sleep 2 \
|
||||
&& DISPLAY=:99 WINEDLLOVERRIDES="mscoree=;mshtml=" wineboot --init \
|
||||
&& wineserver -w \
|
||||
&& kill "$XVFB_PID" 2>/dev/null || true
|
||||
USER root
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
EXPOSE 15637/udp
|
||||
|
||||
ENTRYPOINT ["/usr/bin/tini", "--", "/entrypoint.sh"]
|
||||
@@ -0,0 +1,95 @@
|
||||
#!/bin/bash
|
||||
# panel-native Enshrouded entrypoint (Windows server under Wine + Xvfb).
|
||||
set -euo pipefail
|
||||
log() { printf '[panel-enshrouded] %s\n' "$*"; }
|
||||
|
||||
# ----- stage 1: root-only bootstrap, then drop to panel (Wine refuses root) -----
|
||||
if [[ "$(id -u)" = "0" ]]; then
|
||||
chown -R panel:panel /game /game-saves /home/panel 2>/dev/null || true
|
||||
exec setpriv --reuid=panel --regid=panel --clear-groups \
|
||||
--inh-caps=-all --bounding-set=-all \
|
||||
env HOME=/home/panel \
|
||||
WINEPREFIX=/home/panel/.wine \
|
||||
WINEDEBUG=-all \
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
|
||||
SERVER_NAME="${SERVER_NAME:-panel Enshrouded}" \
|
||||
SERVER_PASSWORD="${SERVER_PASSWORD:-letmein}" \
|
||||
MAX_PLAYERS="${MAX_PLAYERS:-16}" \
|
||||
QUERY_PORT="${QUERY_PORT:-15637}" \
|
||||
/entrypoint.sh "$@"
|
||||
fi
|
||||
|
||||
GAME_DIR=/game
|
||||
SAVE_DIR=/game-saves
|
||||
EXE="${GAME_DIR}/enshrouded_server.exe"
|
||||
CONFIG="${SAVE_DIR}/enshrouded_server.json"
|
||||
|
||||
if [[ ! -f "${EXE}" ]]; then
|
||||
log "ERROR: ${EXE} not found. Run 'Update' in the panel — that launches a"
|
||||
log " SteamCMD sidecar which installs the Windows build (app 2278520,"
|
||||
log " +@sSteamCmdForcePlatformType windows) into this volume."
|
||||
exit 78 # EX_CONFIG
|
||||
fi
|
||||
|
||||
mkdir -p "${SAVE_DIR}/savegame" "${SAVE_DIR}/logs"
|
||||
|
||||
# Seed enshrouded_server.json on first boot. The Steam depot does not ship a
|
||||
# config (the server generates one), so we write our own — deterministic, and
|
||||
# the env->json patching below always has keys to patch. Paths are relative
|
||||
# to the exe's directory; we symlink savegame/ + logs/ into the save volume.
|
||||
if [[ ! -s "${CONFIG}" ]]; then
|
||||
log "seeding default ${CONFIG}"
|
||||
cat > "${CONFIG}" <<'EOF'
|
||||
{
|
||||
"name": "panel Enshrouded",
|
||||
"password": "",
|
||||
"saveDirectory": "./savegame",
|
||||
"logDirectory": "./logs",
|
||||
"ip": "0.0.0.0",
|
||||
"queryPort": 15637,
|
||||
"slotCount": 16
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
|
||||
# Basic env -> json patching. Enshrouded config is small + flat so a few
|
||||
# seds are fine without pulling jq in.
|
||||
sed -i "s|\"name\":\\s*\"[^\"]*\"|\"name\": \"${SERVER_NAME}\"|" "${CONFIG}"
|
||||
sed -i "s|\"password\":\\s*\"[^\"]*\"|\"password\": \"${SERVER_PASSWORD}\"|" "${CONFIG}"
|
||||
sed -i "s|\"slotCount\":\\s*[0-9]*|\"slotCount\": ${MAX_PLAYERS}|" "${CONFIG}"
|
||||
# Panel-allocated port. Modern Enshrouded has a single UDP port (queryPort);
|
||||
# gamePort no longer exists in the config schema.
|
||||
sed -i "s|\"queryPort\":\\s*[0-9]*|\"queryPort\": ${QUERY_PORT}|" "${CONFIG}"
|
||||
|
||||
# Config + save/log dirs live in the save volume; symlink them next to the
|
||||
# exe (the server resolves config + relative paths from its own directory).
|
||||
ln -sf "${CONFIG}" "${GAME_DIR}/enshrouded_server.json"
|
||||
for d in savegame logs; do
|
||||
if [[ -d "${GAME_DIR}/${d}" && ! -L "${GAME_DIR}/${d}" ]]; then rm -rf "${GAME_DIR}/${d}"; fi
|
||||
ln -sfn "${SAVE_DIR}/${d}" "${GAME_DIR}/${d}"
|
||||
done
|
||||
|
||||
# --- Wine prefix bootstrap / repair (image pre-warms it; repair if broken) ---
|
||||
if [[ ! -f "${WINEPREFIX}/system.reg" || ! -f "${WINEPREFIX}/drive_c/windows/system32/kernel32.dll" ]]; then
|
||||
log "initializing Wine prefix at ${WINEPREFIX}"
|
||||
rm -rf "${WINEPREFIX}"
|
||||
xvfb-run -a env WINEDLLOVERRIDES="mscoree=;mshtml=" wineboot --init 2>&1 | sed 's/^/ /' || true
|
||||
wineserver -w || true
|
||||
fi
|
||||
|
||||
cd "${GAME_DIR}"
|
||||
log "starting Enshrouded dedicated server (Wine)"
|
||||
log " name: ${SERVER_NAME}"
|
||||
log " slots: ${MAX_PLAYERS}"
|
||||
log " port: ${QUERY_PORT}/udp"
|
||||
|
||||
# The server writes its real log to ./logs/enshrouded_server.log; mirror it
|
||||
# to stdout so the panel's log follower + ready_pattern see it even if the
|
||||
# Wine console output is sparse. tail -F copes with the file not existing yet.
|
||||
tail -n +1 -F "${SAVE_DIR}/logs/enshrouded_server.log" 2>/dev/null &
|
||||
TAIL_PID=$!
|
||||
|
||||
trap 'log "SIGTERM received; stopping server"; wineserver -k 2>/dev/null || true; kill "${TAIL_PID:-}" 2>/dev/null || true; exit 0' TERM INT
|
||||
|
||||
exec stdbuf -oL -eL xvfb-run -a --server-args="-screen 0 1024x768x24" \
|
||||
wine "${EXE}"
|
||||
@@ -0,0 +1,101 @@
|
||||
# Enshrouded — panel-native dedicated server module.
|
||||
#
|
||||
# The dedicated server is WINDOWS-ONLY (SteamCMD app 2278520 — no Linux
|
||||
# depot; a plain Linux install fails with "Invalid platform", verified
|
||||
# 2026-07-14). An earlier scaffold claimed "native Linux" — wrong. AMP runs
|
||||
# the exe under Proton GE; we run it under Wine + Xvfb like windrose/empyrion
|
||||
# (update provider `platform: windows`).
|
||||
# No traditional RCON — server console is stdin-only.
|
||||
#
|
||||
# Reference: https://github.com/CubeCoders/AMPTemplates (enshrouded.kvp)
|
||||
|
||||
id: enshrouded
|
||||
name: "Enshrouded"
|
||||
version: 0.1.0
|
||||
authors:
|
||||
- panel contributors
|
||||
|
||||
supported_modes:
|
||||
- docker
|
||||
|
||||
runtime:
|
||||
docker:
|
||||
image: panel-enshrouded:latest
|
||||
# Host networking -- container shares the host net namespace, so
|
||||
# any port the game/mod binds is directly on the LAN. AMP-like
|
||||
# model. Multi-instance safety comes from env-driven per-instance
|
||||
# ports (panel allocator + env: mapping on each ports entry).
|
||||
network_mode: host
|
||||
browseable_root: /game-saves
|
||||
browseable_roots:
|
||||
- name: "Saves & Configs"
|
||||
path: /game-saves
|
||||
hint: "enshrouded_server.json + savegame/"
|
||||
- name: "Game Files"
|
||||
path: /game
|
||||
hint: "Server binaries"
|
||||
env:
|
||||
SERVER_NAME: "panel Enshrouded"
|
||||
SERVER_PASSWORD: "letmein"
|
||||
MAX_PLAYERS: "16"
|
||||
# Pre-declared so the agent's resolve.go filter lets the
|
||||
# panel-allocated port flow through to the container env (same
|
||||
# pattern as soulmask). Modern Enshrouded (post "Melodies of the
|
||||
# Mire", 2024) has a SINGLE UDP port — queryPort in
|
||||
# enshrouded_server.json; gamePort was removed from the config.
|
||||
QUERY_PORT: "15637"
|
||||
volumes:
|
||||
- { type: volume, name: "panel-$INSTANCE_ID-saves", container: "/game-saves" }
|
||||
- { type: volume, name: "panel-$INSTANCE_ID-game", container: "/game" }
|
||||
- { target: "$DATA_PATH/logs", container: "/game-saves/logs" }
|
||||
|
||||
ports:
|
||||
# Single UDP port — current Enshrouded merged game+query into one
|
||||
# "queryPort" (AMP's enshroudedports.json declares only QueryPort).
|
||||
- { name: query, proto: udp, default: 15637, required: true, env: QUERY_PORT }
|
||||
|
||||
resources:
|
||||
min_ram_mb: 8192
|
||||
recommended_ram_mb: 16384 # Enshrouded is memory-hungry
|
||||
|
||||
rcon:
|
||||
# Enshrouded admin is stdin-only (no network RCON in-game).
|
||||
adapter: stdio
|
||||
commands:
|
||||
save: "save"
|
||||
shutdown: "shutdown"
|
||||
# Log-derived player events. Regexes converted from CubeCoders'
|
||||
# AMPTemplates (enshrouded.kvp) — .NET (?<n>) syntax -> Go (?P<n>).
|
||||
# Sourced-from-template; not yet exercised against a live client.
|
||||
events:
|
||||
join:
|
||||
pattern: '\[server\] Player ''(?P<name>[^'']+)'' logged in with Permissions:'
|
||||
kind: join
|
||||
leave:
|
||||
pattern: '\[server\] Remove Player ''(?P<name>[^'']+)''$'
|
||||
kind: leave
|
||||
|
||||
|
||||
update_providers:
|
||||
- id: stable
|
||||
kind: steamcmd
|
||||
app_id: "2278520"
|
||||
install_path: /game
|
||||
platform: windows # server is Windows-only; no Linux depot
|
||||
|
||||
# --- Manifest-driven UI metadata (WI-07) --------------------------
|
||||
# Consumed by the CONTROLLER/dashboard only (the controller loads its
|
||||
# own ./modules copy at startup); the agent ignores these at runtime.
|
||||
# ready_pattern is a JavaScript regex (slash-delimited when it needs
|
||||
# flags) moved verbatim from the dashboard's READY_PATTERNS map.
|
||||
# AMP's Console.AppReadyRegex: ^.*\[Session\] 'HostOnline' \(up\)!$
|
||||
# VERIFIED live 2026-07-14 (agent01 smoke test): the exact ready line is
|
||||
# [Session] 'HostOnline' (up)!
|
||||
# Install 8.3 GB on disk; boot start->HostOnline ~25 s (warm Wine prefix);
|
||||
# external A2S_INFO on the single UDP port answered off-host.
|
||||
ready_pattern: "/\\[Session\\] 'HostOnline' \\(up\\)!/i"
|
||||
appearance:
|
||||
emoji: "🌫️"
|
||||
grad: "linear-gradient(135deg,#4a2c2a,#a45e4a)"
|
||||
art: "/game-art/enshrouded.jpg"
|
||||
steam: "1203620"
|
||||
Reference in New Issue
Block a user