feat/container filesystem all service types - #5194
Open
VijinV wants to merge 3 commits into
Open
Conversation
…with permission controls
Add container filesystem browse/download/upload support for postgres, mysql, mariadb, mongo, redis, and compose services (previously application-only). Compose gets its own container-discovery logic since it's multi-container, matching either the docker-compose project label or the swarm stack service-name prefix depending on deploy mode. Introduces a shared filesystem tRPC router and service-filesystem auth util used across every service type instead of duplicating per-router procedures, a containerFilesystem "write" permission for uploads, and a "Files System" tab on each service's dashboard page. Also fixes an infinite-loading bug in the large-directory truncation path and defaults the browser to the container's WORKDIR.
Comment on lines
+318
to
+321
| const filters = { status: ["running"] }; | ||
| const containers = await docker.listContainers({ | ||
| filters: JSON.stringify(filters), | ||
| }); |
Contributor
There was a problem hiding this comment.
If a Compose stack has tasks scheduled on worker nodes, this single-daemon listContainers call omits them, causing the filesystem selector to show missing or no containers and reject access to those tasks.
Knowledge Base Used: Infrastructure runtime
Comment on lines
+63
to
+65
| if (total > maxBytes) { | ||
| req.destroy(); | ||
| reject( |
Contributor
There was a problem hiding this comment.
Upload response socket destroyed
When an upload exceeds the size limit, req.destroy() closes the shared connection before the catch handler sends its 413 JSON response, causing the browser to receive a generic network failure instead of the upload-limit message.
Knowledge Base Used: API boundary
3 tasks
Cross-checks compose stack task counts against the swarm control plane so the filesystem browser can warn when replicas live on nodes this server has no direct connection to, instead of silently showing a partial list. Also fixes the upload route destroying the request socket before the 413 response could flush to the client.
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.
What is this PR about?
This PR extends the container filesystem browser (browse, download, and upload files inside a running container) from
applicationservices to every other service type:postgres,mysql,mariadb,mongo,redis, andcompose(which also covers deployed templates, since a template becomes a regularcomposeentity once deployed).Previously this feature (
packages/server/src/services/container-filesystem.ts, the application-onlyfilesystemContainers/filesystemList/filesystemReadFileprocedures, and theShowContainerFileSystemcomponent) only worked from the Application service page. This PR:getComposeFilesystemContainers/getComposeFilesystemContainerfor compose's multi-container discovery, since compose containers are labeled differently depending on deploy mode (com.docker.compose.project=<appName>for plaindocker compose, vs a<appName>_<service>-prefixed swarm service name fordocker stack deploy) — unlike the other service types, which are always a single swarm service.application-filesystem.tsauth util with a genericservice-filesystem.tsthat dispatches to the right entity finder (findApplicationById,findPostgresById, etc.) based on aserviceType, while preserving the same per-servicecontainerFilesystempermission check andaccessedServicesscoping.filesystemtRPC router ({ serviceType, serviceId }inputs) instead of duplicating the same three procedures across seven routers, and updates the/api/filesystem/downloadand/api/filesystem/uploadroutes to takeserviceType/serviceIdinstead of being application-specific.containerFilesystemwrite permission (previously read-only) so uploads can be permission-gated separately, with owner/admin granted by default and an opt-in toggle for custom roles.finish/errorlisteners the code was waiting on. It now returns a partial,truncated: truelisting instead.WORKDIRinstead of/when a container is selected.Checklist
Before submitting this PR, please make sure that:
canarybranch.Issues related (if applicable)
Screenshots (if applicable)
Greptile Summary
The PR generalizes container filesystem browsing, downloading, and uploading across applications, Compose workloads, and managed databases, with shared authorization and new write permissions.
Confidence Score: 3/5
The PR should not merge until Compose stack discovery handles worker-node tasks and oversized uploads can return their intended error response.
Multi-node Compose stacks can hide valid running containers from the filesystem browser, while exceeding the upload limit destroys the connection and prevents the browser from receiving the structured rejection.
Files Needing Attention: packages/server/src/services/container-filesystem.ts; apps/dokploy/pages/api/filesystem/upload.ts
Reviews (1): Last reviewed commit: "feat: extend container filesystem browsi..." | Re-trigger Greptile
Context used (4)