From f4f7e6616d16fbbd27dc7957a814d0dd7abc2e51 Mon Sep 17 00:00:00 2001 From: Twinki Date: Fri, 19 Jan 2024 16:05:51 -0500 Subject: [PATCH 1/2] Add ADMIN_PASSWORD env variable # Motivations Being able to configure the admin password would be quite helpful # Modifications - Add `ADMIN_PASSWORD` to the list of environment variables, which adds `--adminpassword` to the server arguments --- .gitattributes | 2 ++ Dockerfile | 2 +- README.md | 6 ++++-- docker-compose.yml | 1 + scripts/start.sh | 4 ++++ 5 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..d8c6dc6cf --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Ensure the scripts use LF line endings, not CRLF +*.sh text eol=lf \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 1939964e2..ec89bde45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* - ENV PORT=8211 \ PLAYERS=16 \ MULTITHREADING=false \ @@ -15,6 +14,7 @@ ENV PORT=8211 \ PUBLIC_PORT= \ SERVER_PASSWORD= \ SERVER_NAME= \ + ADMIN_PASSWORLD= \ UPDATE_ON_BOOT=true COPY ./scripts/* /home/steam/server/ diff --git a/README.md b/README.md index 396fb79be..94311d4cb 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ It is highly recommended you set the following environment values before startin * MULTITHREADING | Variable | Info | Default Values | Allowed Values | -|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|----------------| +| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | -------------- | | PLAYERS* | Max amount of players that are able to join the server | 16 | 1-31 | | PORT* | UDP port that the server will expose | 8211 | 1024-65535 | | MULTITHREADING** | Improves performance in multi-threaded CPU environments. It is effective up to a maximum of about 4 threads, and allocating more than this number of threads does not make much sense. | false | true/false | @@ -75,8 +75,10 @@ It is highly recommended you set the following environment values before startin | 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_NAME | A name for your community server | | "string" | | SERVER_PASSWORD | Secure your community server with a password | | "string" | +| ADMIN_PASSWORD | Secure administration access in the server with a password | | "string" | | UPDATE_ON_BOOT** | Update/Install the server when the docker container starts (THIS HAS TO BE ENABLED THE FIRST TIME YOU RUN THE CONTAINER) | true | true/false | + *highly recommended to set ** Make sure you know what you are doing when running this this option enabled @@ -84,7 +86,7 @@ It is highly recommended you set the following environment values before startin ### Game Ports | Port | Info | note | -|-------|------------------|------------------------------------------------| +| ----- | ---------------- | ---------------------------------------------- | | 8211 | Game Port (UDP) | | | 27015 | Query Port (UDP) | You are not able to change this port as of now | diff --git a/docker-compose.yml b/docker-compose.yml index 80d2b5f5d..241e26c0c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,5 +15,6 @@ services: # Enable the environment variables below if you have COMMUNITY=true # - SERVER_PASSWORD="worldofpals" # - SERVER_NAME="World of Pals" + # - ADMIN_PASSWORD="someAdminPassword" volumes: - ./palworld:/palworld/ \ No newline at end of file diff --git a/scripts/start.sh b/scripts/start.sh index 5aff8444d..b3b1c72af 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -24,6 +24,10 @@ if [ -n "${SERVER_PASSWORD}" ]; then STARTCOMMAND="${STARTCOMMAND} -serverpassword=${SERVER_PASSWORD}" fi +if [ -n "${ADMIN_PASSWORD}" ]; then + STARTCOMMAND="${STARTCOMMAND} -adminpassword=${ADMIN_PASSWORD}" +fi + if [ "${MULTITHREADING}" = true ]; then STARTCOMMAND="${STARTCOMMAND} -useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS" fi From 00385a254c26113e731a94ee80c1feecd78eaabe Mon Sep 17 00:00:00 2001 From: Thijs van Loef Date: Fri, 19 Jan 2024 22:18:31 +0100 Subject: [PATCH 2/2] fix typo --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ec89bde45..be1bd3e72 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ ENV PORT=8211 \ PUBLIC_PORT= \ SERVER_PASSWORD= \ SERVER_NAME= \ - ADMIN_PASSWORLD= \ + ADMIN_PASSWORD= \ UPDATE_ON_BOOT=true COPY ./scripts/* /home/steam/server/