From a9f9ccbadbd8f05753b77714762c1b90a9cea81c Mon Sep 17 00:00:00 2001 From: John Edwards Date: Tue, 7 Nov 2023 11:59:58 +0000 Subject: [PATCH 1/3] Switch to anonymous logins --- README.md | 12 ------------ bullseye/Dockerfile | 3 --- bullseye/etc/entry.sh | 2 +- examples/docker-compose.yml | 4 ---- 4 files changed, 1 insertion(+), 20 deletions(-) diff --git a/README.md b/README.md index a03727c..b78e88d 100644 --- a/README.md +++ b/README.md @@ -31,10 +31,6 @@ $ docker compose --file examples/docker-compose.yml up -d cs2-server You must have at least **40GB** of free disk space! See [System Requirements](./#system-requirements). -`STEAMUSER` and `STEAMPASS` **are required as unlike CS:GO, CS2 can not be downloaded anonymously (at time of writing).** - -`STEAMGUARD` **must be used to provide your more recent Steam Guard key if Steam Guard is enabled on your account.** - **The container will automatically update the game on startup, so if there is a game update just restart the container.** # Configuration @@ -50,14 +46,6 @@ Minimum system requirements are: ## Environment Variables Feel free to overwrite these environment variables, using -e (--env): -### SteamCMD - -```dockerfile -STEAMUSER="changeme" (Steam User for SteamCMD.) -STEAMPASS="changeme" (Password for Steam User.) -STEAMGUARD="" (Optional, Steam Guard key if enabled. Use your most recent Steam Guard key.) -``` - ### Server Configuration ```dockerfile diff --git a/bullseye/Dockerfile b/bullseye/Dockerfile index 759d4f8..b2f9893 100644 --- a/bullseye/Dockerfile +++ b/bullseye/Dockerfile @@ -8,9 +8,6 @@ FROM cm2network/steamcmd:root as build_stage LABEL maintainer="joedwards32@gmail.com" -ENV STEAMUSER "changeme" -ENV STEAMPASS "changeme" -ENV STEAMGUARD "" ENV STEAMAPPID 730 ENV STEAMAPP cs2 ENV STEAMAPPDIR "${HOMEDIR}/${STEAMAPP}-dedicated" diff --git a/bullseye/etc/entry.sh b/bullseye/etc/entry.sh index cae0ca0..047347e 100644 --- a/bullseye/etc/entry.sh +++ b/bullseye/etc/entry.sh @@ -6,7 +6,7 @@ mkdir -p "${STEAMAPPDIR}" || true # Download Updates bash "${STEAMCMDDIR}/steamcmd.sh" +force_install_dir "${STEAMAPPDIR}" \ - +login "${STEAMUSER}" "${STEAMPASS}" "${STEAMGUARD}" \ + +login anonymous \ +app_update "${STEAMAPPID}" \ +quit diff --git a/examples/docker-compose.yml b/examples/docker-compose.yml index 514d009..1e5cc0b 100644 --- a/examples/docker-compose.yml +++ b/examples/docker-compose.yml @@ -4,10 +4,6 @@ services: image: joedwards32/cs2 container_name: cs2-dedicated environment: - # SteamCMD - - STEAMUSER=changeme # (Steam User for SteamCMD.) - - STEAMPASS=changeme # (Password for Steam User.) - - STEAMGUARD # (Optional, Steam Guard key if enabled. Use your most recent Steam Guard key.) # Server configuration - CS2_SERVERNAME=changeme # (Set the visible name for your private server) - CS2_IP=0.0.0.0 # (CS2 server listening IP address, 0.0.0.0 - all IP addresses on the local machine, empty - IP identified automatically) From 3a0dab324407880adc95ad83f312cf6855a080b7 Mon Sep 17 00:00:00 2001 From: John Edwards Date: Tue, 7 Nov 2023 12:08:31 +0000 Subject: [PATCH 2/3] Updated documentation to recomment published ports and remove references to SteamCMD authentication --- README.md | 4 ++-- examples/docker-compose.yml | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b78e88d..5335d01 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,14 @@ This Docker image contains the dedicated server of the game. Running on the *host* interface (recommended) using Docker:
```console -$ docker run -d --net=host --name=cs2 -e STEAMUSER={YOUR_STEAM_USER} -e STEAMPASS={YOUR_STEAM_PASSWD} joedwards32/cs2 +$ docker run -d --name=cs2 -p 27015:27015 -p 27020:27020 joedwards32/cs2 ``` Running using a bind mount for data persistence on container recreation: ```console $ mkdir -p $(pwd)/cs2-data $ chmod 777 $(pwd)/cs2-data # Makes sure the directory is writeable by the unprivileged container user -$ docker run -d --net=host -v $(pwd)/cs2-data:/home/steam/cs2-dedicated/ --name=cs2-dedicated -e STEAMUSER={YOUR_STEAM_USER} -e STEAMPASS={YOUR_STEAM_PASSWD} joedwards32/cs2 +$ docker run -d --name=cs2 -v $(pwd)/cs2-data:/home/steam/cs2-dedicated/ -p 27015:27015 -p 27020:27020 joedwards32/cs2 ``` or using docker-compose, see [examples](https://github.com/joedwards32/CS2/blob/main/examples/docker-compose.yml): diff --git a/examples/docker-compose.yml b/examples/docker-compose.yml index 1e5cc0b..ab177af 100644 --- a/examples/docker-compose.yml +++ b/examples/docker-compose.yml @@ -6,7 +6,6 @@ services: environment: # Server configuration - CS2_SERVERNAME=changeme # (Set the visible name for your private server) - - CS2_IP=0.0.0.0 # (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. Useful for services like AWS Fargate which do not support mixed protocol ports.) - CS2_LAN=0 # (0 - LAN mode disabled, 1 - LAN Mode enabled) From 01bbc5c0f705f2827573f919fe8875cc0645559b Mon Sep 17 00:00:00 2001 From: John Edwards Date: Tue, 7 Nov 2023 12:10:44 +0000 Subject: [PATCH 3/3] Remove reference to host interfaces --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5335d01..35251a8 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ This Docker image contains the dedicated server of the game. # How to use this image ## Hosting a simple game server -Running on the *host* interface (recommended) using Docker:
+Running using Docker: ```console $ docker run -d --name=cs2 -p 27015:27015 -p 27020:27020 joedwards32/cs2 ```