Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge work to master #7

Merged
merged 24 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
41da931
Auto-merge master back to dev
actions-user Feb 19, 2024
1e48cf7
Fixes #215 #214 - Fixed 3 CVEs via Docker-Multi-Stage building, also …
jammsen Feb 21, 2024
ed9c3a4
Merge branch 'develop' of github.com:jammsen/docker-palworld-dedicate…
jammsen Feb 21, 2024
1c1062c
added gosu-amd64 binary
jammsen Feb 21, 2024
23b4243
Update gosu-amd64 binary
jammsen Feb 21, 2024
57e8466
Cleanup Dockerfile - removed gosuverify-multistage
jammsen Feb 21, 2024
55e4462
Added changelogs
jammsen Feb 21, 2024
d005e4c
Merge pull request #217 from jammsen/develop
jammsen Feb 21, 2024
716fcf6
Auto-merge master back to dev
actions-user Feb 21, 2024
7b6bbe5
fixes #216 - Added player-detection function
jammsen Feb 22, 2024
009aa9a
Merge branch 'develop' of github.com:jammsen/docker-palworld-dedicate…
jammsen Feb 22, 2024
70fd12a
Merge pull request #220 from jammsen/develop
jammsen Feb 22, 2024
57660b8
Auto-merge master back to dev
actions-user Feb 22, 2024
4b71cc3
Bugfix for player-detection, auto-restart doesnt fully stop the conta…
jammsen Feb 22, 2024
239fddc
Merge branch 'develop' of github.com:jammsen/docker-palworld-dedicate…
jammsen Feb 22, 2024
38b5efb
Merge pull request #222 from jammsen/develop
jammsen Feb 22, 2024
71d8cb3
Auto-merge master back to dev
actions-user Feb 22, 2024
9a8c232
Merge branch 'develop' into work
ripps818 Feb 23, 2024
dffe74b
Update Dockerfile
ripps818 Feb 23, 2024
0b56bae
Update Dockerfile
ripps818 Feb 23, 2024
945420a
Attempt to fix player detection pid file permission
ripps818 Feb 23, 2024
4d23bcc
More messing with locales in dockerfile
ripps818 Feb 23, 2024
3d89448
Update Dockerfile
ripps818 Feb 23, 2024
9fd7e19
Update docker-build.sh
ripps818 Feb 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 41 additions & 32 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,60 @@

