Compare commits

...

25 Commits

Author SHA1 Message Date
c6b3797ebf README.md aktualisiert 2024-02-01 22:42:50 +01:00
01fe1b1961 README.md aktualisiert 2024-02-01 22:37:56 +01:00
995c609144 Dockerfile aktualisiert 2024-02-01 22:35:04 +01:00
35791b91c0 scripts/start-server.sh aktualisiert 2024-02-01 22:31:19 +01:00
e894dc7f4e scripts/start-backup.sh hinzugefügt 2024-02-01 22:30:50 +01:00
055abb3a21 scripts/start.sh aktualisiert 2023-07-22 09:26:36 +02:00
25847029f2 scripts/start-server.sh aktualisiert 2023-07-18 09:58:12 +02:00
474858120c „README.md“ ändern 2023-04-25 11:32:40 +02:00
c3d8326fff „Dockerfile“ ändern 2023-04-25 11:31:32 +02:00
790fa9feda „scripts/start-server.sh“ ändern 2023-04-25 11:31:18 +02:00
87bd8b5968 „scripts/start-server.sh“ ändern 2023-04-25 11:24:37 +02:00
e4bfcc822b „scripts/start-server.sh“ ändern 2023-04-25 11:22:08 +02:00
c3e9b63418 „etc/asound.conf“ ändern 2023-04-25 11:17:47 +02:00
658c74ae31 „Dockerfile“ ändern 2023-04-25 11:17:32 +02:00
df6dd34aad „Dockerfile“ ändern 2023-04-25 11:17:26 +02:00
c087d04ea4 „scripts/start-server.sh“ ändern 2023-04-25 11:16:40 +02:00
717c742fe3 „README.md“ ändern 2023-04-25 11:11:40 +02:00
db56648326 „scripts/start-server.sh“ ändern 2023-04-25 11:02:19 +02:00
246c33ef6e „scripts/start.sh“ ändern 2023-04-25 11:01:30 +02:00
0f519bffa7 „scripts/start-server.sh“ ändern 2023-04-25 11:00:21 +02:00
7aa28dfd85 „config/asound.conf“ ändern 2023-04-25 10:59:58 +02:00
9397fbcdcb „config/asound.conf“ ändern 2023-04-25 10:59:48 +02:00
4ba563141a „config/Engine.ini“ löschen 2023-04-25 10:59:19 +02:00
14a2e446a4 „scripts/start-server.sh“ ändern 2023-04-25 10:59:12 +02:00
16f7192b8f „scripts/start-server.sh“ ändern 2023-04-25 10:13:32 +02:00
8 changed files with 143 additions and 97 deletions

View File

@@ -12,7 +12,10 @@ ENV DATA_DIR="/serverdata"
ENV STEAMCMD_DIR="${DATA_DIR}/steamcmd"
ENV SERVER_DIR="${DATA_DIR}/serverfiles"
ENV GAME_ID="template"
ENV WS_CONTENT=""
ENV UPDATE_PUBLIC_IP="false"
ENV BACKUP="false"
ENV BACKUP_INTERVAL=360
ENV BACKUPS_TO_KEEP=8
ENV GAME_PARAMS=""
ENV VALIDATE=""
ENV UMASK=000
@@ -31,6 +34,7 @@ RUN mkdir $DATA_DIR && \
ulimit -n 2048
ADD /scripts/ /opt/scripts/
COPY /etc/ /etc/
RUN chmod -R 770 /opt/scripts/
#Server Start

View File

