Skip to content

fix: do not wrap safe Environment-tab values in extra quotes - #1

Closed
BetterAndBetterII wants to merge 2 commits into
canaryfrom
cursor/fix-swarm-env-quotes-78bb
Closed

fix: do not wrap safe Environment-tab values in extra quotes#1
BetterAndBetterII wants to merge 2 commits into
canaryfrom
cursor/fix-swarm-env-quotes-78bb

Conversation

@BetterAndBetterII

@BetterAndBetterII BetterAndBetterII commented Aug 17, 2026

Copy link
Copy Markdown
Owner

What is this PR about?

Environment-tab values were always written to the generated .env as KEY="value". That is valid dotenv for docker compose, but docker stack deploy does not strip those quotes, so they become part of the value.

A Sentry DSN such as https://examplePublicKey@o0000000000000000.ingest.sentry.io/0000000000000000 was deployed as "https://..." (quotes became part of the value) instead of the entered URL, which breaks URL parsing.

prepareEnvironmentVariablesForFile now emits values exactly as entered when they do not need dotenv quoting. Characters such as : / @ = _ no longer add quotes. Values that still need quoting for Compose ($, #, whitespace, ", \) keep the existing escape path so Dokploy#4694 stays fixed.

Checklist

  • Dedicated branch based on canary
  • Tests added: RED on current canary (extra surrounding quotes), GREEN with this change
  • Focused unit coverage for the Sentry DSN case and : / @ = _

Issues related (if applicable)

Fixes Dokploy#5096

Open in Web Open in Cursor 

cursoragent and others added 2 commits August 17, 2026 11:42
prepareEnvironmentVariablesForFile quoted every value, so docker stack
deploy treated the quotes as part of the value. Emit values containing
only safe characters (including : / @ = _) exactly as entered.

Fixes Dokploy#5096

Co-authored-by: Yuzhong Zhang <BetterAndBetterII@users.noreply.github.com>
Match the example value from Dokploy#5096 and keep quoting for $, #, and spaces.

Co-authored-by: Yuzhong Zhang <BetterAndBetterII@users.noreply.github.com>
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.

Environment variables from the UI are deployed with surrounding double quotes in Docker Swarm Compose stacks

2 participants