Compare commits

...

7 Commits

Author SHA1 Message Date
790fb30018 added SM_ADMIN
All checks were successful
continuous-integration/drone/push Build is passing
2023-02-23 22:00:43 +01:00
da36bdaeb3 updated metamod and sourcemod
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-12 16:10:35 +01:00
1df6faecee added MAP_ROTATION
All checks were successful
continuous-integration/drone/push Build is passing
2022-04-29 22:51:43 +02:00
f13b588da9 drone docker hub
All checks were successful
continuous-integration/drone/push Build is passing
2021-12-30 12:15:07 +01:00
1ed2371973 added sourcemod / metamod 2021-11-16 19:09:05 +01:00
a78b4c1c13 remove validate 2021-11-16 16:56:33 +01:00
1f31e22719 added image tag to docker compose file 2021-10-28 21:09:40 +02:00
5 changed files with 50 additions and 4 deletions

View File

@@ -5,5 +5,10 @@ steps:
- name: docker
image: plugins/docker
settings:
repo: docker.kapelle.org/csgo
registry: docker.kapelle.org
repo: djeeberjr/csgo-docker
username: djeeberjr
password:
from_secret: DOCKER_HUB_TOKEN
trigger:
branch:
- master

View File

@@ -8,4 +8,7 @@ USER steam
VOLUME /home/steam/server
WORKDIR /home/steam/
ENV METAMOD_DL_URL "https://mms.alliedmods.net/mmsdrop/1.12/mmsource-1.12.0-git1165-linux.tar.gz"
ENV SOURCEMOD_DL_URL "https://sm.alliedmods.net/smdrop/1.12/sourcemod-1.12.0-git6968-linux.tar.gz"
ENTRYPOINT /home/steam/entrypoint.sh

View File

@@ -24,6 +24,10 @@
`GAMEMODE`: What gamemode to load. Not the same as the `game_mode` cvar. Value gets translated to a gamemode/gametype combination. Available values are: `casual`,`competitive`, `wingman`, `armsrace`, `deathmatch`, `custom`, `coop`, `dangerzone`, `weaponexpert`,`demolition`,`stab_zap`,`ffa`,`flying_scoutsman`,`trigger_discipline`,`headshots`,`hunter_gatherers`,`retakes`,`competitive_short`. For more information see [here](https://developer.valvesoftware.com/wiki/CS:GO_Game_Mode_Commands).
`MAP_ROTATION` comma separated list of maps to populate the `mapcycle.txt` and `maplist.txt` files.
`SM_ADMIN` comma separated list of ids to grand admin privileges e.g. "STEAM_0:1:57874277", "!127.0.0.1"
# Custom conVars
You can set ANY other variable by just prefixing the conVar with `CVAR_`. So for example if you want to set `mp_disable_autokick 1` just set the enviroment variable `CVAR_MP_DISABLE_AUTOKICK` to `1`. Upper or lower case is ignored.

View File

@@ -3,6 +3,7 @@ version: "3"
services:
csgo:
build: .
image: docker.io/djeeberjr/csgo-docker
environment:
- INSECURE=true
- MAX_PLAYERS=16
@@ -14,6 +15,7 @@ services:
- GAMEMODE=retakes
- RCONPW=password123
- CVAR_MP_DISABLE_AUTOKICK=1
- MAP_ROTATION=de_nuke,de_dust2,workshop/298621139/am_trainyard
volumes:
- csgo_game:/home/steam/server
ports:
@@ -26,4 +28,4 @@ services:
volumes:
csgo_game:
name: csgo_game
name: csgo_game

View File

@@ -2,7 +2,26 @@
set -eo pipefail
/home/steam/steamcmd/steamcmd.sh +login anonymous +force_install_dir /home/steam/server +app_update 740 validate +quit
/home/steam/steamcmd/steamcmd.sh +force_install_dir /home/steam/server +login anonymous +app_update 740 +quit
if [ ! -e "$HOME/server/csgo/addons/metamod.vdf" ]; then
echo "Installing Metamod"
curl "$METAMOD_DL_URL" -o /tmp/metamod.tar.gz
tar -xf /tmp/metamod.tar.gz -C "$HOME/server/csgo"
rm /tmp/metamod.tar.gz
echo "Install Sourcemod"
curl "$SOURCEMOD_DL_URL" -o /tmp/sourcemod.tar.gz
tar -xf /tmp/sourcemod.tar.gz -C "$HOME/server/csgo"
rm /tmp/sourcemod.tar.gz
fi
if [ -n "$MAP_ROTATION" ]; then
echo -n "$MAP_ROTATION" | sed 's/,/\n/g' | tee "$HOME/server/csgo/mapcycle.txt" "$HOME/server/csgo/maplist.txt"
else
echo -n "" | tee "$HOME/server/csgo/mapcycle.txt" "$HOME/server/csgo/maplist.txt"
fi
SRCDS_ARGS="-usercon"
@@ -23,6 +42,11 @@ if [ -n "$INSECURE" ]; then
echo "Running with VAC disabled."
fi
if [ -n "$NOMASTER" ]; then
SRCDS_ARGS="${SRCDS_ARGS} -nomaster"
echo "Running with nomaster."
fi
if [ -n "$MAX_PLAYERS" ]; then
SRCDS_ARGS="${SRCDS_ARGS} -maxplayers $MAX_PLAYERS"
echo "Maxplayers set to ${MAX_PLAYERS}."
@@ -130,6 +154,14 @@ if [ -n "$WORKSHOP_COLLECTION" ]; then
fi
fi
mkdir -p "/home/steam/server/csgo/addons/sourcemod/configs/"
echo "// Autogenerated. DO NOT EDIT. Sourcemod admin can be added with the SM_ADMIN environment variable" \
> "/home/steam/server/csgo/addons/sourcemod/configs/admins_simple.ini"
for id in $(echo "$SM_ADMIN" | sed 's/,/\n/g')
do
echo "\"$id\" \"99:z\"" >> "/home/steam/server/csgo/addons/sourcemod/configs/admins_simple.ini"
done
CVARS=$(env | awk -F "=" '/^CVAR_/ { sub("CVAR_","",$1); print "+"tolower($1),($2 ~ /^[0-9]+$/)?$2:"\""$2"\""," "}' | tr -d "\n")
echo "Running command: srcds_run -game csgo $SRCDS_ARGS $CVARS"