Skip to content

fix(mounts): show the file on disk in the File Mount editor - #5782

Merged
imrja8 merged 2 commits into
Dokploy:canaryfrom
imrja8:fix/5678-file-mount-stale-content
Oct 29, 2026
Merged

imrja8 merged 2 commits into
Dokploy:canaryfrom
imrja8:fix/5678-file-mount-stale-content

Conversation

@imrja8

@imrja8 imrja8 commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

What is this PR about?

The File Mount editor only showed the content stored in Dokploy's database. When an app writes to its own bind-mounted file (e.g. AnythingLLM saving settings to .env), the change reaches the file on disk but never shows up in the editor, and clicking Update writes the stale copy back over it.

The editor now reads the file from disk when it opens (locally, or over SSH for remote servers) and falls back to the stored content if the file is missing or can't be read. The read never follows symlinks or paths outside the service's files/ directory.

To reproduce: create a Compose service with a File Mount app.env (FOO=from-dokploy) mounted as ../files/app.env:/data/app.env, deploy, then run docker exec <container> sh -c 'printf "\nBAR=from-app\n" >> /data/app.env'.

  • Before: the editor shows only FOO=from-dokploy, and Update deletes BAR.
  • After: the editor shows both lines.

Note: Saving is refused if the file changed on disk after the editor loaded it.

Checklist

Issues related (if applicable)

closes #5678

Screenshots (if applicable)

Tested it and manually verified.

RetriggerView in GreptileConfidence Score: 5/5

The changes appear safe to merge; no new actionable issue was established.

Summary

The File Mount editor now reads the file on disk instead of showing only the stored copy.

  • File Mount editors load the current file from disk.
  • File Mount saves check that the disk copy has not changed.

Both earlier threads were unnumbered, so neither receives a previousFindings entry. The current code addresses their reported paths: it checks the opened file rather than only the final path component, and disables editing and saving while the read runs.

Reviews (2) · Last reviewed commit: "fix(mounts): confine file reads, wait fo..." · Reviewed by Greptile

@imrja8
imrja8 requested a review from Siumauricio as a code owner October 26, 2026 04:15
Comment thread packages/server/src/services/mount.ts Resolved
@imrja8
imrja8 requested a balanced review from Copilot October 27, 2026 05:34

This comment was marked as off-topic.

@imrja8
imrja8 merged commit 16ad519 into Dokploy:canary Oct 29, 2026
5 checks passed
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.

File mount editor does not reflect host-side changes (stale content can overwrite runtime updates)

3 participants