Compare commits

...

44 Commits

Author SHA1 Message Date
662735613a „scripts/start.sh“ ändern 2022-10-25 11:11:22 +02:00
2179a74156 „Dockerfile“ ändern 2022-05-06 11:01:13 +02:00
a0438fb352 „scripts/start.sh“ ändern 2022-04-18 14:48:40 +02:00
124cc75a92 „scripts/start.sh“ ändern 2022-04-07 17:13:45 +02:00
f596f40e33 „README.md“ ändern 2021-12-29 15:55:27 +01:00
364fa60958 „README.md“ ändern 2021-12-29 15:55:16 +01:00
f9b39be6ea „scripts/start.sh“ ändern 2021-12-29 10:47:45 +01:00
24aeb8cd48 „scripts/start-watchdog.sh“ löschen 2021-12-29 10:46:49 +01:00
d73fd2b929 „scripts/start-server.sh“ ändern 2021-12-29 10:46:43 +01:00
2b8ac05860 „scripts/start-server.sh“ ändern 2021-12-29 10:39:06 +01:00
13103cb707 „scripts/start-server.sh“ ändern 2021-12-29 10:23:00 +01:00
0581995a64 „scripts/start-server.sh“ ändern 2021-12-29 10:22:14 +01:00
a0a00c890b „scripts/start-server.sh“ ändern 2021-12-29 10:20:42 +01:00
82145dfd51 „Dockerfile“ ändern 2021-12-29 09:44:41 +01:00
ec24d2b482 „scripts/start-gotty.sh“ hinzufügen 2021-12-29 09:43:58 +01:00
a9d3c77c74 „scripts/start-server.sh“ ändern 2021-12-29 09:43:39 +01:00
eed75485e4 „scripts/start-server.sh“ ändern 2021-12-29 09:39:51 +01:00
2f56450a11 „scripts/start-server.sh“ ändern 2021-12-29 09:28:16 +01:00
84f6c7bb8b „scripts/start-watchdog.sh“ hinzufügen 2021-12-29 09:27:30 +01:00
1db1f0e449 „scripts/start.sh“ ändern 2021-12-29 09:26:38 +01:00
cdf5996a67 „scripts/start-server.sh“ ändern 2021-12-29 09:21:03 +01:00
01f5fcda06 „Dockerfile“ ändern 2021-12-29 09:16:24 +01:00
b3f9cb4842 „scripts/start-gotty.sh“ löschen 2021-12-29 09:16:14 +01:00
9d1dacb945 „scripts/start-server.sh“ ändern 2021-12-29 09:16:08 +01:00
6ba7468dd4 „Dockerfile“ ändern 2021-12-29 08:47:14 +01:00
3b192e28bc „config/server_config.cfg“ löschen 2021-12-29 08:47:04 +01:00
7ca7819dc0 „config/server_config.cfg“ ändern 2021-12-29 08:30:49 +01:00
0caa74af9a „scripts/start-server.sh“ ändern 2021-12-29 08:28:31 +01:00
24879524a6 „Dockerfile“ ändern 2021-12-29 07:24:34 +01:00
35fc6ee142 „scripts/start-server.sh“ ändern 2021-12-29 07:23:59 +01:00
0bd1533ef6 „Dockerfile“ ändern 2021-12-29 07:23:00 +01:00
e4aa81e92a Dateien hochladen nach „config“ 2021-12-29 07:22:02 +01:00
131b462758 „Dockerfile“ ändern 2021-12-29 07:20:40 +01:00
297455987c „scripts/start-server.sh“ ändern 2021-12-29 07:20:14 +01:00
e95ce85316 „Dockerfile“ ändern 2021-12-29 07:19:04 +01:00
47458f163f „scripts/start-gotty.sh“ hinzufügen 2021-12-29 07:18:12 +01:00
75c287c7bd „scripts/start-server.sh“ ändern 2021-12-29 07:17:49 +01:00
47e19ffa0f „Dockerfile“ ändern 2021-12-29 06:45:44 +01:00
23c470fecf „scripts/start-server.sh“ ändern 2021-12-29 06:12:21 +01:00
a9c4531631 „scripts/start.sh“ ändern 2021-12-29 06:10:37 +01:00
a22d360486 „scripts/start-server.sh“ ändern 2021-12-29 06:10:18 +01:00
17db75f9f1 „config/ServerSettings.ini“ löschen 2021-12-29 06:09:26 +01:00
05ea38dd93 „config/Engine.ini“ löschen 2021-12-29 06:09:22 +01:00
4a0251f92c „Dockerfile“ ändern 2021-12-29 06:09:12 +01:00
7 changed files with 73 additions and 121 deletions

