Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for control over logging configuration #89

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ TV_MAXRATE=0 (Max CSTV spectator bandwidth rate allowed, 0 == unl
TV_DELAY=0 (CSTV broadcast delay in seconds)
```

### Logs

```dockerfile
CS2_LOG="on" ('on'/'off')
CS2_LOG_MONEY=0 (Turns money logging on/off: 0=off, 1=on)
CS2_LOG_DETAIL=0 (Combat damage logging: 0=disabled, 1=enemy, 2=friendly, 3=all)
CS2_LOG_ITEMS=0 (Turns item logging on/off: 0=off, 1=on)
```

# Customizing this Container

## Pre and Post Hooks
Expand Down
4 changes: 4 additions & 0 deletions bullseye/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ ENV CS2_SERVERNAME="cs2 private server" \
TV_DELAY=0 \
SRCDS_TOKEN="" \
CS2_CFG_URL="" \
CS2_LOG="on" \
CS2_LOG_MONEY=0 \
CS2_LOG_DETAIL=0 \
CS2_LOG_ITEMS=0 \
CS2_ADDITIONAL_ARGS=""

# Set permissions on STEAMAPPDIR
Expand Down
4 changes: 4 additions & 0 deletions bullseye/etc/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ sed -i -e "s/{{SERVER_HOSTNAME}}/${CS2_SERVERNAME}/g" \
-e "s/{{TV_RELAY_PW}}/${TV_RELAY_PW}/g" \
-e "s/{{TV_MAXRATE}}/${TV_MAXRATE}/g" \
-e "s/{{TV_DELAY}}/${TV_DELAY}/g" \
-e "s/{{SERVER_LOG}}/${CS2_LOG}/g" \
-e "s/{{SERVER_LOG_MONEY}}/${CS2_LOG_MONEY}/g" \
-e "s/{{SERVER_LOG_DETAIL}}/${CS2_LOG_DETAIL}/g" \
-e "s/{{SERVER_LOG_ITEMS}}/${CS2_LOG_ITEMS}/g" \
"${STEAMAPPDIR}"/game/csgo/cfg/server.cfg

if [[ ! -z $CS2_BOT_DIFFICULTY ]] ; then
Expand Down
7 changes: 7 additions & 0 deletions bullseye/etc/server.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,10 @@ tv_relayvoice 1 // Relay voice data: 0=off, 1=on
tv_timeout 60 // CSTV connection timeout in seconds.
tv_title "{{SERVER_HOSTNAME}} CSTV" // Set title for CSTV spectator UI
tv_transmitall 1 // Transmit all entities (not only director view)

// Logs

log {{SERVER_LOG}} // Turns logging 'on' or 'off', defaults to 'on'
mp_logmoney {{SERVER_LOG_MONEY}} // Turns money logging on/off: 0=off, 1=on
mp_logdetail {{SERVER_LOG_DETAIL}} // Combat damage logging: 0=disabled, 1=enemy, 2=friendly, 3=all
mp_logdetail_items {{SERVER_LOG_ITEMS}} // Turns item logging on/off: 0=off, 1=on
8 changes: 7 additions & 1 deletion examples/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ services:
- CS2_PW=changeme # (CS2 server password)
- CS2_MAXPLAYERS=10 # (Max players)
- CS2_ADDITIONAL_ARGS # (Optional additional arguments to pass into cs2)
- CS2_CFG_URL # HTTP/HTTPS URL to fetch a Tar Gzip bundle of configuration files/mods
# Game modes
- CS2_GAMEALIAS # (Game type, e.g. casual, competitive, deathmatch. See https://developer.valvesoftware.com/wiki/Counter-Strike_2/Dedicated_Servers)
- CS2_GAMETYPE=0 # (Used if CS2_GAMEALIAS not defined. See https://developer.valvesoftware.com/wiki/Counter-Strike_2/Dedicated_Servers)
Expand All @@ -34,8 +35,13 @@ services:
- TV_RELAY_PW=changeme # CSTV password for relay proxies
- TV_MAXRATE=0 # World snapshots to broadcast per second. Affects camera tickrate.
- TV_DELAY=0 # Max CSTV spectator bandwidth rate allowed, 0 == unlimited
# Logs
- CS2_LOG=on # 'on'/'off'
- CS2_LOG_MONEY=0 # Turns money logging on/off: (0=off, 1=on)
- CS2_LOG_DETAIL=0 # Combat damage logging: (0=disabled, 1=enemy, 2=friendly, 3=all)
- CS2_LOG_ITEMS=0 # Turns item logging on/off: (0=off, 1=on)
volumes:
- cs2:/home/steam/cs2-dedicated/ # (Change /mnt/cs2 according to your volume location)
- cs2:/home/steam/cs2-dedicated/ # Persistent data volume mount point inside container
ports:
- "27015:27015/tcp" # TCP
- "27015:27015/udp" # UDP
Expand Down
Loading