[Back to main](README.md#changelog)

## 2024-02-22

- Added RCON-Based player detection, for join and leave messages on console, rcon-broadcast and webhooks (#216)
- Important change: RCON is now on by default, was false in the Dockerfile before, not considered a breaking change

## 2024-02-21

- Fixed major CVEs and added re-compiled gosu-amd64 binary to the repository (#214 #215)

## 2024-02-19

* Added 15 seconds delay after save before backup (#209)
* Changed standard RESTART_CRON_EXPRESSION to only once a day at 6pm
* Cause less illnesses on Pals that way
- Added 15 seconds delay after save before backup (#209)
- Changed standard RESTART_CRON_EXPRESSION to only once a day at 6pm
- Cause less illnesses on Pals that way

## 2024-02-17

* Forked by Ripps and converted to Windows wine version.

## 2024-02-13

* Added the option to enable webhook curl debugging for weird error edge-cases
- Added the option to enable webhook curl debugging for weird error edge-cases

## 2024-02-13
* **Breaking changes:**
* Changed the default BACKUP_RETENTION_POLICY to true and changed BACKUP_RETENTION_AMOUNT_TO_KEEP to 72, meaning 3 days worth of backup are kept in the default configuration
* Added the ability to change the PUID and PGID via environment variables (#117)
* This includes a user-process-jail mechanic including entrypoint-script, which makes sure that the gameserver is always working with the right permissions as only user steam and not root by accident or bug
* Mayor refactoring of the code-base to enable more feature requests based around automatic restarts and such. This includes:
* Adding new backupmanager
* Adding color-based echos and feedback-signals by color
* New structure and comments of Dockerfile environment variables
* New structure and comments of default.env template
* Added shell linting
* Fixed cron duplication (#169)
* Changed structure of the project and where files like documentation, includes, scripts and config-templates are to find
* Fixed typos in various documents
* Added multicore-bugfix, now multi-core-enhancment should be working (#190)
* Removed sensitive information from the servermanger logs (#194)
* Changed to always copy DefaultPalWorldSettings.ini at start mechanic (#195)
* Updated outdated Pocketpair documentation links
* Added automatic-restart-cron functionality (#50 #71 #139)
* Extended webhook usage (#120)
* Requirements - What you need to do:
* **Read the readme, a lot has changed, there is a new part about the backupmanager and how to interact now with rconcli**
* Update to latest image
* Download new docker-compose.yml and new default.env
* Merge your settings and make sure that backup-settings, PGID and PUID are right
- **Breaking changes:**
- Changed the default BACKUP_RETENTION_POLICY to true and changed BACKUP_RETENTION_AMOUNT_TO_KEEP to 72, meaning 3 days worth of backup are kept in the default configuration
- Added the ability to change the PUID and PGID via environment variables (#117)
- This includes a user-process-jail mechanic including entrypoint-script, which makes sure that the gameserver is always working with the right permissions as only user steam and not root by accident or bug
- Mayor refactoring of the code-base to enable more feature requests based around automatic restarts and such. This includes:
- Adding new backupmanager
- Adding color-based echos and feedback-signals by color
- New structure and comments of Dockerfile environment variables
- New structure and comments of default.env template
- Added shell linting
- Fixed cron duplication (#169)
- Changed structure of the project and where files like documentation, includes, scripts and config-templates are to find
- Fixed typos in various documents
- Added multicore-bugfix, now multi-core-enhancment should be working (#190)
- Removed sensitive information from the servermanger logs (#194)
- Changed to always copy DefaultPalWorldSettings.ini at start mechanic (#195)
- Updated outdated Pocketpair documentation links
- Added automatic-restart-cron functionality (#50 #71 #139)
- Extended webhook usage (#120)
- Requirements - What you need to do:
- **Read the readme, a lot has changed, there is a new part about the backupmanager and how to interact now with rconcli**
- Update to latest image
- Download new docker-compose.yml and new default.env
- Merge your settings and make sure that backup-settings, PGID and PUID are right

## 2024-02-03

* Added changes to shutdown-webhook notifications (#120)
* Added rcon.sh again for having alias function calls that do not bloat the servermanager
* Refactored how webhook messages function are called and added alias functions
* Added a changelog, from various request resources
- Added changes to shutdown-webhook notifications (#120)
- Added rcon.sh again for having alias function calls that do not bloat the servermanager
- Refactored how webhook messages function are called and added alias functions
- Added a changelog, from various request resources

[Back to main](README.md#changelog)
166 changes: 92 additions & 74 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,41 @@
FROM --platform=linux/amd64 ubuntu:latest
FROM golang:1.22.0-bookworm as rconclibuilder

WORKDIR /build

ENV CGO_ENABLED=0 \
GORCON_RCONCLI_URL=https://github.com/gorcon/rcon-cli/archive/refs/tags/v0.10.3.tar.gz \
GORCON_RCONCLI_DIR=rcon-cli-0.10.3 \
GORCON_RCONCLI_TGZ=v0.10.3.tar.gz \
GORCON_RCONCLI_TGZ_SHA1SUM=33ee8077e66bea6ee097db4d9c923b5ed390d583

RUN curl -fsSLO "$GORCON_RCONCLI_URL" \
&& echo "${GORCON_RCONCLI_TGZ_SHA1SUM} ${GORCON_RCONCLI_TGZ}" | sha1sum -c - \
&& tar -xzf "$GORCON_RCONCLI_TGZ" \
&& mv "$GORCON_RCONCLI_DIR"/* ./ \
&& rm "$GORCON_RCONCLI_TGZ" \
&& rm -Rf "$GORCON_RCONCLI_DIR" \
&& go build -v ./cmd/gorcon

FROM debian:bookworm-slim as supercronicverify

# Latest releases available at https://github.com/aptible/supercronic/releases
ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.2.29/supercronic-linux-amd64 \
SUPERCRONIC=supercronic-linux-amd64 \
SUPERCRONIC_SHA1SUM=cd48d45c4b10f3f0bfdd3a57d054cd05ac96812b

RUN apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests ca-certificates curl \
&& apt-get autoremove -y --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN curl -fsSLO "$SUPERCRONIC_URL" \
&& echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \
&& chmod +x "$SUPERCRONIC" \
&& mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \
&& ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic

FROM --platform=linux/amd64 debian:bookworm-slim

#LABEL maintainer="Sebastian Schmidt - https://github.com/jammsen/docker-palworld-dedicated-server"
#LABEL org.opencontainers.image.authors="Sebastian Schmidt"
Expand All @@ -13,19 +50,19 @@ ENV DEBIAN_FRONTEND=noninteractive \
# Path-vars
GAME_ROOT="/palworld" \
GAME_PATH="/palworld/Pal" \
GAME_BIN="/palworld/Pal/Binaries/Win64/PalServer-Win64-Test-Cmd.exe" \
GAME_SAVE_PATH="/palworld/Pal/Saved" \
GAME_CONFIG_PATH="/palworld/Pal/Saved/Config/WindowsServer" \
GAME_SETTINGS_FILE="/palworld/Pal/Saved/Config/WindowsServer/PalWorldSettings.ini" \
GAME_ENGINE_FILE="/palworld/Pal/Saved/Config/WindowsServer/Engine.ini" \
GAME_CONFIG_PATH="/palworld/Pal/Saved/Config/LinuxServer" \
GAME_SETTINGS_FILE="/palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini" \
GAME_ENGINE_FILE="/palworld/Pal/Saved/Config/LinuxServer/Engine.ini" \
STEAMCMD_PATH="/home/steam/steamcmd" \
RCON_CONFIG_FILE="/home/steam/steamcmd/rcon.yaml" \
BACKUP_PATH="/palworld/backups" \
WINE_BIN="/usr/bin/wine" \
# Container-setttings
PUID=1000 \
PGID=1000 \
TZ="Europe/Berlin" \
GAME_BIN="/palworld/Pal/Binaries/Win64/PalServer-Win64-Test-Cmd.exe" \
WINE_BIN="/usr/bin/wine" \
WINETRICK_ON_START=true \
WINEPREFIX=/home/steam/.wine \
WINEARCH=win64 \
Expand All @@ -43,9 +80,13 @@ ENV DEBIAN_FRONTEND=noninteractive \
BACKUP_RETENTION_POLICY=true \
BACKUP_RETENTION_AMOUNT_TO_KEEP=72 \
# Restart-settings
RESTART_ENABLED=false \
RESTART_COUNTDOWN=15 \
RESTART_ENABLED=false \
RESTART_CRON_EXPRESSION="0 18 * * *" \
# RCON-Playerdection - NEEDS RCON ENABLED!
RCON_PLAYER_DETECTION=true \
RCON_PLAYER_DETECTION_STARTUP_DELAY=60 \
RCON_PLAYER_DETECTION_CHECK_INTERVAL=15 \
# Webhook-settings
WEBHOOK_ENABLED=false \
WEBHOOK_DEBUG_ENABLED=false \
Expand All @@ -71,7 +112,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
# Config-setting - Warning: Every setting below here will be affected!
SERVER_SETTINGS_MODE=manual \
# Gameserver-start-settings
MULTITHREAD_ENABLED=false \
MULTITHREAD_ENABLED=true \
COMMUNITY_SERVER=true \
# Engine.ini settings
NETSERVERMAXTICKRATE=120 \
Expand Down Expand Up @@ -128,12 +169,12 @@ ENV DEBIAN_FRONTEND=noninteractive \
COOP_PLAYER_MAX_NUM=4 \
MAX_PLAYERS=32 \
SERVER_NAME="wine-docker-generated-###RANDOM###" \
SERVER_DESCRIPTION="Palworld-Dedicated-Server running in Docker by jammsen" \
SERVER_DESCRIPTION="Palworld-Wine-Server running in Docker by jammsen and ripps" \
ADMIN_PASSWORD=adminPasswordHere \
SERVER_PASSWORD=serverPasswordHere \
PUBLIC_PORT=8211 \
PUBLIC_IP= \
RCON_ENABLED=false \
RCON_ENABLED=true \
RCON_PORT=25575 \
REGION= \
USEAUTH=true \
Expand All @@ -143,92 +184,69 @@ EXPOSE 8211/udp
EXPOSE 25575/tcp
EXPOSE 27015/tcp

# Install minimum required packages for dedicated server and wine
RUN DEBIAN_FRONTEND="noninteractive" apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests \
apt-transport-https \
gosu \
# Install minimum required packages for dedicated server
COPY --from=rconclibuilder /build/gorcon /usr/local/bin/rcon
COPY --from=supercronicverify /usr/local/bin/supercronic /usr/local/bin/supercronic

RUN apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
procps \
xdg-user-dirs \
ca-certificates \
cabextract \
tzdata \
git \
locales \
gnupg \
p7zip \
tzdata \
unzip \
sed \
wget\
curl \
wget \
winbind \
xvfb \
zenity \
&& apt-get autoremove -y --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
unzip \
winbind \
ca-certificates \
cabextract \
gnupg \
xvfb \
zenity \
tzdata

# Configure locale
RUN echo "LANG=US.UTF-8" >/etc/default/locale && \
dpkg-reconfigure --frontend=noninteractive locales

# Install wine
ARG WINE_BRANCH="stable"
RUN wget -nv -O- https://dl.winehq.org/wine-builds/winehq.key | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb https://dl.winehq.org/wine-builds/ubuntu/ $(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2) main" >> /etc/apt/sources.list \
&& dpkg --add-architecture i386 \
&& apt-get update \
&& DEBIAN_FRONTEND="noninteractive" apt-get install -y --install-recommends winehq-${WINE_BRANCH} \
&& rm -rf /var/lib/apt/lists/*

# Install winetricks
RUN wget -nv -O /usr/bin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks \
&& chmod +x /usr/bin/winetricks
RUN dpkg --add-architecture i386 && \
mkdir -pm755 /etc/apt/keyrings && \
wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key && \
wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources && \
apt-get update
RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y --install-recommends winehq-${WINE_BRANCH}

# Latest releases available at https://github.com/aptible/supercronic/releases
ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.2.29/supercronic-linux-amd64 \
SUPERCRONIC=supercronic-linux-amd64 \
SUPERCRONIC_SHA1SUM=cd48d45c4b10f3f0bfdd3a57d054cd05ac96812b

RUN curl -fsSLO "${SUPERCRONIC_URL}" \
&& echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \
&& chmod +x "$SUPERCRONIC" \
&& mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \
&& ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic

# Latest releases available at https://github.com/gorcon/rcon-cli/releases
ENV RCON_URL=https://github.com/gorcon/rcon-cli/releases/download/v0.10.3/rcon-0.10.3-amd64_linux.tar.gz \
RCON_TGZ=rcon-0.10.3-amd64_linux.tar.gz \
RCON_TGZ_MD5SUM=8601c70dcab2f90cd842c127f700e398 \
RCON_BINARY=rcon

RUN curl -fsSLO "$RCON_URL" \
&& echo "${RCON_TGZ_MD5SUM} ${RCON_TGZ}" | md5sum -c - \
&& tar xfz rcon-0.10.3-amd64_linux.tar.gz \
&& chmod +x "rcon-0.10.3-amd64_linux/$RCON_BINARY" \
&& mv "rcon-0.10.3-amd64_linux/$RCON_BINARY" "/usr/local/bin/${RCON_BINARY}" \
&& rm -Rf rcon-0.10.3-amd64_linux rcon-0.10.3-amd64_linux.tar.gz
# Install Windows version of SteamCmd
ENV STEAMCMD_URL="http://media.steampowered.com/installer/steamcmd.zip"
RUN mkdir -p ${STEAMCMD_PATH}
RUN curl -fsSLO "$STEAMCMD_URL" && \
unzip steamcmd.zip -d ${STEAMCMD_PATH} && \
rm -rf steamcmd.zip

# Configure locale for unicode
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
# Clean apt
RUN apt purge -y wget curl \
&& apt-get autoremove -y --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Setup User/Group
RUN groupadd --gid $PGID steam && \
useradd --uid $PUID --gid $PGID -M steam

# Install Windows version of SteamCmd
ENV STEAMCMD_URL="http://media.steampowered.com/installer/steamcmd.zip"
RUN mkdir -p ${STEAMCMD_PATH}
RUN curl -fsSLO "$STEAMCMD_URL" && \
unzip steamcmd.zip -d ${STEAMCMD_PATH} && \
rm -rf steamcmd.zip

COPY --chmod=755 entrypoint.sh /
COPY --chmod=755 scripts/ /scripts
COPY --chmod=755 includes/ /includes
COPY --chmod=755 configs/rcon.yaml /home/steam/steamcmd/rcon.yaml
COPY --chmod=755 gosu-amd64 /usr/local/bin/gosu

RUN mkdir -p "$BACKUP_PATH" \
&& ln -s /scripts/backupmanager.sh /usr/local/bin/backup \
&& ln -s /scripts/rconcli.sh /usr/local/bin/rconcli \
&& ln -s /scripts/restart.sh /usr/local/bin/restart
&& ln -s /scripts/restart.sh /usr/local/bin/restart \
&& gosu --version \
&& gosu nobody true

VOLUME ["${GAME_ROOT}"]

Expand Down
4 changes: 4 additions & 0 deletions default.env
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ BACKUP_RETENTION_AMOUNT_TO_KEEP=72
RESTART_ENABLED=false
RESTART_COUNTDOWN=15
RESTART_CRON_EXPRESSION="0 18 * * *"
# RCON-Playerdection - NEEDS RCON ENABLED!
RCON_PLAYER_DETECTION=true
RCON_PLAYER_DETECTION_STARTUP_DELAY=60
RCON_PLAYER_DETECTION_CHECK_INTERVAL=15
# Webhook-settings
WEBHOOK_ENABLED=false
WEBHOOK_DEBUG_ENABLED=false
Expand Down
2 changes: 2 additions & 0 deletions docker-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
docker build "$@" --tag=ripps818/palworld-dedicated-server-wine:latest .
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ networks:

services:
palworld-dedicated-server:
#build: .
container_name: palworld-wine-server
image: ripps818/palworld-dedicated-server-wine:latest
restart: unless-stopped
Expand Down
Loading
Loading