Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
c6b3797ebf | |||
01fe1b1961 | |||
995c609144 | |||
35791b91c0 | |||
e894dc7f4e | |||
055abb3a21 | |||
25847029f2 | |||
474858120c | |||
c3d8326fff | |||
790fa9feda | |||
87bd8b5968 | |||
e4bfcc822b | |||
c3e9b63418 | |||
658c74ae31 | |||
df6dd34aad | |||
c087d04ea4 | |||
717c742fe3 | |||
db56648326 | |||
246c33ef6e | |||
0f519bffa7 | |||
7aa28dfd85 | |||
9397fbcdcb | |||
4ba563141a | |||
14a2e446a4 | |||
16f7192b8f |
@@ -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
|
||||
|
36
README.md
36
README.md
@@ -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/
|
||||
|
@@ -1,5 +0,0 @@
|
||||
[OnlineSubsystem]
|
||||
ServerName=Docker ConanExile
|
||||
ServerPassword=Docker
|
||||
|
||||
|
@@ -1,3 +0,0 @@
|
||||
[ServerSettings]
|
||||
MaxNudity=2
|
||||
AdminPassword=adminDocker
|
4
etc/asound.conf
Normal file
4
etc/asound.conf
Normal file
@@ -0,0 +1,4 @@
|
||||
pcm.!default {
|
||||
type plug
|
||||
slave.pcm "null"
|
||||
}
|
10
scripts/start-backup.sh
Normal file
10
scripts/start-backup.sh
Normal 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
|
@@ -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}
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user