feat: add passwordFile, hashedPasswordFile, githubAuthTokenFile and absProxyBasePath options#10
Merged
DanielleMaywood merged 4 commits intomainfrom Apr 28, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces two new configuration options for code-server to improve security by using external password files instead of hardcoded values.
- Adds the hashedPasswordFile option, which uses an Argon2-hashed password that takes priority over passwordFile.
- Adds the passwordFile option to allow direct password authentication via a file.
Files not reviewed (7)
- src/code-server/devcontainer-feature.json: Language not supported
- src/code-server/install.sh: Language not supported
- test/code-server/code-server-hashed-password-file.sh: Language not supported
- test/code-server/code-server-hashed-password-file/Dockerfile: Language not supported
- test/code-server/code-server-password-file.sh: Language not supported
- test/code-server/code-server-password-file/Dockerfile: Language not supported
- test/code-server/scenarios.json: Language not supported
passwordFile and hashedPasswordFile optionspasswordFile, hashedPasswordFile, githubAuthTokenFile and absProxyBasePath options
mafredri
approved these changes
Apr 28, 2025
src/code-server/install.sh
Outdated
Comment on lines
123
to
124
| if [[ -f "$PASSWORDFILE" ]]; then | ||
| export PASSWORD="\$(cat '$PASSWORDFILE')" |
Member
There was a problem hiding this comment.
Suggested change
| if [[ -f "$PASSWORDFILE" ]]; then | |
| export PASSWORD="\$(cat '$PASSWORDFILE')" | |
| export PASSWORD="\$(<"$PASSWORDFILE")" |
Minor: useless use of cat 😄 and " is fine within $().
We don't have the same shell safety for inputs here (as with declare -p) but arguably if someone passes a file name with " in it then they might have other problems too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes coder/internal#462
Adds the final four options
passwordFilehashedPasswordFilegithubAuthTokenFileabsProxyBasePathThe decision to pass credentials via a file instead of embedding them directly in the
devcontainer.jsonis to allow people the ability to not commit the password to source control.With these final four options added we should have feature parity with the CLI.