Sign inSign up

jusito/docker-ttt

By jusito

Updated 11 months ago

Creates an easy server for GMOD gamemode TTT based on lgsm.

Image
5

100K+

jusito/docker-ttt repository overview

GMOD TTT

GMOD TTT server image, https://hub.docker.com/r/jusito/

Important

If you use the old image, you should check the environment variables. For example arguments after image name aren't used, use instead -e SERVER_ADDITIONAL_PARAMETERS=.... This readme may not be perfect, if you struggle at some point or you see incorrect informations create an issue at git please.

Getting Started

Prepare your server content
  1. Create public workshop collection without maps, dummy ID:=123456. Use -e WORKSHOP_COLLECTION_ID 123456.
  2. Create public workshop collection with maps and add this one to "123456".
  3. Do you want every user to load the content automatically? Yes you are done, no -e WORKSHOP_AUTOLOAD=false. Remember that "false" mean, that every user has to manually subscribe to your collection. If you don't separate maps / others, every connecting user would load all maps on first connecting. This would be a pain for some.
  4. Do your content needs CSS, HL2, HLDM, TF2? Use -e INSTALL_CSS=true and/or -e INSTALL_HL2=true and so on. Most content will need at least CSS.
Server config
  1. Pick your ports -e SERVER_PORT=27015 -p 27015:27015/udp both are always needed. For RCON [...] -e SERVER_RCON_PASSWORD="verySecure" -p 27015:27015/tcp.
  2. 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.
  3. Choose startmap (can be from workshop collection, even linked) -e SERVER_DEFAULT_MAP=ttt_rooftops_2016_v1 and max players -e SERVER_MAX_PLAYERS=20
  4. Get a volume name -v TTTDev:/home/steam/serverfiles
run example without rcon

If you need rcon only sometimes, use ulx with this config.

docker run -d \
 -p 27015:27015/udp \
 -e SERVER_PORT=27015 \
 -e INSTALL_CSS=true \
 -e WORKSHOP_COLLECTION_ID=123456 \
 -e SERVER_NAME="My Server" \
 -e SERVER_PASSWORD="securepw" \
 -e SERVER_DEFAULT_MAP="ttt_lttp_kakariko_a5" \
 -v TTTDev:/home/steam/serverfiles \
 --name "MyTTTServer" \
 jusito/docker-ttt:gmod_ttt_debian
run example with rcon
docker run -d \
 -p 27015:27015/udp \
 -e SERVER_PORT=27015 \
 -e INSTALL_CSS=true \
 -e WORKSHOP_COLLECTION_ID=123456 \
 -e SERVER_NAME="My Server" \
 -e SERVER_PASSWORD="securepw" \
 -e SERVER_DEFAULT_MAP="ttt_lttp_kakariko_a5" \
 -v TTTDev:/home/steam/serverfiles \
 -p 27015:27015/tcp \
 -e SERVER_RCON_PASSWORD="securePW" \
 --name "MyTTTServer" \
 jusito/docker-ttt:gmod_ttt_debian

Tags

  • lgsm_debian - Linux Game Server Manager in Debian
  • gmod_debian - Garrys Mod with Debian and LGSM
  • gmod_ttt_debian - Gamemode TTT with LGSM/Debian

Environment Variables

Because you will most likely use many environmental variables, I recommend a env list. Instead of -e VARNAME="VALUE 1" write one additional text file:

TTT.env:

VARNAME=Value 1
SERVER_NAME=My Hood
SERVER_PASSWORD=Secure_PW
LGSM Properties
Free to change
NameDefaultDescription
CRON_MONITOR"*/5 * * * *"Every 5 minutes LGSM checks if the server is running and responding, rebooting if needed.
CRON_UPDATE"*/30 * * * *"Every 30 minutes LGSM checks if game server needs an update which will be executed.
CRON_FORCE_UPDATE"0 10 * * 0"At Sunday 10:00 force update and restart
CRON_LOG_ROTATE"0 9 * * 0"Rotate log at Stunday 9:00
TZEurope/BerlinSet timezone for CRON / log
Used for subimage
NameDefaultDescription
SERVER_EXECUTABLE""Name of the lgsm script after installation
SERVER_GAME""LGSM name of installation
LGSM Internal
LGSM Internal Properties (click me)

NameDefaultDescription
STEAM_PATH/home/steamprimary workdir, homedir of user
SERVER_PATH/home/steam/serverfilesPath to serverfiles after installation
STEAM_CMD/home/steam/steamcmdPath to steamcmd files
GROUP_ID10000Group ID of the user
USER_ID10000User ID of the user
DOCKER_USERsteamName of the user
SUPERCRONIC_URLhttps://github.com/aptible/supercronic/releases/download/v0.1.9/supercronic-linux-amd64CRON version
SUPERCRONICsupercronic-linux-amd64CRON name after download
SUPERCRONIC_SHA1SUM5ddf8ea26b56d4a7ff6faecdd8966610d5cb9d85CRC for CRON download
DEBIAN_FRONTENDnoninteractiveDon't ask questions during installation
LANGC.UTF-8Language set
TERMxterm
DEBUGGINGfalse

