Merge pull request #91 from joedwards32/auto-validate

Add support for steamcmd app validation
This commit is contained in:
John Edwards 2024-02-22 12:13:09 +00:00 committed by GitHub
commit 41f0374063
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 17 additions and 1 deletions

View file

@ -110,6 +110,14 @@ CS2_LOG_ITEMS=0 (Turns item logging on/off: 0=off, 1=on)
# Customizing this Container # 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 ## Pre and Post Hooks
The container includes two scripts for executing custom actions: The container includes two scripts for executing custom actions:

View file

@ -11,6 +11,7 @@ LABEL maintainer="joedwards32@gmail.com"
ENV STEAMAPPID 730 ENV STEAMAPPID 730
ENV STEAMAPP cs2 ENV STEAMAPP cs2
ENV STEAMAPPDIR "${HOMEDIR}/${STEAMAPP}-dedicated" ENV STEAMAPPDIR "${HOMEDIR}/${STEAMAPP}-dedicated"
ENV STEAMAPPVALIDATE 0
COPY etc/entry.sh "${HOMEDIR}/entry.sh" COPY etc/entry.sh "${HOMEDIR}/entry.sh"
COPY etc/server.cfg "/etc/server.cfg" COPY etc/server.cfg "/etc/server.cfg"

View file

@ -5,9 +5,15 @@ mkdir -p "${STEAMAPPDIR}" || true
# Download Updates # Download Updates
if [[ "$STEAMAPPVALIDATE" -eq 1 ]]; then
VALIDATE="validate"
else
VALIDATE=""
fi
bash "${STEAMCMDDIR}/steamcmd.sh" +force_install_dir "${STEAMAPPDIR}" \ bash "${STEAMCMDDIR}/steamcmd.sh" +force_install_dir "${STEAMAPPDIR}" \
+login anonymous \ +login anonymous \
+app_update "${STEAMAPPID}" \ +app_update "${STEAMAPPID}" "${VALIDATE}"\
+quit +quit
# steamclient.so fix # steamclient.so fix

View file

@ -6,6 +6,7 @@ services:
environment: environment:
# Server configuration # Server configuration
- SRCDS_TOKEN # Game Server Token from https://steamcommunity.com/dev/managegameservers - 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_SERVERNAME=changeme # (Set the visible name for your private server)
- CS2_CHEATS=0 # (0 - disable cheats, 1 - enable cheats) - CS2_CHEATS=0 # (0 - disable cheats, 1 - enable cheats)
- CS2_PORT=27015 # (CS2 server listen port tcp_udp) - CS2_PORT=27015 # (CS2 server listen port tcp_udp)