panel — open-source game server manager (public release)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-14 19:19:43 -07:00
commit 5232609719
2160 changed files with 300415 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
# panel-native V Rising 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 9876/udp 9877/udp
ENTRYPOINT ["/usr/bin/tini", "--", "/entrypoint.sh"]
+110
View File
@@ -0,0 +1,110 @@
#!/bin/bash
# panel-native V Rising entrypoint (Wine).
#
# CLI flags > JSON in V Rising's override precedence, so we drive every
# operator-facing knob via -flag args from env vars rather than rewriting
# ServerHostSettings.json on each boot. The shipped JSON in StreamingAssets/
# stays untouched; operators who want individual ServerGameSettings.json
# edits can ssh in / use the Files tab and edit the seeded copy in
# /game-saves/Settings — but only if GAME_SETTINGS_PRESET is empty (a
# non-empty preset overrides individual edits silently — Stunlock gotcha).
set -euo pipefail
log() { printf '[panel-v-rising] %s\n' "$*"; }
if [[ "$(id -u)" = "0" ]]; then
chown -R panel:panel /game /game-saves /home/panel 2>/dev/null || true
# Hand off to panel user. setpriv preserves env, so all the SERVER_*
# / GAME_* / RCON_* knobs the panel manifest sets reach the child.
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 \
/entrypoint.sh "$@"
fi
GAME_DIR=/game
SAVE_DIR=/game-saves
EXE="${GAME_DIR}/VRisingServer.exe"
SETTINGS_SRC="${GAME_DIR}/VRisingServer_Data/StreamingAssets/Settings"
SETTINGS_DST="${SAVE_DIR}/Settings"
if [[ ! -f "${EXE}" ]]; then
log "ERROR: ${EXE} not found. Run 'Update' in the panel to install V Rising (Windows build) via SteamCMD."
exit 78
fi
# Seed ServerHostSettings.json + ServerGameSettings.json into save volume
# the first time only. After that the operator can edit them by hand for
# settings the panel doesn't expose; CLI flags below still override the
# operator-facing keys (Name, Description, ports, password, max players).
mkdir -p "${SETTINGS_DST}"
if [[ ! -s "${SETTINGS_DST}/ServerHostSettings.json" && -d "${SETTINGS_SRC}" ]]; then
log "seeding ${SETTINGS_DST} from shipped defaults"
cp -r "${SETTINGS_SRC}/." "${SETTINGS_DST}/" || true
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
# ---- Env defaults (mirrors module.yaml's env: block) ----
SERVER_NAME="${SERVER_NAME:-panel V Rising}"
SERVER_DESCRIPTION="${SERVER_DESCRIPTION:-}"
SERVER_PASSWORD="${SERVER_PASSWORD:-}"
MAX_PLAYERS="${MAX_PLAYERS:-40}"
MAX_ADMINS="${MAX_ADMINS:-4}"
SAVE_NAME="${SAVE_NAME:-panel}"
LIST_ON_STEAM="${LIST_ON_STEAM:-true}"
LIST_ON_EOS="${LIST_ON_EOS:-true}"
SECURE="${SECURE:-true}"
SERVER_FPS="${SERVER_FPS:-30}"
LOWER_FPS_WHEN_EMPTY="${LOWER_FPS_WHEN_EMPTY:-true}"
GAME_SETTINGS_PRESET="${GAME_SETTINGS_PRESET:-}"
GAME_DIFFICULTY_PRESET="${GAME_DIFFICULTY_PRESET:-}"
GAME_PORT="${GAME_PORT:-9876}"
QUERY_PORT="${QUERY_PORT:-9877}"
RCON_ENABLED="${RCON_ENABLED:-false}"
RCON_PORT="${RCON_PORT:-25575}"
RCON_PASSWORD="${RCON_PASSWORD:-}"
# ---- Build CLI args ----
ARGS=(
-persistentDataPath "${SAVE_DIR}"
-saveName "${SAVE_NAME}"
-serverName "${SERVER_NAME}"
-gamePort "${GAME_PORT}"
-queryPort "${QUERY_PORT}"
-maxUsers "${MAX_PLAYERS}"
-maxAdmins "${MAX_ADMINS}"
-listOnSteam "${LIST_ON_STEAM}"
-listOnEOS "${LIST_ON_EOS}"
-secure "${SECURE}"
-targetFps "${SERVER_FPS}"
-lowerFPSWhenEmpty "${LOWER_FPS_WHEN_EMPTY}"
-logFile "-"
-batchmode -nographics
)
[[ -n "${SERVER_DESCRIPTION}" ]] && ARGS+=(-description "${SERVER_DESCRIPTION}")
[[ -n "${SERVER_PASSWORD}" ]] && ARGS+=(-password "${SERVER_PASSWORD}")
[[ -n "${GAME_SETTINGS_PRESET}" ]] && ARGS+=(-preset "${GAME_SETTINGS_PRESET}")
[[ -n "${GAME_DIFFICULTY_PRESET}" ]] && ARGS+=(-difficultyPreset "${GAME_DIFFICULTY_PRESET}")
if [[ "${RCON_ENABLED}" == "true" ]]; then
ARGS+=(-rconEnabled true -rconPort "${RCON_PORT}" -rconPassword "${RCON_PASSWORD}")
fi
cd "${GAME_DIR}"
log "starting V Rising dedicated server"
log " name: ${SERVER_NAME}"
log " ports: ${GAME_PORT}/${QUERY_PORT} (game/query)"
log " slots: ${MAX_PLAYERS}"
log " preset: ${GAME_SETTINGS_PRESET:-(none)}"
log " rcon: ${RCON_ENABLED} (port ${RCON_PORT})"
# xvfb-run -a auto-allocates a free display — host has its own Xvfb on
# :99 / :100 / :101, see panel/memory/gotchas.md.
exec stdbuf -oL -eL xvfb-run -a --server-args="-screen 0 1024x768x24" \
wine "${EXE}" "${ARGS[@]}"
+121
View File
@@ -0,0 +1,121 @@
# V Rising — panel-native dedicated server module (Wine).
#
# Windows-only dedicated server. Same pattern as Empyrion:
# Debian + Wine + Xvfb + tini, SteamCMD with platform:windows.
#
# Reference: https://github.com/StunlockStudios/vrising-dedicated-server-instructions
# CLI/env-var flags override JSON, so the panel ships its config via env →
# entrypoint flags rather than rewriting ServerHostSettings.json. Avoids
# the per-boot JSON-rewrite race that bit ARK SA's INI flow.
id: v-rising
name: "V Rising"
version: 0.2.0
authors:
- panel contributors
supported_modes:
- docker
runtime:
docker:
image: panel-v-rising: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: "Settings/ServerHostSettings.json + Saves/"
- name: "Game Files"
path: /game
hint: "Server binaries"
env:
# ---- Host settings (ServerHostSettings.json equivalents) ----
SERVER_NAME: "panel V Rising"
SERVER_DESCRIPTION: "A V Rising server hosted by panel."
SERVER_PASSWORD: "" # blank = open server
MAX_PLAYERS: "40"
MAX_ADMINS: "4"
SAVE_NAME: "panel"
LIST_ON_STEAM: "true"
LIST_ON_EOS: "true"
SECURE: "true" # VAC
SERVER_FPS: "30"
LOWER_FPS_WHEN_EMPTY: "true"
# ---- Game-rule presets (set GAME_SETTINGS_PRESET to "" if you
# want to edit individual rules in ServerGameSettings.json
# manually — otherwise the preset wins silently) ----
GAME_SETTINGS_PRESET: "" # e.g. StandardPvP, StandardPvE, Duo_PvP, Solo_PvP, HardcorePvP
GAME_DIFFICULTY_PRESET: "" # e.g. (engine accepts files in StreamingAssets/GameSettingPresets/)
# ---- Port mappings (mirrored by the agent's port allocator) ----
GAME_PORT: "9876"
QUERY_PORT: "9877"
# ---- RCON (off by default — turn on per-instance once you need it) ----
RCON_ENABLED: "false"
RCON_PORT: "25575"
RCON_PASSWORD: ""
# ---- Legacy panel default; entrypoint reads the new keys above ----
ADMIN_PASSWORD: "changeme"
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:
# `env:` tells the agent which container env var to set with the
# allocated host port. The entrypoint uses these to assemble VRising's
# `-gamePort` / `-queryPort` launch flags so multiple instances on the
# same agent get distinct, non-colliding sockets.
- { name: game, proto: udp, default: 9876, required: true, env: GAME_PORT }
- { name: query, proto: udp, default: 9877, required: true, env: QUERY_PORT }
resources:
min_ram_mb: 6144
recommended_ram_mb: 12288
# What gets archived when an operator clicks Back-up-now. The save
# directory contains the world (Saves/) and the per-server settings
# (Settings/). The entrypoint regenerates Settings/ from defaults if
# absent, so technically only Saves/ has to be preserved — but operators
# expect their custom server name + password to come back too.
backup:
include:
- "Saves" # world data
- "Settings" # ServerHostSettings.json + ServerGameSettings.json
exclude:
- "logs" # rotates with operator + entrypoint
notes: "World saves + settings (~MB-scale). Game install regenerates from SteamCMD next start."
# Log-derived player events. Regexes converted from CubeCoders'
# AMPTemplates (v-rising.kvp) — .NET (?<n>) syntax -> Go (?P<n>).
# Sourced-from-template; not yet exercised against a live client.
events:
join:
pattern: 'User ''\{Steam (?P<id>\d+)\}'' ''\d+'', approvedUserIndex: \d+, Character: ''(?P<name>[^'']*)'' connected'
kind: join
leave:
pattern: 'User ''\{Steam (?P<id>\d+)\}'' disconnected\. approvedUserIndex: \d+ Reason: (?P<reason>.+)$'
kind: leave
update_providers:
- id: stable
kind: steamcmd
app_id: "1829350"
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: '/\[Server\]\s*Startup Completed/i'
appearance:
emoji: "🧛"
grad: "linear-gradient(135deg,#3b0a0a,#991b1b)"
art: "/game-art/v-rising.jpg"
steam: "1604030"