feat(compose): add configurable MTU for isolated networks#4071
feat(compose): add configurable MTU for isolated networks#4071Hobby-Student wants to merge 1 commit intoDokploy:canaryfrom
Conversation
|
Related Documentation 2 document(s) may need updating based on files changed in this PR: Dokploy's Space AGENTS
|
apps/dokploy/components/dashboard/compose/advanced/add-isolation.tsx
Outdated
Show resolved
Hide resolved
c58e4f0 to
fad2093
Compare
fad2093 to
26a72eb
Compare
|
I updated the PR accordingly to the suggestions. |
mahdirajaee
left a comment
There was a problem hiding this comment.
Good feature addition — configurable MTU is a real need for users running behind VPN or overlay networks. The Zod validation with z.number().int().min(68).max(9000) is solid and covers the practical MTU range correctly, and I appreciate that .int() is included to reject fractional values. The guard for composeType !== "stack" in the shell command is correct since overlay/swarm networks don't support the --opt com.docker.network.driver.mtu flag.
One concern with the network creation command: the docker network inspect ... || docker network create ... pattern means if a network already exists with a different MTU, the new MTU value will be silently ignored. It might be worth documenting this behavior or, alternatively, checking the current MTU and warning/recreating if it differs — otherwise users will change the MTU in the UI and see no effect until they manually remove the old network.
The DB migration is clean and the nullable integer column is the right choice. Minor nit: the migration SQL file is missing a trailing newline (\ No newline at end of file), which some linting tools will flag.
I think recreating is difficult, because the network could be used by other compose files. this could break working connections and trigger unwanted side effects. perhaps documenting and log an info in deployment is the right way? What do you think?
will fix this, too. |
What is this PR about?
It's about setting MTU on docker compose (not swarm).
Checklist
Before submitting this PR, please make sure that:
canarybranch.Issues related (if applicable)
#3446
Screenshots (if applicable)
Greptile Summary
This PR adds a configurable MTU option for isolated Docker Compose networks, allowing users to set a custom MTU (e.g., 1350 for VPN/overlay environments) when isolated deployment is enabled. The database migration, schema, UI field, and shell command generation all follow established patterns in the codebase.
Key findings:
.env.productionfile — an empty file was committed that is unrelated to this feature and should be removed before merge.<FormMessage />in the MTU input field — Zod validation errors (out-of-range values) will be silently swallowed and the form will appear to do nothing, with no feedback to the user..int()— MTU values are always whole numbers; accepting floats allows values like1499.5that PostgreSQL silently truncates to an integer.composeType !== "stack", since Docker overlay/swarm networks do not support the--opt com.docker.network.driver.mtuflag.Confidence Score: 3/5
.env.productioncommit and missing form validation feedback need to be addressed first..env.productionfile is a clear mistake that must be reverted, and the missingFormMessagemeans users get no feedback when they enter an invalid MTU value, which is a noticeable UX regression on a newly added form field..env.production(should not be committed) andapps/dokploy/components/dashboard/compose/advanced/add-isolation.tsx(missingFormMessage, missing.int()validation).Comments Outside Diff (1)
.env.production, line 1 (link)An empty
.env.productionfile has been added to the repository. This file appears to be accidentally included in this PR — it has no relation to the MTU feature and should not be committed.Production environment files typically contain sensitive credentials and are expected to be in
.gitignore. Committing an empty one can mislead maintainers or cause issues if the real populated file is later committed on top of it.Reviews (1): Last reviewed commit: "feat(compose): add configurable MTU for ..." | Re-trigger Greptile
(2/5) Greptile learns from your feedback when you react with thumbs up/down!