fix: strip wrapping quotes from password in .env file#38
Closed
sunba91-su wants to merge 1 commit into
Closed
Conversation
Docker Compose .env parser treats quotes as literal characters. When users wrap passwords with special chars in quotes like: ROCKETCHAT_BOT_PASSWORD='p@ss(w0rd)!' the actual value includes the quotes, causing auth failure. Added trimQuotes() that strips matching single/double quotes from password values. Applied to both ROCKETCHAT_BOT_PASSWORD and ROCKETCHAT_BOT_PASSWORD_FILE. Closes #37
Owner
Author
|
Superseded — switching to token-based auth instead of quote stripping |
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.
Problem
Docker Compose's .env parser treats quotes as literal characters (unlike a shell). When users wrap their password in single quotes to protect special characters:
The actual password includes the quotes, causing auth failure.
Fix
Added
trimQuotes()tointernal/config/config.gothat strips matching single or double quotes from the password value. Applied to bothROCKETCHAT_BOT_PASSWORDandROCKETCHAT_BOT_PASSWORD_FILE.Also added
internal/config/config_test.gowith 11 test cases covering all edge cases (quoted, unquoted, empty, single char)..env.example update
Added hint about wrapping password in single quotes:
Closes #37