GMOD Properties
GMOD Content
NameDefaultDescription
INSTALL_CSSfalseShould I install and mount CSS?
INSTALL_HL2falseShould I install and mount HL2?
INSTALL_HLDMfalseShould I install and mount HLDM?
INSTALL_TF2falseShould I install and mount TF2?
WORKSHOP_COLLECTION_ID""Workshop Collection ID for the server. If you use AUTOLOAD you should add maps on a linked collection
WORKSHOP_API_KEY""Maybe needed for private content.
WORKSHOP_AUTOLOADtrueEvery item which is on the given collection, will be downloaded by every client. Elements on linked collections not - so use maps in a linked collection.
GMOD Server
NameDefaultDescription
SERVER_NAMELinuxGSM
SERVER_PASSWORD""
SERVER_RCON_PASSWORD""
SERVER_VOICE_ENABLE1
SERVER_IP0.0.0.0
SERVER_PORT27015
SERVER_CLIENTPORT27005
SERVER_SOURCETVPORT27020
SERVER_DEFAULT_MAPgm_construct
SERVER_MAX_PLAYERS16
SERVER_TICKRATE66
SERVER_GAMEMODEsandbox
SERVER_LOGIN_TOKEN""
SERVER_ADDITIONAL_PARAMETERS-disableluarefresh
GMOD LGSM specific

These variables are untested, but if they dont work report it please too. Documentation

NameDefaultDescription
LGSM_DISPLAYIP""
LGSM_POSTALERToff
LGSM_POSTDAYS7
LGSM_POSTTARGEThttps://hastebin.com
LGSM_DISCORDALERToff
LGSM_DISCORDWEBHOOKwebhook
LGSM_EMAILALERToff
LGSM_EMAIL[email protected]
LGSM_EMAILFROM""
LGSM_IFTTTALERToff
LGSM_IFTTTTOKENaccesstoken
LGSM_IFTTTEVENTlinuxgsm_alert
LGSM_MAILGUNALERToff
LGSM_MAILGUNTOKENaccesstoken
LGSM_MAILGUNDOMAINexample.com
LGSM_MAILGUNEMAILFROM[email protected]
LGSM_MAILGUNEMAIL[email protected]
LGSM_PUSHBULLETALERToff
LGSM_PUSHBULLETTOKENaccesstoken
LGSM_CHANNELTAG""
LGSM_PUSHOVERALERToff
LGSM_PUSHOVERTOKENaccesstoken
LGSM_TELEGRAMALERToff
LGSM_TELEGRAMTOKENaccesstoken
LGSM_TELEGRAMCHATID""
LGSM_CURLCUSTOMSTRING""
LGSM_UPDATEONSTARToff
LGSM_MAXBACKUPS4
LGSM_MAXBACKUPDAYS30
LGSM_STOPONBACKUPon
LGSM_CONSOLELOGGINGon
LGSM_LOGDAYS7
LGSM_QUERYDELAY5
LGSM_BRANCH""
LGSM_STEAMMASTERtrue"
GMOD Internal
GMOD Internal Properties (click me)

NameDefaultDescription
CSS_PATH/home/steam/addons/css
HL2_PATH/home/steam/addons/hl2
HLDM_PATH/home/steam/addons/hldm
TF2_PATH/home/steam/addons/tf2
SERVER_EXECUTABLEgmodserver
SERVER_GAMEgmodserver

TTT Properties
TTT Internal Properties
NameDefaultDescription
SERVER_GAMEMODE"terrortown"

LGSM Usage

The container provides links to LGSM commands:

  • docker exec -it CONTAINER details // print various informations like passwords, name, players, status aso.
  • docker exec -it CONTAINER backup
  • docker exec -it CONTAINER console // let you view the current console, docker logs will not work
  • docker exec -it CONTAINER debug
  • docker exec -it CONTAINER force-update
  • docker exec -it CONTAINER install
  • docker exec -it CONTAINER monitor
  • docker exec -it CONTAINER postdetails
  • docker exec -it CONTAINER restart
  • docker exec -it CONTAINER start
  • docker exec -it CONTAINER stop
  • docker exec -it CONTAINER test-alert
  • docker exec -it CONTAINER update
  • docker exec -it CONTAINER update-lgsm
  • docker exec -it CONTAINER validate

File Locations

Volumes

/home/steam/serverfiles

Other

server.cfg: /home/steam/serverfiles/garrysmod/cfg/gmodserver.cfg
hostname, password, rcon password, voice enabled are managed / will be overwritten

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/gmodserver.cfg

Additional

TODO
image improvements
  • volume for steam workshop
  • volume for other games
  • volume for gmod config (data folder)
  • AppArmor Profile
image config, description needed
  • scrds doesn't like different internal / external ports (thats why no ports are exposed)
  • health check -> details
For local usage

navigate to directory with readme.md bash test/testBuild.sh (sh doesn't like pipefail, escape if you want to use sh)

FTP Server

  • If your Volume is TTTDev
  • If you didn't change UserID / GroupID
  • If you want to connect to ftp://...:123 (ports 122/123 are free on your network)
For FileZilla
docker run -d \
 -e MY_NAME="docker" -e MY_PASSWORD="MySecurePW" \
 -e MY_USER_ID="10000" -e MY_GROUP_ID="10000" \
 -p 122:20 -p 123:21 -p 10090-10100:10090-10100 \
 -v TTTDev:/home/docker/ \
 jusito/vsftpd-alpine:simple
For Windows Network Mount
  • IP of the Host (not container) 1.2.3.4
  • Mount: ftp://1.2.3.4:123
docker run -d \
 -e MY_NAME="docker" -e MY_PASSWORD="MySecurePW" \
 -e MY_USER_ID="10000" -e MY_GROUP_ID="10000" \
 -p 122:20 -p 123:21 -p 10090-10100:10090-10100 \
 -v TTTDev:/home/docker/ \
 -e pasv_address="1.2.3.4" \
 jusito/vsftpd-alpine:simple

Synchronize the voice enabled / disabled state with Teamspeak

See jusito/ttt_voice_sync

Tag summary

Content type

Image

Digest

sha256:3bf3ddb3d

Size

106.1 MB

Last updated

11 months ago

docker pull jusito/docker-ttt