Skip to content

fix: strip wrapping quotes from password in .env file#38

Closed
sunba91-su wants to merge 1 commit into
mainfrom
fix/env-password-quotes
Closed

fix: strip wrapping quotes from password in .env file#38
sunba91-su wants to merge 1 commit into
mainfrom
fix/env-password-quotes

Conversation

@sunba91-su

Copy link
Copy Markdown
Owner

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:

ROCKETCHAT_BOT_PASSWORD='p@ss(w0rd)!'

The actual password includes the quotes, causing auth failure.

Fix

Added trimQuotes() to internal/config/config.go that strips matching single or double quotes from the password value. Applied to both ROCKETCHAT_BOT_PASSWORD and ROCKETCHAT_BOT_PASSWORD_FILE.

Also added internal/config/config_test.go with 11 test cases covering all edge cases (quoted, unquoted, empty, single char).

.env.example update

Added hint about wrapping password in single quotes:

# Wrap password in single quotes if it contains special characters:
#   ROCKETCHAT_BOT_PASSWORD='p@ss(w0rd)!'
ROCKETCHAT_BOT_PASSWORD=your-password

Closes #37

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
@sunba91-su

Copy link
Copy Markdown
Owner Author

Superseded — switching to token-based auth instead of quote stripping

@sunba91-su sunba91-su closed this Jun 9, 2026
@sunba91-su sunba91-su deleted the fix/env-password-quotes branch June 9, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Strip wrapping quotes from password in .env file

1 participant