View File

@@ -1,19 +1,25 @@
FROM ich777/winehq-baseimage
LABEL maintainer="admin@minenet.at"
LABEL org.opencontainers.image.authors="admin@minenet.at"
LABEL org.opencontainers.image.source="https://github.com/ich777/docker-steamcmd-server"
RUN dpkg --add-architecture i386 && \
apt-get update && \
apt-get -y install lib32gcc1 screen xvfb && \
apt-get -y install --no-install-recommends lib32gcc-s1 screen xvfb winbind && \
rm -rf /var/lib/apt/lists/*
RUN wget -O /tmp/gotty.tar.gz https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz && \
tar -C /usr/bin/ -xvf /tmp/gotty.tar.gz && \
rm -rf /tmp/gotty.tar.gz
ENV DATA_DIR="/serverdata"
ENV STEAMCMD_DIR="${DATA_DIR}/steamcmd"
ENV SERVER_DIR="${DATA_DIR}/serverfiles"
ENV GAME_ID="template"
ENV WS_CONTENT=""
ENV GAME_PARAMS=""
ENV VALIDATE=""
ENV ENABLE_WEBCONSOLE="true"
ENV GOTTY_PARAMS="-w --title-format Wreckfest"
ENV UMASK=000
ENV UID=99
ENV GID=100

View File

@@ -1,42 +1,35 @@
# SteamCMD in Docker optimized for Unraid
This Docker will download and install SteamCMD. It will also install Counter-Strike: Source and run it. Update Notice: Simply restart the container if a newer version of the game is available.
This Docker will download and install SteamCMD. It will also install Wreckfest and run it.
Servername: 'Wreckfest Docker' Password: 'Docker'
**Update Notice:** Simply restart the container if a newer version of the game is available.
**WEB CONSOLE:** You can connect to the Wreckfest console by opening your browser and go to HOSTIP:9028 (eg: 192.168.1.1:9028) or click on WebUI on the Docker page within Unraid.
## Env params
| Name | Value | Example |
| --- | --- | --- |
| STEAMCMD_DIR | Folder for SteamCMD | /serverdata/steamcmd |
| SERVER_DIR | Folder for gamefile | /serverdata/serverfiles |
| GAME_ID | SteamID for server | 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: '361580 -beta YOURBRANCH' (without quotes, replace YOURBRANCH with the branch or version you want to install). | 361580 |
| GAME_PARAMS | Enter your start up commands for the server if needed. | none |
| UID | User Identifier | 99 |
| GID | Group Identifier | 100 |
| GAME_PORT | Port the server will be running on | 27015 |
| VALIDATE | Validates the game data | true |
| USERNAME | Leave blank for anonymous login | blank |
| PASSWRD | Leave blank for anonymous login | blank |
***ATTENTION: You have to disable Steam Guard for games that require authentication, Steam recommends to create a seperate account for dedicated servers***
>**NOTE** GAME_ID values can be found [here](https://developer.valvesoftware.com/wiki/Dedicated_Servers_List)
> And for GAME_NAME there is no list, so a quick search should give you the result
## 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 Wreckfest -d \
-p 33540:33540/udp -p 27015-27016:27015-27016/udp -p 9028:8080 \
--env 'GAME_ID=361580' \
--env 'UID=99' \
--env 'GID=100' \
--volume /mnt/user/appdata/steamcmd:/serverdata/steamcmd \
--volume /mnt/user/appdata/cstrikesource:/serverdata/serverfiles \
ich777/steamcmd:latest
--volume /path/to/steamcmd:/serverdata/steamcmd \
--volume /path/to/cstrikesource:/serverdata/serverfiles \
ich777/steamcmd:wreckfest
```
>**NOTE** port 26900 is the port for vac, in case of multiple servers make sure these are not the same
This Docker was mainly edited for better use with Unraid, if you don't use Unraid you should definitely try it!

View File

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

View File

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

3
scripts/start-gotty.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
sleep 5
TERM=linux gotty ${GOTTY_PARAMS} screen -xS Wreckfest

View File

@@ -23,15 +23,15 @@ if [ "${USERNAME}" == "" ]; then
echo "---Validating installation---"
${STEAMCMD_DIR}/steamcmd.sh \
+@sSteamCmdForcePlatformType windows \
+login anonymous \
+force_install_dir ${SERVER_DIR} \
+login anonymous \
+app_update ${GAME_ID} validate \
+quit
else
${STEAMCMD_DIR}/steamcmd.sh \
+@sSteamCmdForcePlatformType windows \
+login anonymous \
+force_install_dir ${SERVER_DIR} \
+login anonymous \
+app_update ${GAME_ID} \
+quit
fi
@@ -40,96 +40,26 @@ else
echo "---Validating installation---"
${STEAMCMD_DIR}/steamcmd.sh \
+@sSteamCmdForcePlatformType windows \
+login ${USERNAME} ${PASSWRD} \
+force_install_dir ${SERVER_DIR} \
+login ${USERNAME} ${PASSWRD} \
+app_update ${GAME_ID} validate \
+quit
else
${STEAMCMD_DIR}/steamcmd.sh \
+@sSteamCmdForcePlatformType windows \
+login ${USERNAME} ${PASSWRD} \
+force_install_dir ${SERVER_DIR} \
+login ${USERNAME} ${PASSWRD} \
+app_update ${GAME_ID} \
+quit
fi
fi
if [ ! -z "${WS_CONTENT}" ]; then
echo "---Installing Workshop Content with ID('s): ${WS_CONTENT}---"
${STEAMCMD_DIR}/steamcmd.sh \
+@sSteamCmdForcePlatformType windows \
+login anonymous \
+force_install_dir ${SERVER_DIR} \
+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
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
else
echo "---'Engine.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
else
echo "---'ServerSettings.ini' found---"
fi
export WINEARCH=win64
export WINEPREFIX=/serverdata/serverfiles/WINE64
export WINEDEBUG=-all
export DBUS_FATAL_WARNINGS=0
export DISPLAY=:99
echo "---Checking if WINE workdirectory is present---"
if [ ! -d ${SERVER_DIR}/WINE64 ]; then
echo "---WINE workdirectory not found, creating please wait...---"
@@ -146,11 +76,33 @@ if [ ! -d ${SERVER_DIR}/WINE64/drive_c/windows ]; then
else
echo "---WINE properly set up---"
fi
if [ ! -f ~/.screenrc ]; then
echo "defscrollback 30000
bindkey \"^C\" echo 'Blocked. Please use to command \"exit\" to shutdown the server or close this window to exit the terminal.'" > ~/.screenrc
fi
if [ ! -f ${SERVER_DIR}/server_config.cfg ]; then
cp ${SERVER_DIR}/initial_server_config.cfg ${SERVER_DIR}/server_config.cfg
sed -i '/^#/!s/server_name=.*/server_name="Wreckfest Docker"/g' ${SERVER_DIR}/server_config.cfg
sed -i '/welcome_message=/c\welcome_message="Welcome to Wreckfest running on Docker"' ${SERVER_DIR}/server_config.cfg
sed -i '/^#/!s/password=.*/password="Docker"/g' ${SERVER_DIR}/server_config.cfg
else
echo "---'server_config.cfg' found..."
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 "---Starting Xvfb server---"
Xvfb :99 -screen scrn 640x480x16 2>/dev/null &
sleep 3
echo "---Start Server---"
cd ${SERVER_DIR}
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:32' wine64 ${SERVER_DIR}/ConanSandboxServer.exe -log ${GAME_PARAMS}
screen -S Wreckfest -d -m wine64 Wreckfest_x64.exe -s server_config=server_config.cfg ${GAME_PARAMS}
sleep 1
if [ "${ENABLE_WEBCONSOLE}" == "true" ]; then
/opt/scripts/start-gotty.sh 2>/dev/null &
fi
sleep 1
tail --pid=$(pgrep Wreckfest_x64.e) -f /dev/null

