From 0c2edf6caa7c423e5c274eb8e46d823a66dcb829 Mon Sep 17 00:00:00 2001 From: Thijs van Loef Date: Fri, 19 Jan 2024 19:06:05 +0100 Subject: [PATCH] add env for server_name --- Dockerfile | 3 ++- README.md | 3 ++- docker-compose.yml | 5 +++++ scripts/start.sh | 4 ++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 188a38c5d..d29301a2a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,8 @@ ENV PORT=8211 \ COMMUNITY=false \ PUBLIC_IP= \ PUBLIC_PORT= \ - SERVER_PASSWORD= + SERVER_PASSWORD= \ + SERVER_NAME= COPY ./scripts/* /home/steam/server/ RUN chmod +x /home/steam/server/init.sh /home/steam/server/start.sh diff --git a/README.md b/README.md index c4122435d..f114643ea 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,8 @@ It is highly recommended you set the following environment values before startin | COMMUNITY | Whether or not the server shows up in the community server browser (USE WITH SERVER_PASSWORD) | false | true/false | | PUBLIC_IP | You can manually specify the global IP address of the network on which the server running.If not specified, it will be detected automatically. If it does not work well, try manual configuration. | | x.x.x.x | | PUBLIC_PORT | You can manually specify the port number of the network on which the server running.If not specified, it will be detected automatically. If it does not work well, try manual configuration. | | x.x.x.x | -| SERVER_PASSWORD | Secure your community server with a password | | string | +| SERVER_NAME | A name for your community server | | "string" | +| SERVER_PASSWORD | Secure your community server with a password | | "string" | *highly recommended to set diff --git a/docker-compose.yml b/docker-compose.yml index 836f61936..1c7ecba40 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,5 +11,10 @@ services: - PLAYERS=16 - MULTITHREADING=false - COMMUNITY=false # Enable this if you want your server to show up in the community servers tab, USE WITH SERVER_PASSWORD! + # Enable the environment variables below if you have COMMUNITY=true + # - PUBLIC_PORT=123 + # - PUBLIC_IP=123 + # - SERVER_PASSWORD="worldofpals" + # - SERVER_NAME="World of Pals" volumes: - ./palworld:/palworld/ \ No newline at end of file diff --git a/scripts/start.sh b/scripts/start.sh index 1e1ead1af..5aff8444d 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -16,6 +16,10 @@ if [ -n "${PUBLIC_PORT}" ]; then STARTCOMMAND="${STARTCOMMAND} -publiport=${PUBLIC_PORT}" fi +if [ -n "${SERVER_NAME}" ]; then + STARTCOMMAND="${STARTCOMMAND} -servername=${SERVER_NAME}" +fi + if [ -n "${SERVER_PASSWORD}" ]; then STARTCOMMAND="${STARTCOMMAND} -serverpassword=${SERVER_PASSWORD}" fi