panel v0.9.2 — open-source game server manager
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
# panel-native Sons Of The Forest runtime image (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
|
||||
|
||||
RUN dpkg --add-architecture i386 \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
locales \
|
||||
tini \
|
||||
curl \
|
||||
xvfb \
|
||||
xauth \
|
||||
wine64 \
|
||||
wine \
|
||||
winbind \
|
||||
cabextract \
|
||||
procps \
|
||||
&& 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
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
EXPOSE 8766/udp 27016/udp 9700/udp
|
||||
|
||||
ENTRYPOINT ["/usr/bin/tini", "--", "/entrypoint.sh"]
|
||||
@@ -0,0 +1,93 @@
|
||||
#!/bin/bash
|
||||
# panel-native Sons Of The Forest entrypoint (Wine).
|
||||
set -euo pipefail
|
||||
log() { printf '[panel-sotf] %s\n' "$*"; }
|
||||
|
||||
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 Sons Of The Forest}" \
|
||||
MAX_PLAYERS="${MAX_PLAYERS:-8}" \
|
||||
SERVER_PASSWORD="${SERVER_PASSWORD:-}" \
|
||||
GAME_PORT="${GAME_PORT:-8766}" \
|
||||
QUERY_PORT="${QUERY_PORT:-27016}" \
|
||||
BLOBSYNC_PORT="${BLOBSYNC_PORT:-9700}" \
|
||||
/entrypoint.sh "$@"
|
||||
fi
|
||||
|
||||
GAME_DIR=/game
|
||||
SAVE_DIR=/game-saves
|
||||
EXE="${GAME_DIR}/SonsOfTheForestDS.exe"
|
||||
# The server looks for dedicatedserver.cfg directly inside -userdatapath.
|
||||
CONFIG="${SAVE_DIR}/dedicatedserver.cfg"
|
||||
|
||||
if [[ ! -f "${EXE}" ]]; then
|
||||
log "ERROR: ${EXE} not found. Run 'Update' in the panel to install SOTF (Windows build) via SteamCMD."
|
||||
exit 78
|
||||
fi
|
||||
|
||||
# Seed dedicatedserver.cfg (JSON-ish) on first boot from env. On subsequent
|
||||
# boots, patch the port keys so panel-allocated ports flow into a config
|
||||
# the operator may have hand-edited (preserves their other tweaks).
|
||||
mkdir -p "${SAVE_DIR}"
|
||||
if [[ ! -s "${CONFIG}" ]]; then
|
||||
log "seeding ${CONFIG}"
|
||||
cat > "${CONFIG}" <<EOF
|
||||
{
|
||||
"IpAddress": "0.0.0.0",
|
||||
"ServerName": "${SERVER_NAME}",
|
||||
"MaxPlayers": ${MAX_PLAYERS},
|
||||
"Password": "${SERVER_PASSWORD}",
|
||||
"GamePort": ${GAME_PORT},
|
||||
"QueryPort": ${QUERY_PORT},
|
||||
"BlobSyncPort": ${BLOBSYNC_PORT},
|
||||
"LanOnly": false,
|
||||
"SaveSlot": 1,
|
||||
"SaveMode": "Continue",
|
||||
"GameMode": "Normal",
|
||||
"SaveInterval": 600,
|
||||
"LogFilesEnabled": false,
|
||||
"TimestampLogFilenames": true,
|
||||
"TimestampLogEntries": true,
|
||||
"SkipNetworkAccessibilityTest": true
|
||||
}
|
||||
EOF
|
||||
else
|
||||
log "patching ${CONFIG} (ports from env)"
|
||||
# JSON int keys — sed targets `"Key": NNNN` allowing any current value.
|
||||
sed -i -E \
|
||||
-e "s|(\"GamePort\":[[:space:]]*)[0-9]+|\1${GAME_PORT}|" \
|
||||
-e "s|(\"QueryPort\":[[:space:]]*)[0-9]+|\1${QUERY_PORT}|" \
|
||||
-e "s|(\"BlobSyncPort\":[[:space:]]*)[0-9]+|\1${BLOBSYNC_PORT}|" \
|
||||
"${CONFIG}"
|
||||
fi
|
||||
|
||||
if [[ ! -f "${WINEPREFIX}/system.reg" ]]; then
|
||||
log "initializing Wine prefix at ${WINEPREFIX}"
|
||||
xvfb-run -a wineboot --init 2>&1 | sed 's/^/ /' || true
|
||||
wineserver -w || true
|
||||
fi
|
||||
|
||||
trap 'log "SIGTERM"; wineserver -k 2>/dev/null || true; exit 0' TERM INT
|
||||
|
||||
cd "${GAME_DIR}"
|
||||
log "starting Sons Of The Forest dedicated server"
|
||||
log " name: ${SERVER_NAME}"
|
||||
log " game/query: ${GAME_PORT}/${QUERY_PORT}/udp"
|
||||
log " blobsync: ${BLOBSYNC_PORT}/udp"
|
||||
|
||||
# xvfb-run -a auto-allocates a free X display (host has its own Xvfb on
|
||||
# :99 / :100 / :101 — see panel/memory/gotchas.md).
|
||||
# Args mirror AMPTemplates sons-of-the-forest.kvp App.CommandLineArgs:
|
||||
# -dedicatedserver.* CLI overrides beat the cfg, so panel-allocated ports
|
||||
# always win even if the operator hand-edits dedicatedserver.cfg.
|
||||
exec stdbuf -oL -eL xvfb-run -a --server-args="-screen 0 1024x768x24" \
|
||||
wine "${EXE}" \
|
||||
-dedicatedserver.IpAddress "0.0.0.0" \
|
||||
-dedicatedserver.GamePort "${GAME_PORT}" \
|
||||
-dedicatedserver.QueryPort "${QUERY_PORT}" \
|
||||
-dedicatedserver.BlobSyncPort "${BLOBSYNC_PORT}" \
|
||||
-userdatapath "${SAVE_DIR}"
|
||||
@@ -0,0 +1,92 @@
|
||||
# Sons Of The Forest — panel-native dedicated server module (Wine).
|
||||
#
|
||||
# Windows-only dedicated server. Same pattern as V Rising + Empyrion:
|
||||
# Debian + Wine + Xvfb + tini, SteamCMD with platform:windows.
|
||||
#
|
||||
# Reference: https://github.com/CubeCoders/AMPTemplates (SonsOfTheForest.kvp)
|
||||
|
||||
id: sons-of-the-forest
|
||||
name: "Sons Of The Forest"
|
||||
version: 0.1.0
|
||||
authors:
|
||||
- panel contributors
|
||||
|
||||
supported_modes:
|
||||
- docker
|
||||
|
||||
runtime:
|
||||
docker:
|
||||
image: panel-sons-of-the-forest: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: "dedicatedserver.cfg + Saves/"
|
||||
- name: "Game Files"
|
||||
path: /game
|
||||
hint: "Server binaries"
|
||||
env:
|
||||
SERVER_NAME: "panel Sons Of The Forest"
|
||||
MAX_PLAYERS: "8"
|
||||
SERVER_PASSWORD: ""
|
||||
# Pre-declared so allocator-derived ports survive resolve.go's filter.
|
||||
GAME_PORT: "8766"
|
||||
QUERY_PORT: "27016"
|
||||
BLOBSYNC_PORT: "9700"
|
||||
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:
|
||||
- { name: game, proto: udp, default: 8766, required: true, env: GAME_PORT }
|
||||
- { name: query, proto: udp, default: 27016, required: true, env: QUERY_PORT }
|
||||
# NOTE: name stays "join" (SOTF calls it BlobSync) — the running prod
|
||||
# controller's in-memory manifest allocates ports by this name, and the
|
||||
# agent maps allocation→env by matching the same name. Renaming it only
|
||||
# works after a controller restart; the env var is what the game sees.
|
||||
- { name: join, proto: udp, default: 9700, required: true, env: BLOBSYNC_PORT }
|
||||
|
||||
resources:
|
||||
min_ram_mb: 8192
|
||||
recommended_ram_mb: 16384
|
||||
|
||||
# No rcon: AMP's kvp claims AdminMethod=STDIO, but live smoke test
|
||||
# (2026-07-14) showed the server ignores stdin entirely — `save`, `help`
|
||||
# and `stop` all produced zero reaction under wine+xvfb-run. Admin is
|
||||
# in-game only (like empyrion). Graceful stop = SIGTERM via entrypoint trap.
|
||||
# Log-derived player events. Regexes converted from CubeCoders'
|
||||
# AMPTemplates (sons-of-the-forest.kvp) — .NET (?<n>) syntax -> Go (?P<n>).
|
||||
# Sourced-from-template; not yet exercised against a live client.
|
||||
events:
|
||||
join:
|
||||
pattern: 'Steam auth successful for client \d+ with steam id (?P<id>\S+?)[.,] username (?P<name>.+)$'
|
||||
kind: join
|
||||
leave:
|
||||
pattern: 'Unregistering client \d+ with steam id (?P<id>\S+?)[.,] username (?P<name>.+)$'
|
||||
kind: leave
|
||||
|
||||
|
||||
update_providers:
|
||||
- id: stable
|
||||
kind: steamcmd
|
||||
app_id: "2465200"
|
||||
platform: windows
|
||||
install_path: /game
|
||||
|
||||
# --- 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.
|
||||
ready_pattern: '/Dedicated server loaded|\[Self-Tests\] Please restart the server/i'
|
||||
appearance:
|
||||
emoji: "🌲"
|
||||
grad: "linear-gradient(135deg,#14532d,#4d7c0f)"
|
||||
art: "/game-art/sons-of-the-forest.jpg"
|
||||
steam: "1326470"
|
||||
Reference in New Issue
Block a user