Skip to content

Commit

Permalink
Merge pull request #24 from CosminPerRam/master
Browse files Browse the repository at this point in the history
Insecured + MapCycle + ServerCfg ENV variables
  • Loading branch information
CM2Walki authored Sep 8, 2023
2 parents 0e936a3 + d005796 commit 5fcab5d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,19 @@ SRCDS_REGION=3
SRCDS_STARTMAP="ctf_2fort"
SRCDS_HOSTNAME="New TF Server" (first launch only)
SRCDS_WORKSHOP_AUTHKEY="" (required to load workshop maps)
SRCDS_CFG="server.cfg"
SRCDS_MAPCYCLE="mapcycle_default.txt" (value can be overwritten by tf/cfg/server.cfg)
SRCDS_SECURED=1 (0 to start the server as insecured)
```

## Config
The image contains static copies of the competitive config files from [UGC League](https://www.ugcleague.com/files_tf26.cfm#) and [RGL.gg](https://rgl.gg/Public/About/Configs.aspx?r=24).

You can edit the config using this command:
```console
$ docker exec -it tf2-dedicated nano /home/steam/tf-dedicated/tf/cfg/server.cfg
```
Or if you want to explicitly specify a server config file, use the `SRCDS_CFG` environment variable.

If you want to learn more about configuring a TF2 server check this [documentation](https://wiki.teamfortress.com/wiki/Dedicated_server_configuration).

Expand Down
5 changes: 4 additions & 1 deletion bullseye/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ ENV SRCDS_FPSMAX=300 \
SRCDS_HOSTNAME="New \"${STEAMAPP}\" Server" \
SRCDS_WORKSHOP_START_MAP=0 \
SRCDS_HOST_WORKSHOP_COLLECTION=0 \
SRCDS_WORKSHOP_AUTHKEY=""
SRCDS_WORKSHOP_AUTHKEY="" \
SRCDS_CFG="server.cfg" \
SRCDS_MAPCYCLE="mapcycle_default.txt" \
SRCDS_SECURED=1

# Switch to user
USER ${USER}
Expand Down
11 changes: 10 additions & 1 deletion etc/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ fi
# Believe it or not, if you don't do this srcds_run shits itself
cd "${STEAMAPPDIR}"

SERVER_SECURITY_FLAG="-secured";

if [ "$SRCDS_SECURED" -eq 0]; then
SERVER_SECURITY_FLAG="-insecured";
fi

bash "${STEAMAPPDIR}/srcds_run" -game "${STEAMAPP}" -console -autoupdate \
-steam_dir "${STEAMCMDDIR}" \
-steamcmd_script "${HOMEDIR}/${STEAMAPP}_update.txt" \
Expand All @@ -46,4 +52,7 @@ bash "${STEAMAPPDIR}/srcds_run" -game "${STEAMAPP}" -console -autoupdate \
+sv_password "${SRCDS_PW}" \
+sv_region "${SRCDS_REGION}" \
-ip "${SRCDS_IP}" \
-authkey "${SRCDS_WORKSHOP_AUTHKEY}"
-authkey "${SRCDS_WORKSHOP_AUTHKEY}" \
+servercfgfile "${SRCDS_CFG}" \
+mapcyclefile "${SRCDS_MAPCYCLE}" \
${SERVER_SECURITY_FLAG}

0 comments on commit 5fcab5d

Please sign in to comment.