Environment variables in Stacks are saved without quotes #100

Closed
opened 2025-10-31 15:02:15 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @FibreTTP on GitHub (Oct 22, 2024).

At some point in the last two weeks, stack environment variable parsing behaviour has changed to ignore quotes (single and double), leading the Docker daemon to attempt to interpolate strings with $ dollar signs in them as variables.

Komodo was previously (seemingly) following the Docker Env_file format for single-quoted values, but now it is not. Escaping the ' apostrophe with a \ backslash saves both of those characters as expected, and thus is not a workaround.

This behaviour applies to the .env file saved, where even though the correct format is used in the web interface:

  • MD_RPC_USER='ds252f3^4a1s6$s2n84!snT5!asv*V@PTyaw'

it ends up being saved as:

  • MD_RPC_USER=ds252f3^4a1s6$s2n84!snT5!asv*V@PTyaw
    (no quotes)

This makes the Docker daemon attempt to interpolate the string with the variable $s2n84, which does not exist, and ends up without those characters in the final value:

  • MD_RPC_USER=ds252f3^4a1s6!snT5!asv*V@PTyaw
    time="2024-10-22T07:31:06Z" level=warning msg="The \"s2n84\" variable is not set. Defaulting to a blank string."
Originally created by @FibreTTP on GitHub (Oct 22, 2024). At some point in the last two weeks, stack environment variable parsing behaviour has changed to ignore quotes (single and double), leading the Docker daemon to attempt to interpolate strings with `$` dollar signs in them as variables. Komodo was previously (seemingly) following the Docker [Env_file format](https://docs.docker.com/reference/compose-file/services/#env_file-format) for single-quoted values, but now it is not. Escaping the `'` apostrophe with a `\` backslash saves both of those characters as expected, and thus is not a workaround. This behaviour applies to the `.env` file saved, where even though the correct format is used in the web interface: - MD_RPC_USER='ds252f3^4a1s6<strong>$s2n84</strong>!snT5!asv*V@PTyaw' it ends up being saved as: - MD_RPC_USER=ds252f3^4a1s6<strong>$s2n84</strong>!snT5!asv*V@PTyaw (no quotes) This makes the Docker daemon attempt to interpolate the string with the variable `$s2n84`, which does not exist, and ends up without those characters in the final value: - MD_RPC_USER=ds252f3^4a1s6!snT5!asv*V@PTyaw `time="2024-10-22T07:31:06Z" level=warning msg="The \"s2n84\" variable is not set. Defaulting to a blank string."`
GiteaMirror added the bug label 2025-10-31 15:02:15 -05:00
Author
Owner

@mbecker20 commented on GitHub (Oct 22, 2024):

Thanks for letting me know, I get the problem here. I'll release a patch ensuring it will retain users choice of wrapping value in single or double quotes.

@mbecker20 commented on GitHub (Oct 22, 2024): Thanks for letting me know, I get the problem here. I'll release a patch ensuring it will retain users choice of wrapping value in single or double quotes.
Author
Owner

@mbecker20 commented on GitHub (Oct 22, 2024):

Hi, should be fixed in this commit bb898c12aa and released as version 1.16.2: https://github.com/mbecker20/komodo/releases/tag/v1.16.2

Can you confirm the fix?

@mbecker20 commented on GitHub (Oct 22, 2024): Hi, should be fixed in this commit https://github.com/mbecker20/komodo/pull/145/commits/bb898c12aa4c5694432d809bce680f132b2c27c3 and released as version 1.16.2: https://github.com/mbecker20/komodo/releases/tag/v1.16.2 Can you confirm the fix?
Author
Owner

@FibreTTP commented on GitHub (Oct 23, 2024):

Works, thanks!

@FibreTTP commented on GitHub (Oct 23, 2024): Works, thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#100