View File

@@ -1,27 +1,33 @@
#!/bin/bash
echo "---Checking if UID: ${UID} matches user---"
echo "---Ensuring UID: ${UID} matches user---"
usermod -u ${UID} ${USER}
echo "---Checking if GID: ${GID} matches user---"
echo "---Ensuring GID: ${GID} matches user---"
groupmod -g ${GID} ${USER} > /dev/null 2>&1 ||:
usermod -g ${GID} ${USER}
echo "---Setting umask to ${UMASK}---"
umask ${UMASK}
echo "---Checking for optional scripts---"
if [ -f /opt/scripts/user.sh ]; then
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 +x /opt/scripts/user.sh
/opt/scripts/user.sh
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---"
fi
echo "---Starting...---"
chown -R ${UID}:${GID} /opt/scripts
echo "---Taking ownership of data...---"
chown -R root:${GID} /opt/scripts
chmod -R 750 /opt/scripts
chown -R ${UID}:${GID} ${DATA_DIR}
echo "---Starting...---"
term_handler() {
kill -SIGTERM "$killpid"
wait "$killpid" -f 2>/dev/null
kill -SIGTERM $(pgrep Wreckfest_x64.e)
tail --pid=$(pgrep Wreckfest_x64.e) -f 2>/dev/null
exit 143;
}