Skip to content

Commit

Permalink
Merge pull request #76 from joedwards32/70-unable-to-set-sv_cheats-to…
Browse files Browse the repository at this point in the history
…-true-in-cs2-docker-container

Add support for enabling/disabling cheats
  • Loading branch information
joedwards32 authored Jan 1, 2024
2 parents 57ca7da + 79d9bca commit 9aa30b2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_SERVER_HIBERNATE=0 (Put server in a low CPU state when there are no players.
0 - hibernation disabled, 1 - hibernation enabled
n.b. hibernation has been observed to trigger server crashes)
Expand Down
1 change: 1 addition & 0 deletions bullseye/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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_SERVER_HIBERNATE=0 \
CS2_PORT=27015 \
Expand Down
1 change: 1 addition & 0 deletions bullseye/etc/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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_HIBERNATE}}/${CS2_SERVER_HIBERNATE}/g" \
-e "s/{{SERVER_PW}}/${CS2_PW}/g" \
-e "s/{{SERVER_RCON_PW}}/${CS2_RCONPW}/g" \
Expand Down
1 change: 1 addition & 0 deletions bullseye/etc/server.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Server Defaults

hostname "{{SERVER_HOSTNAME}}" // Set server hostname
sv_cheats {{SERVER_CHEATS}} // Enable or disable cheats
sv_hibernate_when_empty {{SERVER_HIBERNATE}} // Disable server hibernation

// Passwords
Expand Down
1 change: 1 addition & 0 deletions examples/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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_SERVER_HIBERNATE=0 # (Put server in a low CPU state when there are no players. 0 - hibernation disabled, 1 - hibernation enabled)
- 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.)
Expand Down

0 comments on commit 9aa30b2

Please sign in to comment.