Compare commits
44 Commits
Author | SHA1 | Date | |
---|---|---|---|
662735613a | |||
2179a74156
|
|||
a0438fb352
|
|||
124cc75a92
|
|||
f596f40e33
|
|||
364fa60958
|
|||
f9b39be6ea
|
|||
24aeb8cd48
|
|||
d73fd2b929
|
|||
2b8ac05860
|
|||
13103cb707
|
|||
0581995a64
|
|||
a0a00c890b
|
|||
82145dfd51
|
|||
ec24d2b482
|
|||
a9d3c77c74
|
|||
eed75485e4
|
|||
2f56450a11
|
|||
84f6c7bb8b
|
|||
1db1f0e449
|
|||
cdf5996a67
|
|||
01f5fcda06
|
|||
b3f9cb4842
|
|||
9d1dacb945
|
|||
6ba7468dd4
|
|||
3b192e28bc
|
|||
7ca7819dc0
|
|||
0caa74af9a
|
|||
24879524a6
|
|||
35fc6ee142
|
|||
0bd1533ef6
|
|||
e4aa81e92a
|
|||
131b462758
|
|||
297455987c
|
|||
e95ce85316
|
|||
47458f163f
|
|||
75c287c7bd
|
|||
47e19ffa0f
|
|||
23c470fecf
|
|||
a9c4531631
|
|||
a22d360486
|
|||
17db75f9f1
|
|||
05ea38dd93
|
|||
4a0251f92c
|
12
Dockerfile
12
Dockerfile
@@ -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
|
||||
|
35
README.md
35
README.md
@@ -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!
|
||||
|
@@ -1,5 +0,0 @@
|
||||
[OnlineSubsystem]
|
||||
ServerName=Docker ConanExile
|
||||
ServerPassword=Docker
|
||||
|
||||
|
@@ -1,3 +0,0 @@
|
||||
[ServerSettings]
|
||||
MaxNudity=2
|
||||
AdminPassword=adminDocker
|
3
scripts/start-gotty.sh
Normal file
3
scripts/start-gotty.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
sleep 5
|
||||
TERM=linux gotty ${GOTTY_PARAMS} screen -xS Wreckfest
|
@@ -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
|
@@ -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
|
||||
echo "---Found optional script, executing---"
|
||||
chmod +x /opt/scripts/user.sh
|
||||
/opt/scripts/user.sh
|
||||
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---"
|
||||
else
|
||||
echo "---No optional script found, continuing---"
|
||||
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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user