Skip to content

Commit

Permalink
Merge pull request #91 from joedwards32/auto-validate
Browse files Browse the repository at this point in the history
Add support for steamcmd app validation
  • Loading branch information
joedwards32 authored Feb 22, 2024
2 parents f1ffd92 + d6cb895 commit 41f0374
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ CS2_LOG_ITEMS=0 (Turns item logging on/off: 0=off, 1=on)

# Customizing this Container

## Validating Game Files

If you break the game through your customisations and want steamcmd to validate and redownload then set the `STEAMAPPVALIDATE` environment variable to `1`:

```dockerfile
STEAMAPPVALIDATE=0 (0=skip validation, 1=validate game files)
```

## Pre and Post Hooks

The container includes two scripts for executing custom actions:
Expand Down
1 change: 1 addition & 0 deletions bullseye/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ LABEL maintainer="[email protected]"
ENV STEAMAPPID 730
ENV STEAMAPP cs2
ENV STEAMAPPDIR "${HOMEDIR}/${STEAMAPP}-dedicated"
ENV STEAMAPPVALIDATE 0

COPY etc/entry.sh "${HOMEDIR}/entry.sh"
COPY etc/server.cfg "/etc/server.cfg"
Expand Down
8 changes: 7 additions & 1 deletion bullseye/etc/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ mkdir -p "${STEAMAPPDIR}" || true

# Download Updates

if [[ "$STEAMAPPVALIDATE" -eq 1 ]]; then
VALIDATE="validate"
else
VALIDATE=""
fi

bash "${STEAMCMDDIR}/steamcmd.sh" +force_install_dir "${STEAMAPPDIR}" \
+login anonymous \
+app_update "${STEAMAPPID}" \
+app_update "${STEAMAPPID}" "${VALIDATE}"\
+quit

# steamclient.so fix
Expand Down
1 change: 1 addition & 0 deletions examples/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
environment:
# Server configuration
- SRCDS_TOKEN # Game Server Token from https://steamcommunity.com/dev/managegameservers
- STEAMAPPVALIDATE=0 # (0 - no validation, 1 - enable validation)
- 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)
Expand Down

0 comments on commit 41f0374

Please sign in to comment.