-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add warning regarding "/" in CS2_SERVERNAME #157
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
I think you can use "/" if you escape them first, e.g. "\/"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, as "/" is being used as the delimiter in all sed substitutions I think it will cause problems for lots of other variables: https://github.com/joedwards32/CS2/blob/main/bookworm/etc/entry.sh#L103
It is technically possible to escape forward slashes However, this introduces actually the same issue: users must not use already escaped slashes Proposed solution: As you already noted, if users really want a slash to appear in their server name, they must escape it manually. I applied this to the current pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that documenting the requirement is better than trying to auto-escape /
characters found in environment variables, getting that right is fiddly.
Maybe one day I will convert this all to python and jinja templates.
Approved. Thank you for your contribution.
Using a "/" character in the CS2_SERVERNAME (e.g., "CS Server 1/3 of My Amazing LAN Party") causes the sed substitution in
https://github.com/joedwards32/CS2/blob/38b2938f7927c5f83e62fe32fe23f37e1f2201cb/bookworm/etc/entry.sh#L103to fail because the default delimiter "/" conflicts with the character in the value. Although the server continues to run, the configuration file ends up with unresolved placeholders (for example,
{{SERVER_CHEATS}}
remains unchanged). As a result, when players try to connect, they receive a "wrong password" error - even if the password is correct or none was set initially.How to Reproduce:
Recommendation:
It is a lot of work to allow all sorts of arbitrary characters. I suggest just adding a warning in both the README and the example docker-compose.yml. I could provide another solution if requested.
Thank you for this amazing docker image and all of your work. It has been serving me and my friends well on our LAN parties <3 This is my first pull request ever created, so I hope the format and description are acceptable.