Panel — public source drop (v0.9.0)
Self-hostable game-server control panel: controller + agent + 26 game modules. One-line install (prebuilt release, no Go required): curl -fsSL https://git.pdxtechs.com/dbledeez/panel/raw/branch/main/install.sh | sudo bash Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
# panel-native Project Zomboid runtime image.
|
||||
FROM debian:12-slim
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive \
|
||||
TZ=Etc/UTC \
|
||||
LANG=en_US.UTF-8 \
|
||||
LC_ALL=en_US.UTF-8
|
||||
|
||||
# PZ's start-server.sh expects Java 17+. Debian 12's default-jre is 17.
|
||||
RUN dpkg --add-architecture i386 \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
locales \
|
||||
tini \
|
||||
default-jre-headless \
|
||||
lib32gcc-s1 \
|
||||
lib32stdc++6 \
|
||||
libc6:i386 \
|
||||
&& 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
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
EXPOSE 16261/udp 16262/udp 27015/tcp
|
||||
|
||||
ENTRYPOINT ["/usr/bin/tini", "--", "/entrypoint.sh"]
|
||||
@@ -0,0 +1,93 @@
|
||||
#!/bin/bash
|
||||
# panel-native Project Zomboid entrypoint.
|
||||
set -euo pipefail
|
||||
log() { printf '[panel-pz] %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=/game-saves PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
|
||||
SERVER_NAME="${SERVER_NAME:-panel}" \
|
||||
ADMIN_PASSWORD="${ADMIN_PASSWORD:-changeme}" \
|
||||
RCON_PASSWORD="${RCON_PASSWORD:-panel_rcon}" \
|
||||
MEMORY="${MEMORY:-4096m}" \
|
||||
GAME_PORT="${GAME_PORT:-16261}" \
|
||||
GAME_PORT_B="${GAME_PORT_B:-16262}" \
|
||||
RCON_PORT="${RCON_PORT:-27015}" \
|
||||
/entrypoint.sh "$@"
|
||||
fi
|
||||
|
||||
GAME_DIR=/game
|
||||
SAVE_DIR=/game-saves
|
||||
START_SH="${GAME_DIR}/start-server.sh"
|
||||
|
||||
if [[ ! -x "${START_SH}" ]]; then
|
||||
log "ERROR: ${START_SH} not found. Run 'Update' in the panel to install Project Zomboid via SteamCMD."
|
||||
exit 78
|
||||
fi
|
||||
|
||||
# PZ writes world data + per-server config under $HOME/Zomboid (Linux) by
|
||||
# default. HOME is already /game-saves via setpriv; pre-create subdirs.
|
||||
mkdir -p "${SAVE_DIR}/Zomboid/Server" "${SAVE_DIR}/Zomboid/Saves"
|
||||
|
||||
# Per-server config at ~/Zomboid/Server/<SERVER_NAME>.ini. Seed on first
|
||||
# boot, then ALWAYS enforce the panel-allocated ports + RCON creds so a
|
||||
# recreate with new ports never leaves stale values in an existing ini.
|
||||
CFG="${SAVE_DIR}/Zomboid/Server/${SERVER_NAME}.ini"
|
||||
if [[ ! -s "${CFG}" ]]; then
|
||||
log "seeding ${CFG}"
|
||||
cat > "${CFG}" <<EOF
|
||||
PublicName=${SERVER_NAME}
|
||||
Public=false
|
||||
MaxPlayers=16
|
||||
PVP=true
|
||||
Pause=false
|
||||
PauseEmpty=true
|
||||
AutoCreateUserInWhiteList=false
|
||||
Open=true
|
||||
ServerWelcomeMessage=Running on panel
|
||||
UPnP=false
|
||||
EOF
|
||||
fi
|
||||
|
||||
# set_ini KEY VALUE — replace-or-append into ${CFG}.
|
||||
set_ini() {
|
||||
local key="$1" val="$2"
|
||||
if grep -q "^${key}=" "${CFG}"; then
|
||||
sed -i "s|^${key}=.*|${key}=${val}|" "${CFG}"
|
||||
else
|
||||
printf '%s=%s\n' "${key}" "${val}" >> "${CFG}"
|
||||
fi
|
||||
}
|
||||
set_ini DefaultPort "${GAME_PORT}"
|
||||
set_ini UDPPort "${GAME_PORT_B}"
|
||||
set_ini RCONPort "${RCON_PORT}"
|
||||
set_ini RCONPassword "${RCON_PASSWORD}"
|
||||
set_ini UPnP "false"
|
||||
|
||||
# JVM heap: start-server.sh reads vmArgs from ProjectZomboid64.json (the
|
||||
# MEMORY env is NOT read by the stock script) — patch the -Xmx entry.
|
||||
PZ_JSON="${GAME_DIR}/ProjectZomboid64.json"
|
||||
if [[ -f "${PZ_JSON}" ]]; then
|
||||
sed -i "s|-Xmx[0-9]*[kmgKMG]\?|-Xmx${MEMORY}|" "${PZ_JSON}" || true
|
||||
fi
|
||||
|
||||
cd "${GAME_DIR}"
|
||||
log "starting Project Zomboid dedicated server"
|
||||
log " servername: ${SERVER_NAME}"
|
||||
log " heap: ${MEMORY}"
|
||||
log " ports: game=${GAME_PORT}/udp direct=${GAME_PORT_B}/udp rcon=${RCON_PORT}/tcp"
|
||||
|
||||
# start-server.sh forwards program args to zombie.network.GameServer.
|
||||
# -port/-udpport mirror the ini keys (AMP passes the same pair).
|
||||
# -cachedir is REQUIRED: pzexe derives its data dir from the passwd home
|
||||
# (/home/panel), NOT $HOME — without it the ini/saves silently land inside
|
||||
# the container layer and the seeded ini above is never read (confirmed:
|
||||
# 'cachedir set to "/home/panel/Zomboid"' on first smoke boot).
|
||||
exec stdbuf -oL -eL "${START_SH}" \
|
||||
"-cachedir=${SAVE_DIR}/Zomboid" \
|
||||
-servername "${SERVER_NAME}" \
|
||||
-adminpassword "${ADMIN_PASSWORD}" \
|
||||
-port "${GAME_PORT}" \
|
||||
-udpport "${GAME_PORT_B}"
|
||||
@@ -0,0 +1,120 @@
|
||||
# Project Zomboid — panel-native dedicated server module.
|
||||
#
|
||||
# Native Linux binary from SteamCMD app 380870. Java-heavy; the shipped
|
||||
# start-server.sh wraps java with correct -cp and Dpzexe.* system props.
|
||||
# Has Source-compatible RCON on port 27015 when enabled in server.ini.
|
||||
#
|
||||
# Reference: https://github.com/CubeCoders/AMPTemplates (ProjectZomboid.kvp)
|
||||
|
||||
id: project-zomboid
|
||||
name: "Project Zomboid"
|
||||
version: 0.1.0
|
||||
authors:
|
||||
- panel contributors
|
||||
|
||||
supported_modes:
|
||||
- docker
|
||||
|
||||
runtime:
|
||||
docker:
|
||||
image: panel-project-zomboid: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: "Server configs + world saves under ~/Zomboid"
|
||||
- name: "Game Files"
|
||||
path: /game
|
||||
hint: "PZ install, binaries"
|
||||
env:
|
||||
SERVER_NAME: "panel" # used as name of server folder under ~/Zomboid/Server
|
||||
ADMIN_PASSWORD: "changeme"
|
||||
RCON_PASSWORD: "panel_rcon"
|
||||
MEMORY: "4096m" # JVM heap
|
||||
# Pre-declared so the agent's resolve.go filter lets panel-allocated
|
||||
# ports flow through to the container env. The entrypoint passes
|
||||
# -port/-udpport launch args AND enforces the matching ini keys;
|
||||
# without these the server binds the hardcoded 16261/16262/27015 and
|
||||
# ignores the panel allocation (breaks multi-instance + opnfwd).
|
||||
GAME_PORT: "16261"
|
||||
GAME_PORT_B: "16262"
|
||||
RCON_PORT: "27015"
|
||||
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: 16261, required: true, env: GAME_PORT }
|
||||
- { name: gameB, proto: udp, default: 16262, required: true, env: GAME_PORT_B }
|
||||
- { name: rcon, proto: tcp, default: 27015, internal: true, env: RCON_PORT }
|
||||
|
||||
resources:
|
||||
min_ram_mb: 4096
|
||||
recommended_ram_mb: 8192
|
||||
|
||||
# Per-instance generated RCON secret. The agent generates a random
|
||||
# 24-byte token at create time (pkg/module GenerateSecrets), which
|
||||
# overrides the env default for RCON_PASSWORD below — so every instance
|
||||
# gets a unique password. The weak env default only applies to
|
||||
# containers launched outside the panel.
|
||||
secrets:
|
||||
- name: RCON_PASSWORD
|
||||
description: "Project Zomboid RCON password — generated per instance"
|
||||
generated: true
|
||||
|
||||
rcon:
|
||||
adapter: source_rcon
|
||||
host_port: rcon
|
||||
auth: source_rcon_login
|
||||
password_secret: RCON_PASSWORD
|
||||
# Legacy fallback only (pre-generated-secret instances). New instances
|
||||
# always get the generated RCON_PASSWORD secret above.
|
||||
password_literal: "panel_rcon"
|
||||
commands:
|
||||
list: "players"
|
||||
save: "save"
|
||||
kick: "kickuser {player}"
|
||||
ban: "banuser {player}"
|
||||
broadcast: "servermsg \"{msg}\""
|
||||
|
||||
state_sources:
|
||||
- type: rcon
|
||||
command: "players"
|
||||
every: 60s
|
||||
parse:
|
||||
kind: regex
|
||||
pattern: 'Players connected \((?P<count>\d+)\)'
|
||||
fields:
|
||||
players_online: count
|
||||
|
||||
events:
|
||||
join:
|
||||
pattern: "(?P<name>\\S+) connected with ip"
|
||||
kind: join
|
||||
leave:
|
||||
pattern: "(?P<name>\\S+) disconnected"
|
||||
kind: leave
|
||||
|
||||
update_providers:
|
||||
- id: stable
|
||||
kind: steamcmd
|
||||
app_id: "380870"
|
||||
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.
|
||||
# Confirmed on smoke boot 2026-07-14: 'LOG : Network ... > *** SERVER STARTED ****'
|
||||
ready_pattern: '/\*+ SERVER STARTED \*+/'
|
||||
appearance:
|
||||
emoji: "🧟"
|
||||
grad: "linear-gradient(135deg,#6a4c1e,#b89040)"
|
||||
steam: "108600"
|
||||
Reference in New Issue
Block a user