From af5c45a01e72856252f0453f0cb58a6092383798 Mon Sep 17 00:00:00 2001 From: John Edwards Date: Sun, 31 Dec 2023 16:43:39 +0000 Subject: [PATCH] Add support for enabling/disabling cheats --- README.md | 1 + bullseye/Dockerfile | 1 + bullseye/etc/entry.sh | 1 + bullseye/etc/server.cfg | 1 + examples/docker-compose.yml | 1 + 5 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 8b475b3..765e286 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ Feel free to overwrite these environment variables, using -e (--env): ```dockerfile SRCDS_TOKEN="" (Game Server Token from https://steamcommunity.com/dev/managegameservers) CS2_SERVERNAME="changeme" (Set the visible name for your private server) +CS2_CHEATS=0 (0 - disable cheats, 1 - enable cheats) CS2_IP="" (CS2 server listening IP address, 0.0.0.0 - all IP addresses on the local machine, empty - IP identified automatically) CS2_PORT=27015 (CS2 server listen port tcp_udp) CS2_RCON_PORT="" (Optional, use a simple TCP proxy to have RCON listen on an alternative port. diff --git a/bullseye/Dockerfile b/bullseye/Dockerfile index 35c4455..056566c 100644 --- a/bullseye/Dockerfile +++ b/bullseye/Dockerfile @@ -39,6 +39,7 @@ RUN set -x \ FROM build_stage AS bullseye-base ENV CS2_SERVERNAME="cs2 private server" \ + CS2_CHEATS=0 \ CS2_IP=0.0.0.0 \ CS2_PORT=27015 \ CS2_RCON_PORT="" \ diff --git a/bullseye/etc/entry.sh b/bullseye/etc/entry.sh index d4c977a..2aa09b0 100644 --- a/bullseye/etc/entry.sh +++ b/bullseye/etc/entry.sh @@ -34,6 +34,7 @@ fi # Rewrite Config Files sed -i -e "s/{{SERVER_HOSTNAME}}/${CS2_SERVERNAME}/g" \ + -e "s/{{SERVER_CHEATS}}/${CS2_CHEATS}/g" \ -e "s/{{SERVER_PW}}/${CS2_PW}/g" \ -e "s/{{SERVER_RCON_PW}}/${CS2_RCONPW}/g" \ -e "s/{{TV_ENABLE}}/${TV_ENABLE}/g" \ diff --git a/bullseye/etc/server.cfg b/bullseye/etc/server.cfg index 007e8a4..0636e75 100644 --- a/bullseye/etc/server.cfg +++ b/bullseye/etc/server.cfg @@ -1,6 +1,7 @@ // Server Defaults hostname "{{SERVER_HOSTNAME}}" // Set server hostname +sv_cheats {{SERVER_CHEATS}} // Enable or disable cheats // Passwords diff --git a/examples/docker-compose.yml b/examples/docker-compose.yml index e875e6c..1952dce 100644 --- a/examples/docker-compose.yml +++ b/examples/docker-compose.yml @@ -7,6 +7,7 @@ services: # Server configuration - SRCDS_TOKEN # Game Server Token from https://steamcommunity.com/dev/managegameservers - CS2_SERVERNAME=changeme # (Set the visible name for your private server) + - CS2_CHEATS=0 # (0 - disable cheats, 1 - enable cheats) - CS2_PORT=27015 # (CS2 server listen port tcp_udp) - CS2_RCON_PORT # (Optional, use a simple TCP proxy to have RCON listen on an alternative port. Useful for services like AWS Fargate which do not support mixed protocol ports.) - CS2_LAN=0 # (0 - LAN mode disabled, 1 - LAN Mode enabled)