Repository navigation
feat(compose): list the variables a compose file uses in its Environment tab - #74
Merged
agentHits merged 1 commit intoOct 14, 2026
Conversation
…ent tab
The Environment tab of a compose service only showed what was set in the
panel. Every `${NAME:-default}` in the compose file stayed out of sight
until someone opened the file, so it was hard to tell which settings a
service has and which values it falls back to.
A "Variables from compose" button in the Environment tab now fetches the
source selected in General (the same clone that Preview Compose and
deploys use, for every git provider and for raw files), reads the compose
file and lists the variables it uses: the default the file falls back to,
the services that use it, and whether the environment already sets it.
Names that look like credentials, defaults that ask to be replaced
(`change-me`), required variables (`${NAME:?}`) and variables with
different defaults in different places are marked.
The selected variables go into the editor. Nothing is saved until Save is
clicked, and a variable that is already set is never changed. By default
they are added commented out (`# NAME=value`): dotenv skips those lines,
so the defaults from the file keep applying and later changes to them in
the repository still take effect, while removing the `#` turns a line
into an override. Adding again rewrites the commented lines in place, so
they follow the current defaults. A switch adds active lines instead, for
a fixed copy of the values.
Details:
- Variables are read from the parsed YAML, so references inside YAML
comments are not listed, and anchors count for the services that use
them. `$$` is a literal dollar sign, and references inside a default
(`${A:-${B}}`) are listed too. APP_NAME, COMPOSE_PROJECT_NAME,
COMPOSE_PREFIX and DOCKER_CONFIG are left out because Dokploy writes
them itself.
- Values are quoted where dotenv would otherwise cut or change them (`#`,
spaces, quotes, backslashes).
- compose.loadComposeVariables needs service create (it fetches the
source, like fetchSourceType) and env read (defaults are often secrets).
It refuses while a deployment is running, because fetching replaces the
code directory the build reads from. API keys cannot call it, like
revealEnvironment.
- Opening the dialog reveals a masked environment first, because a masked
editor with unsaved changes cannot be revealed afterwards.
- When "Create Environment File" is off, the dialog says that the
variables do not reach the compose file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
The Environment tab of a compose service only showed what was set in the panel. Every
${NAME:-default}in the compose file stayed out of sight until someone opened the file, so it was hard to tell which settings a service has and which values it falls back to.What changes
A Variables from compose button in the Environment tab of compose services:
change-me), required variables (${NAME:?}), and variables whose default differs from place to place.By default the variables are added commented out:
dotenv skips these lines, so the defaults from the file keep applying, and later changes to them in the repository still take effect. Removing the
#turns a line into an override. Adding again rewrites the commented lines in place, so they follow the current defaults. A switch adds active lines instead, for a fixed copy of the values.Details
$$is a literal dollar sign. References inside a default (${A:-${B}}) are listed too.APP_NAME,COMPOSE_PROJECT_NAME,COMPOSE_PREFIXandDOCKER_CONFIGare left out because Dokploy writes them itself.#, spaces, quotes, backslashes).compose.loadComposeVariablesneedsservice: create(it fetches the source, likefetchSourceType) andenvVars: read(defaults are often secrets). It refuses while a deployment is running, because fetching replaces the code directory the build reads from. API keys cannot call it, likerevealEnvironment. It is classifiedwritefor super sessions.Testing
__test__/compose/compose-variables.test.ts: every interpolation form,$$, nested defaults, YAML comments, anchors, conflicting defaults, Dokploy-provided names, placeholders.__test__/compose/compose-env-merge.test.ts: dotenv round trip of quoted values, set variables untouched, in-place refresh of commented lines, grouping by service.service-environment-reveal.test.tschecks that the permission check runs before anything is fetched.api-key-output-guard.test.tschecks that API keys are refused.tsc --noEmitforapps/dokployandpackages/server; Biome;__test__/compose,__test__/securityand__test__/env: 852 tests pass.🤖 Generated with Claude Code