@@ -1,7 +1,18 @@
# SteamCMD in Docker optimized for Unraid
This Docker will download and install SteamCMD. It will also install Conan Exiles and run it.
This Docker will download and install SteamCMD. It will also install Astroneer and run it.
**Servername:** 'Docker ConanExiles' Password: 'Docker' rconPassword: 'adminDocker'
**ATTENTION:** You have to add this entry to the Engine.ini from the clients which are going to connecting to this dedicated server:
```
[SystemSettings]
net.AllowEncryption=False
```
You'll find the file on your local Windows machine at: `%localappdata%\Astro\Saved\Config\WindowsNoEditor`
**WARNING:** If a client tries to connect to the Dedicated Server which don't has this entry in the Engine.ini the server will be left in a semi bricked state and you have to restart the Docker container.
**Servername:** 'AstroneerDocker' Password: 'Docker' ConsolePassword: 'adminDocker'
**Serveradmin:** If you want to become a server admin then stop the container and edit the file ../Astro/Saved/Config/WindowsServer/AstroServerSettings.ini and add your Steam name after `OwnerName=` eg: `OwnerName=YourSteamName`, after that start the container and connect to the Dedicated Server.
**Update Notice:** Simply restart the container if a newer version of the game is available.
@@ -11,7 +22,10 @@ This Docker will download and install SteamCMD. It will also install Conan Exile
| STEAMCMD_DIR | Folder for SteamCMD | /serverdata/steamcmd |
| SERVER_DIR | Folder for gamefile | /serverdata/serverfiles |
| GAME_PARAMS | Values to start the server if needed. | empty |
| WS_CONTENT | Enter you Workshopcontent here, you can also enter multiple WS Content ID's sperated by SPACE. | empty |
| UPDATE_PUBLIC_IP | If set to 'true' the container will check on each container start if the Public IP is still valid. | false |
| BACKUP | Set this value to 'true' to enable the automated backup function from the container, you find the Backups in '.../astroneer/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) | 360 |
| BACKUPS_TO_KEEP | Number of backups to keep (by default set to 8 to keep the last backups of the last 48 hours) | 8 |
| UID | User Identifier | 99 |
| GID | Group Identifier | 100 |
| VALIDATE | Validates the game data | false |
@@ -21,20 +35,22 @@ This Docker will download and install SteamCMD. It will also install Conan Exile
## Run example
```
docker run --name ConanExiles -d \
-p 7777:7777 -p 7777-7778:7777-7778/udp -p 27015:27015/udp \
--env 'GAME_ID=443030' \
docker run --name Astroneer -d \
-p 8777:8777/udp \
--env 'GAME_ID=728470' \
--env 'UPDATE_PUBLIC_IP=false' \
--env 'BACKUP=true' \
--env 'BACKUP_INTERVAL=360' \
--env 'BACKUPS_TO_KEEP=8' \
--env 'UID=99' \
--env 'GID=100' \
--volume /path/to/steamcmd:/serverdata/steamcmd \
--volume /path/to/conanexiles:/serverdata/serverfiles \
ich777/steamcmd:conanexiles
--volume /path/to/astroneer:/serverdata/serverfiles \
ich777/steamcmd:astroneer
```
This Docker was mainly edited for better use with Unraid, if you don't use Unraid you should definitely try it!
This Docker is forked from mattieserver, thank you for this wonderfull Docker.
### Support Thread: https://forums.unraid.net/topic/79530-support-ich777-gameserver-dockers/

View File

@@ -1,5 +0,0 @@
[OnlineSubsystem]
ServerName=Docker ConanExile
ServerPassword=Docker

View File

@@ -1,3 +0,0 @@
[ServerSettings]
MaxNudity=2
AdminPassword=adminDocker

4
etc/asound.conf Normal file
View File

@@ -0,0 +1,4 @@
pcm.!default {
type plug
slave.pcm "null"
}

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}/Astro/Saved
tar --warning=no-file-changed --exclude='./Config/CrashReportClient' -czf ${SERVER_DIR}/Backups/$(date '+%Y-%m-%d_%H.%M.%S').tar.gz ./SaveGames/ ./Config/
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

