Compare commits

...

45 Commits

Author SHA1 Message Date
6f8db928de scripts/start-server.sh aktualisiert 2024-04-04 08:40:47 +02:00
1a6290534c scripts/start-server.sh aktualisiert 2024-04-04 08:17:10 +02:00
68152ca356 README.md aktualisiert 2024-02-28 09:39:02 +01:00
db74d62640 README.md aktualisiert 2024-02-27 19:11:48 +01:00
0d0f16b9cc README.md aktualisiert 2024-02-01 22:43:12 +01:00
1f4c77e2d0 scripts/start-server.sh aktualisiert 2024-01-25 22:11:08 +01:00
43e697ea9b Dockerfile aktualisiert 2024-01-25 22:02:49 +01:00
d5dbbde762 Dockerfile aktualisiert 2024-01-25 14:56:48 +01:00
f38604010f README.md aktualisiert 2024-01-25 14:47:47 +01:00
1bead6d59b Dockerfile aktualisiert 2024-01-25 14:44:14 +01:00
e75fa0af14 scripts/start-server.sh aktualisiert 2024-01-25 14:42:54 +01:00
03db5b8785 scripts/start-backup.sh hinzugefügt 2024-01-25 14:40:38 +01:00
2696215232 README.md aktualisiert 2024-01-23 08:12:53 +01:00
f442dfe4f6 Dockerfile aktualisiert 2024-01-23 08:12:32 +01:00
4b531c2cc9 README.md aktualisiert 2024-01-19 19:59:26 +01:00
1951012725 scripts/start.sh aktualisiert 2024-01-19 12:53:26 +01:00
1c9ea06ec5 scripts/start-server.sh aktualisiert 2024-01-19 12:47:27 +01:00
ab2899c6ce Dockerfile aktualisiert 2024-01-19 12:42:59 +01:00
321205c261 README.md aktualisiert 2024-01-19 12:42:17 +01:00
b70687dbfe config/PalWorldSettings.ini aktualisiert 2024-01-19 12:29:05 +01:00
63e5bb9d39 scripts/start-watchdog.sh gelöscht 2024-01-19 12:28:49 +01:00
4a0f6972eb scripts/start-server.sh aktualisiert 2024-01-19 12:28:41 +01:00
ab03da94fe Dateien nach "config" hochladen 2024-01-19 12:03:57 +01:00
f1455aabdb scripts/start-server.sh aktualisiert 2024-01-19 10:05:49 +01:00
375f3a3033 Dockerfile aktualisiert 2024-01-19 10:04:44 +01:00
0a5ddca86d modified: scripts/start-server.sh 2023-11-30 09:44:01 +01:00
d8faaeb7c2 geändert: Dockerfile
geändert:       scripts/start-server.sh
2023-11-26 07:54:27 +01:00
432361e9f6 geändert: scripts/start-server.sh 2023-11-21 20:36:42 +01:00
4eb0e756a4 scripts/start-server.sh aktualisiert 2023-11-15 10:42:20 +01:00
4c58d85d62 scripts/start-server.sh aktualisiert 2023-11-15 10:40:34 +01:00
28cbbc2a11 scripts/start.sh aktualisiert 2023-11-15 10:34:39 +01:00
ab34a63ee0 scripts/start-server.sh aktualisiert 2023-11-15 10:18:41 +01:00
9f98c1762b scripts/start-server.sh aktualisiert 2023-11-15 10:18:22 +01:00
13e3f609fd Dockerfile aktualisiert 2023-11-15 10:13:48 +01:00
7ff2252eb0 README.md aktualisiert 2023-11-15 10:13:32 +01:00
8282595cf4 Dockerfile aktualisiert 2023-11-15 09:57:42 +01:00
6ccdd30710 scripts/start.sh aktualisiert 2023-11-15 09:54:17 +01:00
b33fe0ccbf scripts/start-watchdog.sh hinzugefügt 2023-11-15 09:52:42 +01:00
a229e2df13 scripts/start-server.sh aktualisiert 2023-11-15 09:51:31 +01:00
50b9b92696 scripts/start-server.sh aktualisiert 2023-11-15 09:50:34 +01:00
2d3449d935 Dockerfile aktualisiert 2023-10-28 17:39:28 +02:00
6a709a9621 Dockerfile aktualisiert 2023-10-27 08:13:32 +02:00
cb70a23534 Dockerfile aktualisiert 2023-10-26 22:54:27 +02:00
b22d9ed7de Dockerfile aktualisiert 2023-10-26 22:51:35 +02:00
d55dcde29d scripts/start-server.sh aktualisiert 2023-10-26 22:48:58 +02:00
6 changed files with 164 additions and 76 deletions

