Skip to content

Commit

Permalink
Fix readme and restart (FIX #1) (#2)
Browse files Browse the repository at this point in the history
Fixes #1 error when tagging the wrong commit on main
  • Loading branch information
thejcpalma authored Feb 13, 2024
2 parents 58cab0d + 72d0cc4 commit 57a28b6
Show file tree
Hide file tree
Showing 9 changed files with 314 additions and 186 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
WEBHOOK_STOP_DESCRIPTION="The gameserver has been stopped" \
WEBHOOK_STOP_COLOR="16711680" \
WEBHOOK_RESTART_TITLE="Server is restarting" \
WEBHOOK_RESTART_DESCRIPTION="The gameserver is restarting" \
WEBHOOK_RESTART_DESCRIPTION="The gameserver is restarting in " \
WEBHOOK_RESTART_COLOR="16750848" \
WEBHOOK_INSTALL_TITLE="Server is being installed" \
WEBHOOK_INSTALL_DESCRIPTION="Server is being installed" \
Expand Down
120 changes: 86 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,27 @@ ___

## Table of Contents

- [Palworld Dedicated Server on Docker](#palworld-dedicated-server-on-docker)
- [Table of Contents](#table-of-contents)
- [What You Need to Get Started](#what-you-need-to-get-started)
- [Server requirements](#server-requirements)
- [Need Support? Here's How!](#need-support-heres-how)
- [Let's Get Started!](#lets-get-started)
- [Environment variables](#environment-variables)
- [Docker-Compose examples](#docker-compose-examples)
- [Run RCON commands](#run-rcon-commands)
- [Backup Manager](#backup-manager)
- [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)
- [I'm 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)
- [I'm using Apple silicon type of hardware, can I run this?](#im-using-apple-silicon-type-of-hardware-can-i-run-this)
- [I changed the `BaseCampWorkerMaxNum` setting, why didn't this update the server?](#i-changed-the-basecampworkermaxnum-setting-why-didnt-this-update-the-server)
- [Software used](#software-used)
- [Major Shoutout](#major-shoutout)
- [License](#license)
- [Table of Contents](#table-of-contents)
- [What You Need to Get Started](#what-you-need-to-get-started)
- [Server requirements](#server-requirements)
- [Need Support? Here's How!](#need-support-heres-how)
- [Let's Get Started!](#lets-get-started)
- [Environment variables](#environment-variables)
- [Docker-Compose](#docker-compose)
- [Restart \& Update](#restart--update)
- [Backup Manager](#backup-manager)
- [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)
- [I'm 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)
- [I'm using Apple silicon type of hardware, can I run this?](#im-using-apple-silicon-type-of-hardware-can-i-run-this)
- [I changed the `BaseCampWorkerMaxNum` setting, why didn't this update the server?](#i-changed-the-basecampworkermaxnum-setting-why-didnt-this-update-the-server)
- [Software used](#software-used)
- [Major Shoutout](#major-shoutout)
- [License](#license)

## What You Need to Get Started

Expand Down Expand Up @@ -81,11 +81,10 @@ Always follow the official [Palworld Dedicated Server Requirements](https://tech

Using this Docker image and have something to share? Here's how:

- **Need Help?** Open a [new issue](https://github.com/username/repo/issues/new). Link to similar issues with #issue-number. Close the issue once resolved.
- **Need Help or Found a Bug?** Open a [new issue](https://github.com/thejcpalma/palworld-dedicated-server-docker/issues/new).

- **Got a Suggestion?** We're all ears! Share your ideas in a [new issue](https://github.com/username/repo/issues/new).
- **Got a Suggestion?** We're all ears! Share your ideas in a [new feature request](https://github.com/thejcpalma/palworld-dedicated-server-docker/issues/new).

- **Found a Bug?** Help us improve by reporting it in a [new issue](https://github.com/username/repo/issues/new).

**Community Guidelines:**

Expand All @@ -98,13 +97,16 @@ Enjoying the project? Give this repo and the [Docker-Hub repository](https://hub

## Let's Get Started!

1. Make a new folder named `game` in your game-server-directory (For example: `/srv/palworld`).
1. Make a new folder named `game` in your game-server-directory (For example: `/srv/palworld`, `/home/user/palworld`).
- This is where the game server files, like configs and savegames, will be stored.
- If you use the default `docker-compose.yml` file, it will create a folder named `palworld` in the same directory as the `docker-compose.yml` file.
2. Set up Port-Forwarding or NAT for the ports mentioned in the Docker-Compose file.
- The default port for the game is `8211` and for RCON is `25575`.
3. Get the latest version of the image by typing `docker pull thejcpalma/palworld-dedicated-server:latest` in your terminal.
4. Download/Copy the [docker-compose.yml](docker-compose.yml) and [default.env](default.env) files.
5. Adjust the `docker-compose.yml` and `default.env` files as you like.
- Check out the [Environment-Variables](#environment-variables) section for more details.
- If you want auto-update and auto-restart features, but not exposing RCON port, just delete the port on the `docker-compose.yml` file.
6. Start the container by typing `docker-compose up -d && docker-compose logs -f` in your terminal.
- Keep an eye on the log. If you don't see any errors, you can close the logs with `ctrl+c`.
7. That's it! Now you can enjoy your game! 🎮😉
Expand All @@ -116,16 +118,50 @@ Enjoying the project? Give this repo and the [Docker-Hub repository](https://hub

## Environment variables

Check out the [ENV_VARS.md](/docs/ENV_VARS.md) file for a detailed list of environment variables.

## Docker-Compose examples
## Docker-Compose

Download/Copy the [docker-compose.yml](docker-compose.yml) and [default.env](default.env) files.

## Restart & Update

## Run RCON commands
You can use the auto restart and auto update feature by setting the `AUTO_RESTART_ENABLED` and `AUTO_RESTART_ENABLED` environment variables to `true`.
Check out the [ENV_VARS.md](/docs/ENV_VARS.md#special-features) for a detailed list of the variables.

> [!NOTE]
> Please research the RCON-Commands on the official source: https://tech.palworldgame.com/server-commands

> [!WARNING]
>
> Manually restarting or updating the server won't show on the docker logs.
> Will only work if RCON is enabled.
>
> Will use default warn time if not specified (update will always use `AUTO_UPDATE_WARN_MINUTES` )
You can also manually restart or update the server.
Usage: `docker exec palworld-dedicated-server restart [warn_time]` or `docker exec palworld-dedicated-server update`

```shell
docker exec palworld-dedicated-server restart 1
>> players online: 0
> No players are online. Restarting the server now...
> RCON: Broadcasted: Server-is-restarting-now!
> RCON: Broadcasted: 00:06:15-Saving-in-5-seconds
> RCON: Broadcasted: Saving-world...
> RCON: Complete Save
> RCON: Broadcasted: Saving-done
> RCON: Broadcasted: Creating-backup
> RCON: Broadcasted: Backup-done
>>> Backup 'saved-20240213_000615.tar.gz' created successfully.
> RCON: Broadcasted: Server-is-shutting-down-now!
> RCON: The server will shut down in 1 seconds. Please prepare to exit the game.
```

```shell
docker exec palworld-dedicated-server update
> The server is up-to-date!
```

> **Restart and update features will always perform a backup before shutting down the server.**

## Backup Manager
Expand All @@ -139,11 +175,11 @@ Enjoying the project? Give this repo and the [Docker-Hub repository](https://hub
Usage: `docker exec palworld-dedicated-server backup [command] [arguments]`

| Command | Argument | Required/Optional | Default Value | Values | Description |
| ------- | ------------------ | ----------------- | --------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| create | N/A | N/A | N/A | N/A | Creates a backup. |
| list | `<number_to_list>` | Optional | N/A | Positive numbers | Lists all backups.<br>If `<number_to_list>` is specified, only the most<br>recent `<number_to_list>` backups are listed. |
| clean | `<number_to_keep>` | Optional | `BACKUP_RETENTION_AMOUNT_TO_KEEP` | Positive numbers | Cleans up backups.<br>If `<number_to_list>` is specified, cleans and keeps<br>the most recent`<number_to_keep>` backups.<br>If not, default to `BACKUP_RETENTION_AMOUNT_TO_KEEP` var |
| Command | Argument | Required/Optional | Default Value | Values | Description |
| ------- | ------------------ | ----------------- | ---------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| create | N/A | N/A | N/A | N/A | Creates a backup. |
| list | `<number_to_list>` | Optional | N/A | Positive integer | Lists all backups.<br>If `<number_to_list>` is specified, only the most<br>recent `<number_to_list>` backups are listed. |
| clean | `<number_to_keep>` | Optional | `BACKUP_AUTO_CLEAN_AMOUNT_TO_KEEP` | Positive integer | Cleans up backups.<br>If `<number_to_keep>` is specified, cleans and keeps<br>the most recent`<number_to_keep>` backups.<br>If not, default to `BACKUP_AUTO_CLEAN_AMOUNT_TO_KEEP` var |

Examples:

Expand All @@ -170,6 +206,20 @@ $ docker exec palworld-dedicated-server backup_list
2024-02-03 03:30:00 | saved-20240203_033000.tar.gz
```

## Run RCON commands

> [!NOTE]
> Please research the RCON-Commands on the official source: https://tech.palworldgame.com/server-commands
Usage: `docker exec palworld-dedicated-server rconcli [command]`
Examples:

```shell
$ docker exec palworld-dedicated-server rconcli ShowPlayers
> RCON: player,playerid,steamid
thejcpalma,1234,5789
```

## Webhook integration

To enable webhook integrations, you need to set the following environment variables in the `default.env`:
Expand All @@ -187,6 +237,8 @@ After enabling the server should send messages in a Discord-Compatible way to yo

- Server starting
- Server stopped
- Server restart
- Server fresh install
- Server updating
- Server updating and validating

Expand Down
40 changes: 25 additions & 15 deletions default.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Container-setttings
# Container-settings
TZ=UTC

# SteamCMD-settings
Expand All @@ -7,38 +7,48 @@ STEAMCMD_VALIDATE_FILES=true

# Auto-update-settings
AUTO_UPDATE_ENABLED=true
AUTO_UPDATE_CRON_EXPRESSION="* * * * *"
AUTO_UPDATE_CRON_EXPRESSION="0 0 * * *" # Every day at midnight
AUTO_UPDATE_WARN_MINUTES=10

# Auto-restart-settings
AUTO_RESTART_ENABLED=true
AUTO_RESTART_WARN_MINUTES=10
AUTO_RESTART_CRON_EXPRESSION="*/5 * * * *"
AUTO_RESTART_CRON_EXPRESSION="0 1 * * *" # Every day at 1am

# Backup-settings
BACKUP_ENABLED=true
BACKUP_CRON_EXPRESSION= 0 * * * *
BACKUP_RETENTION_POLICY=true
BACKUP_RETENTION_AMOUNT_TO_KEEP=72
BACKUP_CRON_EXPRESSION="0 * * * *" # Every hour
BACKUP_AUTO_CLEAN=true
BACKUP_AUTO_CLEAN_AMOUNT_TO_KEEP=72 # Keeps 3 days of backups with default value

# Webhook-settings
# Use this guide colors: https://birdie0.github.io/discord-webhooks-guide/structure/embed/color.html
# Discord colors for reference:
# - Blue: 2849520
# - Yellow: 2849520
# - Orange: 16750848
# - Red: 7413016
# - Green: 2328576
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_START_COLOR="65280"
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"
WEBHOOK_STOP_COLOR="16711680"
WEBHOOK_RESTART_TITLE="Server is restarting"
WEBHOOK_RESTART_DESCRIPTION="The gameserver is restarting in" # Will be appended with the countdown
WEBHOOK_RESTART_COLOR="16750848"
WEBHOOK_INSTALL_TITLE="Server is being installed"
WEBHOOK_INSTALL_DESCRIPTION="Server is being installed"
WEBHOOK_INSTALL_COLOR="1644912"
WEBHOOK_UPDATE_TITLE="Updating server"
WEBHOOK_UPDATE_DESCRIPTION="Server is being updated"
WEBHOOK_UPDATE_COLOR="2849520"
WEBHOOK_UPDATE_VALIDATION_TITLE="Updating and validating server"
WEBHOOK_UPDATE_VALIDATION_DESCRIPTION="Server is being updated and validated"
WEBHOOK_UPDATE_VALIDATION_COLOR="2849520"
WEBHOOK_UPDATE_COLOR="16776960"
WEBHOOK_UPDATE_VALIDATE_TITLE="Updating and validating server"
WEBHOOK_UPDATE_VALIDATE_DESCRIPTION="Server is being updated and validated"
WEBHOOK_UPDATE_VALIDATE_COLOR="16776960"

# Gameserver-start-settings
MULTITHREAD_ENABLED=true
Expand Down
Loading

0 comments on commit 57a28b6

Please sign in to comment.