@@ -54,103 +54,123 @@ else
fi
fi
if [ ! -z "${WS_CONTENT}" ]; then
echo "---Installing Workshop Content with ID('s): ${WS_CONTENT}---"
${STEAMCMD_DIR}/steamcmd.sh \
+@sSteamCmdForcePlatformType windows \
+force_install_dir ${SERVER_DIR} \
+login anonymous \
+workshop_download_item 440900 ${WS_CONTENT// / +workshop_download_item 440900 } \
+quit
if [ ! -d ${SERVER_DIR}/ConanSandbox/Mods ]; then
if [ ! -d ${SERVER_DIR}/ConanSandbox ]; then
echo "-----------------------------------"
echo "------Something went wrong can't find folder-"
echo "---'ConanSandbox' putting server into sleep mode---"
echo "-"
sleep infinity
fi
echo "---Folder 'Mods' not found, creating...---"
mkdir ${SERVER_DIR}/ConanSandbox/Mods
fi
if [ ! -f ${SERVER_DIR}/ConanSandbox/Mods/modlist.txt ]; then
echo "---File 'modlist.txt' not found, creating...---"
touch ${SERVER_DIR}/ConanSandbox/Mods/modlist.txt
fi
echo "---Putting workshop content into modlist---"
#install mods in order
> ${SERVER_DIR}/ConanSandbox/Mods/modlist.txt
for WS_ITEM in ${WS_CONTENT}; do
find ${SERVER_DIR}/steamapps/workshop/content/440900/${WS_ITEM}/ -name *.pak >> ${SERVER_DIR}/ConanSandbox/Mods/modlist.txt
done
fi
echo "---Prepare Server---"
echo "---Looking for config files---"
if [ ! -d ${SERVER_DIR}/ConanSandbox/Saved/Config/WindowsServer ]; then
if [ ! -d ${SERVER_DIR}/ConanSandbox ]; then
echo "-----------------------------------------------------------"
echo "---Something went wrong can't find folder 'ConanSandbox'---"
echo "--------------Putting Server into sleep mode---------------"
sleep infinity
fi
if [ ! -d ${SERVER_DIR}/ConanSandbox/Saved ]; then
mkdir ${SERVER_DIR}/ConanSandbox/Saved
fi
if [ ! -d ${SERVER_DIR}/ConanSandbox/Saved/Config ]; then
mkdir ${SERVER_DIR}/ConanSandbox/Saved/Config
fi
if [ ! -d ${SERVER_DIR}/ConanSandbox/Saved/Config/WindowsServer ]; then
mkdir ${SERVER_DIR}/ConanSandbox/Saved/Config/WindowsServer
fi
if [ ! -d ${SERVER_DIR}/Astro/Saved/Config/WindowsServer ]; then
mkdir -p ${SERVER_DIR}/Astro/Saved/Config/WindowsServer
fi
if [ ! -f ${SERVER_DIR}/ConanSandbox/Saved/Config/WindowsServer/Engine.ini ]; then
echo "---'Engine.ini' not found, downloading template---"
cd ${SERVER_DIR}/ConanSandbox/Saved/Config/WindowsServer
if wget -q -nc --show-progress --progress=bar:force:noscroll https://raw.githubusercontent.com/ich777/docker-steamcmd-server/conanexiles/config/Engine.ini ; then
echo "---Sucessfully downloaded 'Engine.ini'---"
else
echo "---Something went wrong, can't download 'Engine.ini', putting server in sleep mode---"
sleep infinity
fi
if [ ! -f ${SERVER_DIR}/Astro/Saved/Config/WindowsServer/AstroServerSettings.ini ]; then
echo "[/Script/Astro.AstroServerSettings]
bLoadAutoSave=True
MaxServerFramerate=30.000000
MaxServerIdleFramerate=3.000000
bWaitForPlayersBeforeShutdown=False
ConsolePassword=adminDocker
PublicIP=
ServerName=AstroneerDocker
ServerGuid=
OwnerName=
OwnerGuid=0
PlayerActivityTimeout=0
ServerPassword=Docker
bDisableServerTravel=False
DenyUnlistedPlayers=False
VerbosePlayerProperties=False
AutoSaveGameInterval=900
BackupSaveGamesInterval=7200
ActiveSaveFileDescriptiveName=SAVE_1
ServerAdvertisedName=" > ${SERVER_DIR}/Astro/Saved/Config/WindowsServer/AstroServerSettings.ini
else
echo "---'Engine.ini' found---"
echo "---'AstroServerSettings.ini' found---"
fi
if [ ! -f ${SERVER_DIR}/ConanSandbox/Saved/Config/WindowsServer/ServerSettings.ini ]; then
echo "---'ServerSettings.ini' not found, downloading template---"
cd ${SERVER_DIR}/ConanSandbox/Saved/Config/WindowsServer
if wget -q -nc --show-progress --progress=bar:force:noscroll https://raw.githubusercontent.com/ich777/docker-steamcmd-server/conanexiles/config/ServerSettings.ini ; then
echo "---Sucessfully downloaded 'ServerSettings.ini'---"
else
echo "---Something went wrong, can't download 'ServerSettings.ini', putting server in sleep mode---"
sleep infinity
fi
if [ ! -f ${SERVER_DIR}/Astro/Saved/Config/WindowsServer/Engine.ini ]; then
echo "[URL]
Port=8777
[SystemSettings]
net.AllowEncryption=False" > ${SERVER_DIR}/Astro/Saved/Config/WindowsServer/Engine.ini
else
echo "---'ServerSettings.ini' found---"
echo "---'Engine.ini' found---"
sed -i '/^HeartbeatInterval=0/d' ${SERVER_DIR}/Astro/Saved/Config/WindowsServer/AstroServerSettings.ini
fi
echo "---Checking if PublicIP is in place---"
PUBLIC_IP="$(cat ${SERVER_DIR}/Astro/Saved/Config/WindowsServer/AstroServerSettings.ini | grep "PublicIP=" | cut -d '=' -f2)"
if [ -z "${PUBLIC_IP}" ]; then
echo "---No PublicIP found in AstroServerSettings.ini, trying to obtain it...---"
PUBLIC_IP="$(wget -qO - icanhazip.com)"
if [ -z "${PUBLIC_IP}" ]; then
echo "---Can't get PublicIP, please set it manually in your AstroServerSettings.ini!---"
else
echo "---Sucessfully obtained PublicIP: ${PUBLIC_IP}, adding to AstroServerSettings.ini"
sed -i "s/PublicIP=.*/PublicIP=${PUBLIC_IP}/g" ${SERVER_DIR}/Astro/Saved/Config/WindowsServer/AstroServerSettings.ini
fi
else
if [ "${UPDATE_PUBLIC_IP}" == "true" ]; then
NEW_PUBLIC_IP="$(wget -qO - icanhazip.com)"
if [ -z "${NEW_PUBLIC_IP}" ]; then
echo "---Can't get PublicIP, please set it manually in your AstroServerSettings.ini!---"
else
if [ "${PUBLIC_IP}" != "${NEW_PUBLIC_IP}" ]; then
echo "---Changing PublicIP in AstroServerSettings.ini to: ${NEW_PUBLIC_IP}!---"
sed -i "s/PublicIP=.*/PublicIP=${NEW_PUBLIC_IP}/g" ${SERVER_DIR}/Astro/Saved/Config/WindowsServer/AstroServerSettings.ini
else
echo "---Nothing to do, PublicIP: ${PUBLIC_IP} still up-to-date!---"
fi
fi
else
echo "---PublicIP in AstroServerSettings.ini found: ${PUBLIC_IP}"
fi
fi
export WINEARCH=win64
export WINEPREFIX=/serverdata/serverfiles/WINE64
export WINEDEBUG=-all
echo "---Checking if WINE workdirectory is present---"
if [ ! -d ${SERVER_DIR}/WINE64 ]; then
echo "---WINE workdirectory not found, creating please wait...---"
mkdir ${SERVER_DIR}/WINE64
echo "---WINE workdirectory not found, creating please wait...---"
mkdir ${SERVER_DIR}/WINE64
else
echo "---WINE workdirectory found---"
echo "---WINE workdirectory found---"
fi
echo "---Checking if WINE is properly installed---"
if [ ! -d ${SERVER_DIR}/WINE64/drive_c/windows ]; then
echo "---Setting up WINE---"
cd ${SERVER_DIR}
winecfg > /dev/null 2>&1
sleep 15
echo "---Setting up WINE---"
cd ${SERVER_DIR}
winecfg > /dev/null 2>&1
sleep 15
else
echo "---WINE properly set up---"
echo "---WINE properly set up---"
fi
echo "---Checking for old display lock files---"
find /tmp -name ".X99*" -exec rm -f {} \; > /dev/null 2>&1
chmod -R ${DATA_PERM} ${DATA_DIR}
echo "---Server ready---"
echo
echo "+--------------------------------------------------------------------------"
echo "| Please don't forget to add this entry to your Engine.ini on your Clients:"
echo "+--------------------------------------------------------------------------"
echo
echo "[SystemSettings]"
echo "net.AllowEncryption=False"
echo
echo "+-------------------------------------------------------------------------------"
echo "| ATTENTION: If a client tries to connect without that in Engine.ini, the server"
echo "| will be left in a semi bricked state and you have to restart the container!"
echo "|"
echo "| You can find the file on your local Windows machine at:"
echo "| %localappdata%\Astro\Saved\Config\WindowsNoEditor"
echo "+-------------------------------------------------------------------------------"
echo
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}
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:32' wine64 ${SERVER_DIR}/ConanSandboxServer.exe -log ${GAME_PARAMS}
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:32' wine64 AstroServer.exe ${GAME_PARAMS}

View File

@@ -26,8 +26,8 @@ chown -R ${UID}:${GID} ${DATA_DIR}
echo "---Starting...---"
term_handler() {
kill -SIGINT $(pidof wineserver)
tail --pid=$(pidof wineserver) -f 2>/dev/null
kill -SIGKILL $(pidof AstroServer.exe)
tail --pid=$(pidof AstroServer.exe) -f 2>/dev/null
exit 143;
}