feat(application): customizable env file name for Dockerfile builds - #5073
Open
lmichelin wants to merge 1 commit into
Open
feat(application): customizable env file name for Dockerfile builds#5073lmichelin wants to merge 1 commit into
lmichelin wants to merge 1 commit into
Conversation
lmichelin
force-pushed
the
env-file-name
branch
3 times, most recently
from
August 13, 2026 15:06
4b531e0 to
dcc590b
Compare
lmichelin
force-pushed
the
env-file-name
branch
4 times, most recently
from
August 13, 2026 15:23
d896b7b to
4e3db31
Compare
lmichelin
force-pushed
the
env-file-name
branch
from
August 13, 2026 15:35
4e3db31 to
a21c36c
Compare
Comment on lines
+18
to
+21
| const envFilePath = join(dirname(directory), fileName); | ||
| const envFileDir = dirname(envFilePath); | ||
|
|
||
| return `echo "${encodedContent}" | base64 -d > "${envFilePath}";`; | ||
| return `mkdir -p "${envFileDir}" && echo "${encodedContent}" | base64 -d > "${envFilePath}";`; |
Contributor
There was a problem hiding this comment.
Symlink path escapes workspace
When a Git repository contains a symlink at an allowed nested path such as config and the environment filename is config/.env, this redirection follows the symlink and writes generated environment secrets outside the application workspace, potentially overwriting host or Dokploy configuration. How this was verified: The validated nested filename reaches shell redirection without resolving symlinks or checking filesystem containment.
Knowledge Base Used: Application Deployment Flow
Adds an optional 'Env file name' setting (default: .env) that lets users write the Dokploy-generated env file to a path that does not conflict with a committed .env. Useful for frameworks like Next.js where writing to .env.local or .env.production.local naturally overrides committed defaults via the framework's precedence chain.
lmichelin
force-pushed
the
env-file-name
branch
from
August 13, 2026 19:52
a21c36c to
53d03c5
Compare
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.
Reopen of #4508 (which was auto-closed when I temporarily deleted my fork).
What is this PR about?
Adds an optional 'Env file name' setting (default: .env) that lets users write the Dokploy-generated env file to a path that does not conflict with a committed .env. Useful for frameworks like Next.js where writing to .env.local or .env.production.local naturally overrides committed defaults via the framework's precedence chain.
Checklist
Before submitting this PR, please make sure that:
canarybranch.Issues related (if applicable)
closes #4507
Screenshots (if applicable)
Dokploy UI
Test Dockerfile build using a zip dropped in the UI, containing this
Dockerfileand a.envBuild logs with default file name : default
.envis overwrittenBuild logs with
.env.localfile nameRuntime logs with
.env.localfile nameGreptile Summary
The PR adds a configurable generated environment-file path for Dockerfile builds, with a
.envdefault.Confidence Score: 3/5
The PR is not yet safe to merge because a nested environment-file path can follow a repository-controlled symlink and expose generated secrets outside the application workspace.
The current validator enforces lexical path safety, but the write path performs no canonical containment check before
mkdir -pand shell redirection, leaving the previously reported symlink escape unresolved.Files Needing Attention: packages/server/src/utils/builders/utils.ts
Reviews (6): Last reviewed commit: "feat(application): customizable env file..." | Re-trigger Greptile
Context used: