Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

don't overwrite default config files #94

Merged
merged 1 commit into from
Mar 4, 2023
Merged

Conversation

senecaso
Copy link
Contributor

  • allow the value provided CFG files to provide a basis for the dedicated sever, then only add/overwrite specific ones as provided in the image
  • don't download entry.sh from github using wget. Instead, bake the script into the image from the local file system
  • add .gitattributes to force CFG files to be treated as binary files so that git wont change the line endings on them (just in case that is important to CSGO)
  • remove the old CFG tarball and replace it with just the CFG files which are added (ie: esl*.cfg)
  • dont set "warmup" related cvars in server.cfg. Most of these values were the defaults anyway, and by setting mp_warmup_pausetimer there, it made it so that Danger Zone servers were stuck in the warmup forever with no way to play. If this behaviour is desiratable, it can be achieved by adding -e ADDITIONAL_ARGS="+mp_warmup_pausetimer 1" to the launch command.

@CM2Walki
Copy link
Owner

CM2Walki commented Feb 18, 2023

Here's the Docker Hub log. Seems like you moved the etc directory into bullseye. This is why it's erroring out.

2023-02-17T23:29:13Z Building in Docker Cloud's infrastructure...
2023-02-17T23:29:13Z Cloning into '.'...
2023-02-17T23:29:15Z Switched to a new branch 'upstream'
2023-02-17T23:29:15Z Pulling cache layers for index.docker.io/cm2network/csgo:latest...
2023-02-17T23:29:31Z Done!
2023-02-17T23:29:31Z Executing build hook...
2023-02-17T23:29:34Z Sending build context to Docker daemon 670.2kB
2023-02-17T23:29:34Z Step 1/15 : FROM cm2network/steamcmd:root as build_stage
2023-02-17T23:29:34Z root: Pulling from cm2network/steamcmd
2023-02-17T23:29:34Z bb263680fed1: Already exists
2023-02-17T23:29:34Z d85101e3e6c2: Already exists
2023-02-17T23:29:34Z Digest: sha256:ea82ec772b9f38f80ca74ebd98834a07db8a5c83a834842d175e5f000e9bfb21
2023-02-17T23:29:34Z Status: Downloaded newer image for cm2network/steamcmd:root
2023-02-17T23:29:34Z ---> 95331ec71c08
2023-02-17T23:29:34Z Step 2/15 : LABEL maintainer="walentinlamonos@gmail.com"
2023-02-17T23:29:39Z ---> Running in fd2c0a99b13b
2023-02-17T23:29:39Z Removing intermediate container fd2c0a99b13b
2023-02-17T23:29:39Z ---> c8e066ef0fca
2023-02-17T23:29:39Z Step 3/15 : ENV STEAMAPPID 740
2023-02-17T23:29:40Z ---> Running in bb6d919ee422
2023-02-17T23:29:40Z Removing intermediate container bb6d919ee422
2023-02-17T23:29:40Z ---> 919fed9a981c
2023-02-17T23:29:40Z Step 4/15 : ENV STEAMAPP csgo
2023-02-17T23:29:40Z ---> Running in a4771d077d8a
2023-02-17T23:29:40Z Removing intermediate container a4771d077d8a
2023-02-17T23:29:40Z ---> 5355d10cd08a
2023-02-17T23:29:40Z Step 5/15 : ENV STEAMAPPDIR "${HOMEDIR}/${STEAMAPP}-dedicated"
2023-02-17T23:29:40Z ---> Running in b771322602e8
2023-02-17T23:29:40Z Removing intermediate container b771322602e8
2023-02-17T23:29:40Z ---> 9f015fa5d185
2023-02-17T23:29:40Z Step 6/15 : ENV DLURL https://raw.githubusercontent.com/CM2Walki/CSGO
2023-02-17T23:29:40Z ---> Running in 8783d52bd428
2023-02-17T23:29:40Z Removing intermediate container 8783d52bd428
2023-02-17T23:29:40Z ---> c00c6005f66a
2023-02-17T23:29:40Z Step 7/15 : COPY etc/entry.sh "${HOMEDIR}/entry.sh"
2023-02-17T23:29:40Z COPY failed: file not found in build context or excluded by .dockerignore: stat etc/entry.sh: file does not exist
2023-02-17T23:29:40Z Sending build context to Docker daemon 670.2kB
2023-02-17T23:29:40Z Step 1/17 : FROM cm2network/steamcmd:root as build_stage
2023-02-17T23:29:40Z ---> 95331ec71c08
2023-02-17T23:29:40Z Step 2/17 : LABEL maintainer="walentinlamonos@gmail.com"
2023-02-17T23:29:40Z ---> Using cache
2023-02-17T23:29:40Z ---> c8e066ef0fca
2023-02-17T23:29:40Z Step 3/17 : ENV STEAMAPPID 740
2023-02-17T23:29:40Z ---> Using cache
2023-02-17T23:29:40Z ---> 919fed9a981c
2023-02-17T23:29:40Z Step 4/17 : ENV STEAMAPP csgo
2023-02-17T23:29:40Z ---> Using cache
2023-02-17T23:29:40Z ---> 5355d10cd08a
2023-02-17T23:29:40Z Step 5/17 : ENV STEAMAPPDIR "${HOMEDIR}/${STEAMAPP}-dedicated"
2023-02-17T23:29:40Z ---> Using cache
2023-02-17T23:29:40Z ---> 9f015fa5d185
2023-02-17T23:29:40Z Step 6/17 : ENV DLURL https://raw.githubusercontent.com/CM2Walki/CSGO
2023-02-17T23:29:40Z ---> Using cache
2023-02-17T23:29:40Z ---> c00c6005f66a
2023-02-17T23:29:40Z Step 7/17 : COPY etc/entry.sh "${HOMEDIR}/entry.sh"
2023-02-17T23:29:40Z COPY failed: file not found in build context or excluded by .dockerignore: stat etc/entry.sh: file does not exist
2023-02-17T23:29:41Z Sending build context to Docker daemon 670.2kB
2023-02-17T23:29:41Z Step 1/19 : FROM cm2network/steamcmd:root as build_stage
2023-02-17T23:29:41Z ---> 95331ec71c08
2023-02-17T23:29:41Z Step 2/19 : LABEL maintainer="walentinlamonos@gmail.com"
2023-02-17T23:29:41Z ---> Using cache
2023-02-17T23:29:41Z ---> c8e066ef0fca
2023-02-17T23:29:41Z Step 3/19 : ENV STEAMAPPID 740
2023-02-17T23:29:41Z ---> Using cache
2023-02-17T23:29:41Z ---> 919fed9a981c
2023-02-17T23:29:41Z Step 4/19 : ENV STEAMAPP csgo
2023-02-17T23:29:41Z ---> Using cache
2023-02-17T23:29:41Z ---> 5355d10cd08a
2023-02-17T23:29:41Z Step 5/19 : ENV STEAMAPPDIR "${HOMEDIR}/${STEAMAPP}-dedicated"
2023-02-17T23:29:41Z ---> Using cache
2023-02-17T23:29:41Z ---> 9f015fa5d185
2023-02-17T23:29:41Z Step 6/19 : ENV DLURL https://raw.githubusercontent.com/CM2Walki/CSGO
2023-02-17T23:29:41Z ---> Using cache
2023-02-17T23:29:41Z ---> c00c6005f66a
2023-02-17T23:29:41Z Step 7/19 : COPY etc/entry.sh "${HOMEDIR}/entry.sh"
2023-02-17T23:29:41Z COPY failed: file not found in build context or excluded by .dockerignore: stat etc/entry.sh: file does not exist
2023-02-17T23:29:41Z build hook failed! (1)

* allow the value provided CFG files to provide a basis for the
  dedicates sever, then only add/overwrite specific ones as
  provided in the image
* don't download `entry.sh` from github using wget.  Instead, use bake
  the script into the image from the local file system
* add `.gitattributes` to force CFG files to be treated as binary files
  so that git wont change the line endings on them (just in case that is
  important to CSGO)
* remove the old CFG tarball and replace it with just the CFG files
  which are added (ie: `esl*.cfg`)
* dont set "warmup" related cvars in server.cfg.  Most of these values
  were the defaults anyway, and by setting `mp_warmup_pausetimer` there,
  it made it so that Danger Zone servers were stuck in the warmup
  forever with no way to play.  If this behaviour is desiratable, it can
  be achieved by adding `-e ADDITIONAL_ARGS="+mp_warmup_pausetimer 1"`
  to the launch command.
* fixing up build script to handle path changes
@senecaso
Copy link
Contributor Author

I refactored the build script a bit to better accommodate the directory changes. Looks like it works, but perhaps there is another build somewhere which is failing. Let me know if there are any other issues.

@senecaso
Copy link
Contributor Author

its worth noting that this would be a breaking change for anyone attempting to set DLURL to download the tarball from a different URL, since that is no longer done. I see that someone specifically made changes in a recent commit to handle this situation, but I believe this approach is more flexible, as the user can just mount a new volume into the container to /etc/csgo/ which contains all of the config scripts they want to use, and it will use them. The problem with downloading a tarball at runtime is that it could pose security risks. If an attacker is able to influence that tarball or the URL in any way, they could inject arbitrary binaries into your container at runtime.

This approach could potentially be improved by copying 2 different paths, /etc/csgo/base and /etc/csgo/custom which would allow the user to mount a volume to /etc/csgo/custom to only add new config scripts, but to also mount /etc/csgo/base if they didnt want to use any of the provided ones. If you feel that would be useful, let me know and I could add it quite quickly.

@CM2Walki CM2Walki merged commit e881615 into CM2Walki:master Mar 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants