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

Release to master #153

Merged
merged 6 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 16 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ RUN curl -fsSLO "$RCON_URL" \
&& ln -s "/usr/local/bin/${RCON_BINARY}" /usr/local/bin/rconcli \
&& rm -Rf rcon-0.10.3-amd64_linux rcon-0.10.3-amd64_linux.tar.gz

ADD --chown=steam:steam --chmod=755 servermanager.sh /servermanager.sh
ADD --chown=steam:steam --chmod=755 backupmanager.sh /backupmanager.sh
COPY --chown=steam:steam --chmod=755 backupmanager.sh servermanager.sh includes/* /

EXPOSE 8211/udp
EXPOSE 25575/tcp

# Workaround for 'Named Volumes'
RUN mkdir /palworld \
&& chown steam:steam /palworld

Expand All @@ -53,7 +53,7 @@ ADD --chown=steam:steam --chmod=440 rcon.yaml ./rcon.yaml
ENV DEBIAN_FRONTEND=noninteractive \
PUID=1000 \
PGID=1000 \
# Container setttings
### Container-setttings
TZ="Europe/Berlin" \
ALWAYS_UPDATE_ON_START=true \
MULTITHREAD_ENABLED=true \
Expand All @@ -63,8 +63,19 @@ ENV DEBIAN_FRONTEND=noninteractive \
BACKUP_RETENTION_POLICY=false \
BACKUP_RETENTION_AMOUNT_TO_KEEP=30 \
STEAMCMD_VALIDATE_FILES=true \
SERVER_SETTINGS_MODE=auto \
# Server-setting
SERVER_SETTINGS_MODE=manual \
WEBHOOK_ENABLED=false \
WEBHOOK_URL= \
WEBHOOK_START_TITLE="Server is starting" \
WEBHOOK_START_DESCRIPTION="The gameserver is starting" \
WEBHOOK_START_COLOR="2328576" \
WEBHOOK_STOP_TITLE="Server has been stopped" \
WEBHOOK_STOP_DESCRIPTION="The gameserver has been stopped" \
WEBHOOK_STOP_COLOR="7413016" \
WEBHOOK_INFO_TITLE="Info" \
WEBHOOK_INFO_DESCRIPTION="This is an info from the server" \
WEBHOOK_INFO_COLOR="2849520" \
### Server-setting
NETSERVERMAXTICKRATE=120 \
DIFFICULTY=None \
DAYTIME_SPEEDRATE=1.000000 \
Expand Down
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ ___
- [Environment variables](#environment-variables)
- [Docker-Compose examples](#docker-compose-examples)
- [Gameserver with RCON-CLI-Tool](#gameserver-with-rcon-cli-tool)
- [Run RCON commands](#run-rcon-commands)
- [Run RCON commands](#run-rcon-commands)
- [Webhook integration](#webhook-integration)
- [Supported events](#supported-events)
- [FAQ](#faq)
- [How can I use the interactive console in Portainer with this image?](#how-can-i-use-the-interactive-console-in-portainer-with-this-image)
- [How can I look into the config of my Palworld container?](#how-can-i-look-into-the-config-of-my-palworld-container)
- [Im seeing S\_API errors in my logs when I start the container?](#im-seeing-s_api-errors-in-my-logs-when-i-start-the-container)
- [Im using Apple silicon type of hardware, can I run this?](#im-using-apple-silicon-type-of-hardware-can-i-run-this)
- [I have changed the BaseCampWorkerMaxNum settings, why are changes un-affected on the server?](#i-have-changed-the-basecampworkermaxnum-settings-why-are-changes-un-affected-on-the-server)
- [I have changed the `BaseCampWorkerMaxNum` settings, why are changes un-affected on the server?](#i-have-changed-the-basecampworkermaxnum-settings-why-are-changes-un-affected-on-the-server)
- [Planned features in the future](#planned-features-in-the-future)
- [Software used](#software-used)

Expand Down Expand Up @@ -80,14 +82,13 @@ To run this Docker image, you need a basic understanding of Docker, Docker-Compo

See [this file](README_ENV.md) for the documentation


## Docker-Compose examples

### Gameserver with RCON-CLI-Tool

See [example docker-compose.yml](docker-compose.yml).

#### Run RCON commands
## Run RCON commands

Open a shell into your container via `docker exec -ti palworld-dedicated-server bash`, then you can run commands against the gameserver via the command `rcon` or `rconcli`
```shell
Expand All @@ -100,6 +101,20 @@ Complete Save
```
> **Important:** Please research the RCON-Commands on the official source: https://tech.palworldgame.com/server-commands

## Webhook integration

To enable webhook integration, you need to set the following environment variables in the `default.env`:

```shell
WEBHOOK_ENABLED=true
WEBHOOK_URL="https://your.webhook.url"
```
After that the server should send messages in a Discord-Compatible way to your webhook.

### Supported events
* Server starting
* Server stopped

## FAQ

### How can I use the interactive console in Portainer with this image?
Expand All @@ -116,7 +131,7 @@ You can try to insert in your docker-compose file this parameter `platform: linu

### I have changed the `BaseCampWorkerMaxNum` settings, why are changes un-affected on the server?

It is a confirm bug, that changing `BaseCampWorkerMaxNum` in the `PalWorldSettings.ini` has no affect on the server. There are tools out there to help with this, like this one: <https://github.com/legoduded/palworld-worldoption>
It is a confirm bug, that changing `BaseCampWorkerMaxNum` in the `PalWorldSettings.ini` has no affect on the server. There are tools out there to help with this, like this one: <https://github.com/legoduded/palworld-worldoptions>

**PLEASE NOTE** that adding `WorldOption.sav` will breaking `PalWorldSetting.ini` and if that happens all the other settings won't be changeable anymore unless that specific tool is used everytime.

Expand Down
20 changes: 8 additions & 12 deletions backupmanager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,17 @@ TIME=$(date +%H-%M-%S)
mkdir -p /palworld/backups
if [[ -n $BACKUP_RETENTION_POLICY ]] && [[ $BACKUP_RETENTION_POLICY == "true" ]]; then
cd /palworld/backups
echo ">>> The Backup retention policy is enabled"
echo "> Keeping latest $BACKUP_RETENTION_AMOUNT_TO_KEEP backups"
echo ">>> The Backup retention policy is enabled - Keeping latest $BACKUP_RETENTION_AMOUNT_TO_KEEP backups"
ls -1t saved-*.tar.gz | tail -n +$(($BACKUP_RETENTION_AMOUNT_TO_KEEP + 1)) | xargs -d '\n' rm -f --
echo ">>> Cleanup finished"
fi
echo ">>> Creating backup"
echo "> Sending message to gameserver"
cd ~/steamcmd/
rconcli "broadcast $TIME-Backup-in-progress"
sleep 1
rconcli 'broadcast Saving...'
rconcli "broadcast $TIME-Saving-in-5-seconds"
sleep 5
rconcli 'save'
rconcli 'broadcast Done...'
sleep 15
# Create backup dir and change into it
rconcli 'broadcast Saving-done'
sleep 1
rconcli 'broadcast Creating-backup'
cd /palworld/Pal
tar cfz /palworld/backups/saved-$DATE.tar.gz Saved/
echo ">>> Done"
cd ~/steamcmd/
rconcli 'broadcast Backup-done'
11 changes: 11 additions & 0 deletions default.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ BACKUP_RETENTION_AMOUNT_TO_KEEP=30
STEAMCMD_VALIDATE_FILES=true
# Change this to manual if you want to edit your configs yourself
SERVER_SETTINGS_MODE=auto
WEBHOOK_ENABLED=false
WEBHOOK_URL="YOUR-URL-IN-HERE"
WEBHOOK_START_TITLE="Server is starting"
WEBHOOK_START_DESCRIPTION="The gameserver is starting"
WEBHOOK_START_COLOR="2328576"
WEBHOOK_STOP_TITLE="Server has been stopped"
WEBHOOK_STOP_DESCRIPTION="The gameserver has been stopped"
WEBHOOK_STOP_COLOR="7413016"
WEBHOOK_INFO_TITLE="Info"
WEBHOOK_INFO_DESCRIPTION="This is an info from the server"
WEBHOOK_INFO_COLOR="2849520"
NETSERVERMAXTICKRATE=120
DIFFICULTY=None
DAYTIME_SPEEDRATE=1.000000
Expand Down
Loading