~ cleaned develop branch
This commit is contained in:
parent
102a1c21e7
commit
15389f7da6
39
Dockerfile
39
Dockerfile
@ -1,39 +0,0 @@
|
|||||||
FROM jusito/lgsm:latest
|
|
||||||
|
|
||||||
ENV LGSM_GAMESERVER="gmodserver" \
|
|
||||||
LGSM_EXECUTABLE="gmodserver" \
|
|
||||||
LGSM_STOP_SCRIPT="/home/stop.sh" \
|
|
||||||
GAMECONFIG_SCRIPT="/home/config.sh" \
|
|
||||||
\
|
|
||||||
WORKSHOP_COLLECTION_ID="" \
|
|
||||||
SERVER_NAME="" \
|
|
||||||
SERVER_PASSWORD="" \
|
|
||||||
SERVER_VOICE_ENABLE="1" \
|
|
||||||
\
|
|
||||||
INSTALL_CSS=false \
|
|
||||||
INSTALL_HL2=false \
|
|
||||||
INSTALL_HLDM=false \
|
|
||||||
INSTALL_TF2=false \
|
|
||||||
\
|
|
||||||
CSS_PATH="/home/steam/addons/css" \
|
|
||||||
HL2_PATH="/home/steam/addons/hl2" \
|
|
||||||
HLDM_PATH="/home/steam/addons/hldm" \
|
|
||||||
TF2_PATH="/home/steam/addons/tf2" \
|
|
||||||
\
|
|
||||||
USE_MY_REPLACER_CONFIG=false
|
|
||||||
|
|
||||||
COPY ["config.sh", "stop.sh", "forceWorkshopDownload.sh", "installAndMountAddons.sh", "/home/"]
|
|
||||||
|
|
||||||
RUN chown "$DOCKER_USER:$DOCKER_USER" "/home/config.sh" && \
|
|
||||||
chown "$DOCKER_USER:$DOCKER_USER" "/home/stop.sh" && \
|
|
||||||
chown "$DOCKER_USER:$DOCKER_USER" "/home/forceWorkshopDownload.sh" && \
|
|
||||||
chown "$DOCKER_USER:$DOCKER_USER" "/home/installAndMountAddons.sh" && \
|
|
||||||
\
|
|
||||||
chmod a=rx /home/config.sh && \
|
|
||||||
chmod a=rx /home/stop.sh && \
|
|
||||||
chmod a=rx /home/forceWorkshopDownload.sh && \
|
|
||||||
chmod a=rx /home/installAndMountAddons.sh
|
|
||||||
|
|
||||||
USER "$USER_ID:$GROUP_ID"
|
|
||||||
|
|
||||||
VOLUME "$SERVER_PATH"
|
|
101
README.md
101
README.md
@ -1,101 +0,0 @@
|
|||||||
# GMOD TTT
|
|
||||||
GMOD TTT server image, https://hub.docker.com/r/jusito/
|
|
||||||
|
|
||||||
## TODO
|
|
||||||
* sv_password not working
|
|
||||||
* rcon not working
|
|
||||||
* scrds doesn't like different internal / external ports (thats why no ports are exposed)
|
|
||||||
* replacer config in other repo u2d?
|
|
||||||
* health check -> details
|
|
||||||
* volume for steam workshop
|
|
||||||
* volume for other games
|
|
||||||
* volume for gmod config
|
|
||||||
* AppArmor Profile
|
|
||||||
|
|
||||||
## Getting Started
|
|
||||||
1. Create public workshop collection without maps, dummy ID:=123456. Use `jusito/docker-ttt [...] +host_workshop_collection 123456`. Create a collection with maps ID:=7891011 and add/link it to 123456. If you want the clients to automatically load the collection from the workshop when connecting without subscribing, use `-e WORKSHOP_COLLECTION_ID=123456`. The users loading all non-maps at startup and the map if needed, but you don't need to point them to the collection in the workshop.
|
|
||||||
2. Do this elements need CSS, HL2, HLDM, TF2? Use `-e INSTALL_CSS=true` or `-e INSTALL_HL2=true` aso.
|
|
||||||
3. Which ports? 27015/udp is default for game traffic x/tcp for rcon, for 27016 you would use `-p 27016:27016/udp [...] jusito/docker-ttt [...] -port 27016`.
|
|
||||||
4. Set environment variables like servername `-e SERVER_NAME="My Server"`, password `-e SERVER_PASSWORD="securepw"` and timezone for cron `-e TZ="Europe/Berlin"`, default short downtime at Sunday 10 o'clock.
|
|
||||||
5. Add options for server like startmap `+map ttt_rooftops_2016_v1` and max players `-maxplayers 10`
|
|
||||||
|
|
||||||
### run example without rcon
|
|
||||||
```
|
|
||||||
docker run -d \
|
|
||||||
-e INSTALL_CSS=true \
|
|
||||||
-p 27015:27015/udp \
|
|
||||||
-e SERVER_NAME="My Server" \
|
|
||||||
-e SERVER_PASSWORD="securepw" \
|
|
||||||
-e TZ="Europe/Berlin" \
|
|
||||||
jusito/docker-ttt:gmod_ttt_debian \
|
|
||||||
-port 27015 \
|
|
||||||
+map ttt_rooftops_2016_v1 \
|
|
||||||
-maxplayers 10
|
|
||||||
```
|
|
||||||
|
|
||||||
### run example with rcon
|
|
||||||
```
|
|
||||||
docker run -d \
|
|
||||||
-e WORKSHOP_COLLECTION_ID=123456 \
|
|
||||||
-e INSTALL_CSS=true \
|
|
||||||
-p 27015:27015/udp -p 27015:27015/tcp \
|
|
||||||
-e SERVER_NAME="My Server" \
|
|
||||||
-e SERVER_PASSWORD="securepw" \
|
|
||||||
-e TZ="Europe/Berlin" \
|
|
||||||
jusito/docker-ttt:gmod_ttt_debian \
|
|
||||||
-port 27015 \
|
|
||||||
+map ttt_rooftops_2016_v1 \
|
|
||||||
-maxplayers 10 \
|
|
||||||
-usercon +rcon_password "yourPW"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Tags
|
|
||||||
* lgsm\_debian - Linux Game Server Manager in Debian
|
|
||||||
* gmod\_debian - Garrys Mod with Debian and LGSM
|
|
||||||
* gmod\_ttt\_debian
|
|
||||||
|
|
||||||
## Environment Variables
|
|
||||||
|
|
||||||
### Server Properties
|
|
||||||
### additional config
|
|
||||||
### Internal Used (don't change please)
|
|
||||||
|
|
||||||
## GMOD Parameters
|
|
||||||
|
|
||||||
## LGSM Usage
|
|
||||||
docker exec -it CONTAINER ./home/steam/gmodserver console
|
|
||||||
|
|
||||||
## File Locations
|
|
||||||
### Volumes
|
|
||||||
|
|
||||||
### Other
|
|
||||||
|
|
||||||
|
|
||||||
## environment variables
|
|
||||||
If set every workshop item at the collection is added as forced, that means its automatically downloaded on connecting. Don't add collections with maps here just like weapons aso.
|
|
||||||
WORKSHOP_COLLECTION_ID=
|
|
||||||
|
|
||||||
This variables are used to write the value to the server.cfg:
|
|
||||||
SERVER_NAME=""
|
|
||||||
SERVER_PASSWORD=""
|
|
||||||
SERVER_VOICE_ENABLE="1"
|
|
||||||
|
|
||||||
If set to "true" the game is installed and mounted, most of the time you want to add the css content.
|
|
||||||
INSTALL_CSS=false
|
|
||||||
INSTALL_HL2=false
|
|
||||||
INSTALL_HLDM=false
|
|
||||||
INSTALL_TF2=false
|
|
||||||
|
|
||||||
## server config
|
|
||||||
http://ttt.badking.net/config-and-commands/convars
|
|
||||||
https://wiki.garrysmod.de/server.cfg
|
|
||||||
|
|
||||||
Path in container is:
|
|
||||||
docker cp "your server.cfg path" CONTAINER:/home/steam/serverfiles/garrysmod/cfg/server.cfg
|
|
||||||
|
|
||||||
|
|
||||||
## Additional
|
|
||||||
- Debian Buster, one dependency is missing: https://packages.debian.org/search?keywords=lib32tinfo5
|
|
||||||
- Alpine, steamcmd doesn't like musl
|
|
||||||
### Debian Buster
|
|
||||||
Currently one dependency is missing: https://packages.debian.org/search?keywords=lib32tinfo5
|
|
64
config.sh
64
config.sh
@ -1,64 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
#create default server.config
|
|
||||||
if [ ! -e "${SERVER_PATH}/garrysmod/cfg/server.cfg" ] || [ "0" = "$(grep -o '[^[:space:]]' "${SERVER_PATH}/garrysmod/cfg/server.cfg" | wc -l)" ]; then
|
|
||||||
mkdir -p "${SERVER_PATH}/garrysmod/cfg"
|
|
||||||
wget -O "${SERVER_PATH}/garrysmod/cfg/server.cfg" "https://raw.githubusercontent.com/jusito/docker-ttt/master/server.cfg"
|
|
||||||
chown "$USER_ID:$GROUP_ID" "${SERVER_PATH}/garrysmod/cfg/server.cfg"
|
|
||||||
chmod u+rw "${SERVER_PATH}/garrysmod/cfg/server.cfg"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#set hostname & password, working if only one entry is in
|
|
||||||
function configReplace() {
|
|
||||||
source="$1"
|
|
||||||
target="$source \"$2\""
|
|
||||||
count=$(grep -Po "($source).+" "${SERVER_PATH}/garrysmod/cfg/server.cfg" | wc -l)
|
|
||||||
|
|
||||||
echo "Request for replacing $source to $target, source is found $count times"
|
|
||||||
|
|
||||||
if [ "$count" == "1" ]; then
|
|
||||||
source=$(grep -Po "($source).+" "${SERVER_PATH}/garrysmod/cfg/server.cfg" | sed 's/\\/\\\\/g' | sed 's/\//\\\//g')
|
|
||||||
target=$(echo "$target" | sed 's/\\/\\\\/g' | sed 's/\//\\\//g')
|
|
||||||
sed -i "s/$source/$target/g" "${SERVER_PATH}/garrysmod/cfg/server.cfg"
|
|
||||||
elif [ "$count" == "0" ]; then
|
|
||||||
echo "" >> "${SERVER_PATH}/garrysmod/cfg/server.cfg"
|
|
||||||
echo "$target" >> "${SERVER_PATH}/garrysmod/cfg/server.cfg"
|
|
||||||
else
|
|
||||||
echo "can't set $1 because there are multiple in"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
if [ -n "${SERVER_NAME}" ]; then
|
|
||||||
configReplace "hostname" "$SERVER_NAME"
|
|
||||||
fi
|
|
||||||
if [ -n "${SERVER_PASSWORD}" ]; then
|
|
||||||
configReplace "sv_password" "$SERVER_PASSWORD"
|
|
||||||
fi
|
|
||||||
if [ -n "${SERVER_VOICE_ENABLE}" ]; then
|
|
||||||
configReplace "sv_voiceenable" "$SERVER_VOICE_ENABLE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#this is a simple option for one of my mods, but you can use it too
|
|
||||||
if [ "$USE_MY_REPLACER_CONFIG" = "true" ] && [ ! -e "${SERVER_PATH}/garrysmod/data/jusito_ttt_entity_replace" ]; then
|
|
||||||
mkdir -p "${SERVER_PATH}/garrysmod/data/jusito_ttt_entity_replace"
|
|
||||||
wget -O "${SERVER_PATH}/garrysmod/data/jusito_ttt_entity_replace/config.txt" "https://raw.githubusercontent.com/jusito/ttt_entity_replace/master/config.txt.example_fas2"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "force workshop download"
|
|
||||||
./home/forceWorkshopDownload.sh
|
|
||||||
echo "install & mount gamefiles"
|
|
||||||
./home/installAndMountAddons.sh
|
|
||||||
cd "$STEAM_PATH"
|
|
||||||
|
|
||||||
#docker args -> lgsm args
|
|
||||||
export parms="-game garrysmod +gamemode terrortown "$(printf "%s " "$@")
|
|
||||||
if [ -e "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/gmodserver.cfg" ]; then
|
|
||||||
rm -f "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/gmodserver.cfg"
|
|
||||||
fi
|
|
||||||
mkdir -p "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/"
|
|
||||||
touch "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/gmodserver.cfg"
|
|
||||||
echo "fn_parms(){" > "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/gmodserver.cfg"
|
|
||||||
echo "parms="'"'"$parms"'"' >> "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/gmodserver.cfg"
|
|
||||||
echo "}" >> "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/gmodserver.cfg"
|
|
||||||
echo "starting with $parms"
|
|
Loading…
Reference in New Issue
Block a user