View File

@@ -1,19 +1,22 @@
FROM ich777/debian-baseimage:bullseye_amd64
FROM ich777/debian-baseimage
LABEL org.opencontainers.image.authors="admin@minenet.at"
LABEL org.opencontainers.image.source="https://github.com/ich777/docker-steamcmd-server"
RUN apt-get update && \
apt-get -y install --no-install-recommends lib32gcc-s1 lib32stdc++6 lib32z1 && \
apt-get -y install --no-install-recommends lib32gcc-s1 lib32stdc++6 xdg-user-dirs && \
rm -rf /var/lib/apt/lists/*
ENV DATA_DIR="/serverdata"
ENV STEAMCMD_DIR="${DATA_DIR}/steamcmd"
ENV SERVER_DIR="${DATA_DIR}/serverfiles"
ENV GAME_ID="template"
ENV GAME_NAME="template"
ENV GAME_PARAMS="template"
ENV GAME_PORT=27015
ENV GAME_ID="2394010"
ENV GAME_PARAMS="EpicApp=PalServer"
ENV GAME_PARAMS_EXTRA="-useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS"
ENV UPDATE_PUBLIC_IP="false"
ENV BACKUP="false"
ENV BACKUP_INTERVAL=120
ENV BACKUPS_TO_KEEP=12
ENV VALIDATE=""
ENV UMASK=000
ENV UID=99

View File

@@ -1,36 +1,53 @@
# SteamCMD in Docker optimized for Unraid
This Docker will download and install SteamCMD and the according game that is pulled via specifying the Tag.
This Docker will download and install SteamCMD. It will also install Palworld and run it.
**Please see the different Tags/Branches which games are available.**
**Server Name:** Palworld Docker
**Password:** Docker
**Admin Password:** adminDocker
## Example Env params for CS:Source
**Configuration:** The configuration is located at: .../Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
ATTENTION: First Startup can take very long since it downloads the gameserver files!
Update Notice: Simply restart the container if a newer version of the game is available.
You can also run multiple servers with only one SteamCMD directory!
## Example Env params
| Name | Value | Example |
| --- | --- | --- |
| STEAMCMD_DIR | Folder for SteamCMD | /serverdata/steamcmd |
| SERVER_DIR | Folder for gamefile | /serverdata/serverfiles |
| GAME_ID | The GAME_ID that the container downloads at startup. If you want to install a static or beta version of the game change the value to: '232330 -beta YOURBRANCH' (without quotes, replace YOURBRANCH with the branch or version you want to install). | 232330 |
| GAME_NAME | SRCDS gamename | cstrike |
| GAME_PARAMS | Values to start the server | -secure +maxplayers 32 +map de_dust2 |
| GAME_ID | The GAME_ID that the container downloads at startup. If you want to install a static or beta version of the game change the value to: '2394010 -beta YOURBRANCH' (without quotes, replace YOURBRANCH with the branch or version you want to install). | 2394010 |
| SRV_ADMIN_PWD | Your server admin password goes here | adminDocker |
| GAME_PARAMS | Enter your game parameters (for a community server put in the value '-publiclobby' without quotes) | -publiclobby -rconport=25575 |
| GAME_PARAMS_EXTRA | Enter your Extra Game Parameters seperated with a space and - (eg: -No-useperfthreads -NoAsyncLoadingThread) | -useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS |
| UPDATE_PUBLIC_IP | If set to 'true' the container will check on each container start if the Public IP is still valid (the container will try to grab your public IP on the first server start since the public IP is necessary to run a community server). | false |
| BACKUP | Set this value to 'true' to enable the automated backup function from the container, you find the Backups in '.../palworld/Backups/'. Set to 'false' to disable the backup function. | true |
| BACKUP_INTERVAL | The backup interval in minutes (ATTENTION: The first backup will be triggered after the set interval in this variable after the start/restart of the container) | 120 |
| BACKUPS_TO_KEEP | Number of backups to keep (by default set to 12 to keep the last backups of the last 24 hours) | 12 |
| UID | User Identifier | 99 |
| GID | Group Identifier | 100 |
| GAME_PORT | Port the server will be running on | 27015 |
| VALIDATE | Validates the game data | blank |
| USERNAME | Leave blank for anonymous login | blank |
| PASSWRD | Leave blank for anonymous login | blank |
## Run example for CS:Source
## Run example
```
docker run --name CSSource -d \
-p 27015:27015 -p 27015:27015/udp \
--env 'GAME_ID=232330' \
--env 'GAME_NAME=cstrike' \
--env 'GAME_PORT=27015' \
--env 'GAME_PARAMS=-secure +maxplayers 32 +map de_dust2' \
docker run --name Palworld -d \
-p 8211:8211/udp -p 25575:25575 \
--env 'GAME_ID=2394010' \
--env 'UPDATE_PUBLIC_IP=false' \
--env 'GAME_PARAMS=-publiclobby -rconport=25575' \
--env 'GAME_PARAMS_EXTRA=-No-useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS' \
--env 'BACKUP=true' \
--env 'BACKUP_INTERVAL=120' \
--env 'BACKUPS_TO_KEEP=12' \
--env 'UID=99' \
--env 'GID=100' \
--volume /path/to/steamcmd:/serverdata/steamcmd \
--volume /path/to/cstrikesource:/serverdata/serverfiles \
ich777/steamcmd:latest
--volume /path/to/palworld:/serverdata/serverfiles \
ich777/steamcmd:palworld
```
This Docker was mainly edited for better use with Unraid, if you don't use Unraid you should definitely try it!

View File

@@ -0,0 +1,3 @@
[/Script/Pal.PalGameWorldSettings]
OptionSettings=(Difficulty=None,DayTimeSpeedRate=1.000000,NightTimeSpeedRate=1.000000,ExpRate=1.000000,PalCaptureRate=1.000000,PalSpawnNumRate=1.000000,PalDamageRateAttack=1.000000,PalDamageRateDefense=1.000000,PlayerDamageRateAttack=1.000000,PlayerDamageRateDefense=1.000000,PlayerStomachDecreaceRate=1.000000,PlayerStaminaDecreaceRate=1.000000,PlayerAutoHPRegeneRate=1.000000,PlayerAutoHpRegeneRateInSleep=1.000000,PalStomachDecreaceRate=1.000000,PalStaminaDecreaceRate=1.000000,PalAutoHPRegeneRate=1.000000,PalAutoHpRegeneRateInSleep=1.000000,BuildObjectDamageRate=1.000000,BuildObjectDeteriorationDamageRate=1.000000,CollectionDropRate=1.000000,CollectionObjectHpRate=1.000000,CollectionObjectRespawnSpeedRate=1.000000,EnemyDropItemRate=1.000000,DeathPenalty=All,bEnablePlayerToPlayerDamage=False,bEnableFriendlyFire=False,bEnableInvaderEnemy=True,bActiveUNKO=False,bEnableAimAssistPad=True,bEnableAimAssistKeyboard=False,DropItemMaxNum=3000,DropItemMaxNum_UNKO=100,BaseCampMaxNum=128,BaseCampWorkerMaxNum=15,DropItemAliveMaxHours=1.000000,bAutoResetGuildNoOnlinePlayers=False,AutoResetGuildTimeNoOnlinePlayers=72.000000,GuildPlayerMaxNum=20,PalEggDefaultHatchingTime=72.000000,WorkSpeedRate=1.000000,bIsMultiplay=False,bIsPvP=False,bCanPickupOtherGuildDeathPenaltyDrop=False,bEnableNonLoginPenalty=True,bEnableFastTravel=True,bIsStartLocationSelectByMap=True,bExistPlayerAfterLogout=False,bEnableDefenseOtherGuildPlayer=False,CoopPlayerMaxNum=4,ServerPlayerMaxNum=32,ServerName="Palworld Docker",ServerDescription="Palworld running in Docker",AdminPassword="adminDocker",ServerPassword="Docker",PublicPort=8211,PublicIP="",RCONEnabled=False,RCONPort=25575,Region="",bUseAuth=True,BanListURL="https://api.palworldgame.com/api/banlist.txt")

10
scripts/start-backup.sh Normal file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
while true
do
sleep ${BACKUP_INTERVAL}m
cd ${SERVER_DIR}/Pal/Saved
tar --warning=no-file-changed --exclude='./Config/CrashReportClient' -czf ${SERVER_DIR}/Backups/$(date '+%Y-%m-%d_%H.%M.%S').tar.gz .
cd ${SERVER_DIR}/Backups
ls -1tr ${SERVER_DIR}/Backups | sort | head -n -${BACKUPS_TO_KEEP} | xargs -d '\n' rm -f --
chmod -R ${DATA_PERM} ${SERVER_DIR}/Backups
done

View File

@@ -1,68 +1,123 @@
#!/bin/bash
if [ ! -f ${STEAMCMD_DIR}/steamcmd.sh ]; then
echo "SteamCMD not found!"
wget -q -O ${STEAMCMD_DIR}/steamcmd_linux.tar.gz http://media.steampowered.com/client/steamcmd_linux.tar.gz
tar --directory ${STEAMCMD_DIR} -xvzf /serverdata/steamcmd/steamcmd_linux.tar.gz
rm ${STEAMCMD_DIR}/steamcmd_linux.tar.gz
echo "SteamCMD not found!"
wget -q -O ${STEAMCMD_DIR}/steamcmd_linux.tar.gz http://media.steampowered.com/client/steamcmd_linux.tar.gz
tar --directory ${STEAMCMD_DIR} -xvzf /serverdata/steamcmd/steamcmd_linux.tar.gz
rm ${STEAMCMD_DIR}/steamcmd_linux.tar.gz
fi
echo "---Update SteamCMD---"
if [ "${USERNAME}" == "" ]; then
${STEAMCMD_DIR}/steamcmd.sh \
+login anonymous \
+quit
${STEAMCMD_DIR}/steamcmd.sh \
+login anonymous \
+quit
else
${STEAMCMD_DIR}/steamcmd.sh \
+login ${USERNAME} ${PASSWRD} \
+quit
${STEAMCMD_DIR}/steamcmd.sh \
+login ${USERNAME} ${PASSWRD} \
+quit
fi
echo "---Update Server---"
if [ "${USERNAME}" == "" ]; then
if [ "${VALIDATE}" == "true" ]; then
echo "---Validating installation---"
${STEAMCMD_DIR}/steamcmd.sh \
+force_install_dir ${SERVER_DIR} \
+login anonymous \
+app_update ${GAME_ID} validate \
+quit
else
${STEAMCMD_DIR}/steamcmd.sh \
+force_install_dir ${SERVER_DIR} \
+login anonymous \
+app_update ${GAME_ID} \
+quit
fi
if [ "${VALIDATE}" == "true" ]; then
echo "---Validating installation---"
${STEAMCMD_DIR}/steamcmd.sh \
+force_install_dir ${SERVER_DIR} \
+login anonymous \
+app_update ${GAME_ID} validate \
+quit
else
${STEAMCMD_DIR}/steamcmd.sh \
+force_install_dir ${SERVER_DIR} \
+login anonymous \
+app_update ${GAME_ID} \
+quit
fi
else
if [ "${VALIDATE}" == "true" ]; then
echo "---Validating installation---"
${STEAMCMD_DIR}/steamcmd.sh \
+force_install_dir ${SERVER_DIR} \
+login ${USERNAME} ${PASSWRD} \
+app_update ${GAME_ID} validate \
+quit
if [ "${VALIDATE}" == "true" ]; then
echo "---Validating installation---"
${STEAMCMD_DIR}/steamcmd.sh \
+force_install_dir ${SERVER_DIR} \
+login ${USERNAME} ${PASSWRD} \
+app_update ${GAME_ID} validate \
+quit
else
${STEAMCMD_DIR}/steamcmd.sh \
+force_install_dir ${SERVER_DIR} \
+login ${USERNAME} ${PASSWRD} \
+app_update ${GAME_ID} \
+quit
fi
fi
echo "---Checking if configuration is in place---"
if [ ! -f ${SERVER_DIR}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini ]; then
if [ ! -d ${SERVER_DIR}/Pal/Saved/Config/LinuxServer ]; then
mkdir -p ${SERVER_DIR}/Pal/Saved/Config/LinuxServer
fi
echo "---Configuration not found, downloading...---"
wget -qO ${SERVER_DIR}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini https://github.com/ich777/docker-steamcmd-server/raw/palworld/config/PalWorldSettings.ini
else
echo "---Configuration found, continuing...---"
fi
echo "---Checking if PublicIP is in place---"
PUBLIC_IP="$(grep -o 'PublicIP="[^"]*"' ${SERVER_DIR}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini | cut -d '"' -f2)"
if [ -z "${PUBLIC_IP}" ]; then
echo "---No PublicIP found in PalWorldSettings.ini, trying to obtain it...---"
PUBLIC_IP="$(wget -qO - ipv4.icanhazip.com)"
if [ -z "${PUBLIC_IP}" ]; then
echo "---Can't get PublicIP, please set it manually in your PalWorldSettings.ini!---"
else
echo "---Sucessfully obtained PublicIP: ${PUBLIC_IP}, adding to PalWorldSettings.ini"
sed -i "s/PublicIP=\"[^\"]*\"/PublicIP=\"${PUBLIC_IP}\"/g" ${SERVER_DIR}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
fi
else
if [ "${UPDATE_PUBLIC_IP}" == "true" ]; then
NEW_PUBLIC_IP="$(wget -qO - ipv4.icanhazip.com)"
if [ -z "${NEW_PUBLIC_IP}" ]; then
echo "---Can't get PublicIP, please set it manually in your PalWorldSettings.ini!---"
else
${STEAMCMD_DIR}/steamcmd.sh \
+force_install_dir ${SERVER_DIR} \
+login ${USERNAME} ${PASSWRD} \
+app_update ${GAME_ID} \
+quit
if [ "${PUBLIC_IP}" != "${NEW_PUBLIC_IP}" ]; then
echo "---Changing PublicIP in PalWorldSettings.ini to: ${NEW_PUBLIC_IP}!---"
sed -i "s/PublicIP=\"[^\"]*\"/PublicIP=\"${NEW_PUBLIC_IP}\"/g" ${SERVER_DIR}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
else
echo "---Nothing to do, PublicIP: ${PUBLIC_IP} still up-to-date!---"
fi
fi
else
echo "---PublicIP in PalWorldSettings.ini found: ${PUBLIC_IP}"
fi
fi
echo "---Prepare Server---"
if [ ! -f ${DATA_DIR}/.steam/sdk32/steamclient.so ]; then
if [ ! -d ${DATA_DIR}/.steam ]; then
mkdir ${DATA_DIR}/.steam
fi
if [ ! -d ${DATA_DIR}/.steam/sdk32 ]; then
mkdir ${DATA_DIR}/.steam/sdk32
fi
cp -R ${STEAMCMD_DIR}/linux32/* ${DATA_DIR}/.steam/sdk32/
if [ ! -f ${SERVER_DIR}/Engine/Binaries/Linux/steamclient.so ]; then
ln -s ${SERVER_DIR}/linux64/steamclient.so ${SERVER_DIR}/Engine/Binaries/Linux/steamclient.so
fi
if [ ! -d ${DATA_DIR}/.steam/sdk64 ]; then
mkdir -p ${DATA_DIR}/.steam/sdk64
cp -R ${SERVER_DIR}/linux64/* ${DATA_DIR}/.steam/sdk64/
fi
chmod -R ${DATA_PERM} ${DATA_DIR}
echo "---Server ready---"
if [ "${BACKUP}" == "true" ]; then
echo "---Starting Backup daemon---"
if [ ! -d ${SERVER_DIR}/Backups ]; then
mkdir -p ${SERVER_DIR}/Backups
fi
/opt/scripts/start-backup.sh &
fi
echo "---Start Server---"
cd ${SERVER_DIR}
${SERVER_DIR}/srcds_run -game ${GAME_NAME} ${GAME_PARAMS} -console +port ${GAME_PORT}
if [ -f ${SERVER_DIR}/Pal/Binaries/Linux/PalServer-Linux-Shipping ]; then
cd ${SERVER_DIR}
${SERVER_DIR}/Pal/Binaries/Linux/PalServer-Linux-Shipping Pal -nocore ${GAME_PARAMS} ${GAME_PARAMS_EXTRA}
elif [ -f ${SERVER_DIR}/Pal/Binaries/Linux/PalServer-Linux-Test ]; then
cd ${SERVER_DIR}
${SERVER_DIR}/Pal/Binaries/Linux/PalServer-Linux-Test Pal -nocore ${GAME_PARAMS} ${GAME_PARAMS_EXTRA}
else
echo "---Something went wrong, can't find the executable, putting container into sleep mode!---"
sleep infinity
fi

View File

@@ -12,11 +12,11 @@ cp -f /opt/custom/user.sh /opt/scripts/start-user.sh > /dev/null 2>&1 ||:
cp -f /opt/scripts/user.sh /opt/scripts/start-user.sh > /dev/null 2>&1 ||:
if [ -f /opt/scripts/start-user.sh ]; then
echo "---Found optional script, executing---"
chmod -f +x /opt/scripts/start-user.sh ||:
/opt/scripts/start-user.sh || echo "---Optional Script has thrown an Error---"
echo "---Found optional script, executing---"
chmod -f +x /opt/scripts/start-user.sh ||:
/opt/scripts/start-user.sh || echo "---Optional Script has thrown an Error---"
else
echo "---No optional script found, continuing---"
echo "---No optional script found, continuing---"
fi
echo "---Taking ownership of data...---"
@@ -26,8 +26,8 @@ chown -R ${UID}:${GID} ${DATA_DIR}
echo "---Starting...---"
term_handler() {
kill -SIGTERM "$killpid"
wait "$killpid" -f 2>/dev/null
kill -SIGTERM $(pidof PalServer-Linux-Test)
tail --pid=$(pidof PalServer-Linux-Test) -f 2>/dev/null
exit 143;
}
@@ -36,6 +36,6 @@ su ${USER} -c "/opt/scripts/start-server.sh" &
killpid="$!"
while true
do
wait $killpid
exit 0;
wait $killpid
exit 0;
done