feat(domains): add toggle to enable/disable domains - #4697
Conversation
|
Hi, like the change! |
Compose domains are rendered as docker labels and only take effect on the next deployment. Extract the "redeploy required" notice into a reusable component/strings and surface it consistently: as a banner in the domains list, in the add/edit dialog (replacing the inline copy), and in the toast shown after create/update/delete. Unify grid deletion onto the shared handler so the hint applies in both grid and table views. Groundwork for the upcoming domain enable/disable toggle. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add an `enabled` flag (default true) so a domain can be switched off without deleting it, preserving its configuration. - schema: new `enabled` column + migration; added to apiUpdateDomain - traefik (applications): guard manageDomain so a disabled domain never exposes a router from any caller (create/update/forward-auth/toggle); applies instantly through the file provider - compose: skip disabled domains when generating docker labels, so the change applies on the next deployment - tRPC: new domain.toggleEnable procedure (permission-checked + audited), returns requiresRedeploy for compose domains - UI: switch on the domain card (host row, variant E) and a Status column in the table view; disabled cards are dimmed; reuses the compose redeploy hint for the toast Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add unit tests for addDomainToCompose verifying that a disabled domain produces no traefik labels, an enabled domain does, and only the enabled one emits labels when both are attached to the same service. Mocks node:fs so loadDockerCompose runs against an in-memory compose spec. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The new non-null `enabled` column makes it a required field on the Domain type, so the existing traefik/compose test fixtures need it too. Adds `enabled: true` to each base fixture (spread-based fixtures inherit it). Fixes the apps/dokploy typecheck failure on CI. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
a52adc6 to
0e3c228
Compare
|
Thanks for the suggestion! Implemented — the redundant Enabled/Disabled text has been removed from the domain toggles. |
|
@Siumauricio, could you please take a look and merge when possible? I rebased this PR onto the latest canary to avoid any new conflicts. |
|
@gentslava Looks good. I will be doing some tests and it everything is ok I will merge |
|
@gentslava I completed my tests. The functionality looks good. Check the last comment from geptile. |
|
@gentslava Good work. Minor UX inconsistency: the grid-card view wraps the enable/disable switch in a explaining what it does ("Domain is active. Toggle to disable routing without deleting it." / "Domain is disabled and not routed. Toggle to enable it again."), but the table view's Status column switch has no tooltip at all. Not blocking, but worth aligning both views so the explanation is available regardless of which view the user is in. I will approve the PR soon just doing final checks. If you want to send another commit is ok too. |
|
@narcisonunez Addressed in 92b628c. The table Status switch now uses the same enabled and disabled tooltip copy as the grid-card view. |
|
@gentslava Recreate the migrations to fix the conflicts and we are good to approve |
…e-disable # Conflicts: # apps/dokploy/drizzle/meta/0182_snapshot.json # apps/dokploy/drizzle/meta/_journal.json
|
@narcisonunez Done — merged the latest canary, kept 0182_skinny_wild_pack from canary, and regenerated the domain enabled migration as 0183_tearful_groot. The migration snapshot/journal chain is clean and the PR is mergeable now. Typecheck and the relevant domain, Traefik, and security tests pass locally. |
narcisonunez
left a comment
There was a problem hiding this comment.
Thanks for your contribution. Good stuff
What is this PR about?
Adds an
enabledflag to domains so a domain can be switched off without deleting it, preserving its configuration. A switch is added to the Domains tab (grid card host row + a Status column in the table view).enabledcolumn (defaulttrue) + migration; included inapiUpdateDomain.manageDomainso a disabled domain never exposes a traefik router from any caller (create/update/forward-auth/toggle); applies instantly via the file provider.addDomainToComposeskips disabled domains when generating docker labels, so the change applies on the next deployment.domain.toggleEnableprocedure (permission-checked + audited); returnsrequiresRedeployfor compose.Checklist
Before submitting this PR, please make sure that:
canarybranch.Issues related (if applicable)
closes #4696
Screenshots (if applicable)
Greptile Summary
The PR adds an enabled state for application and Compose domains, with persistence, permission-checked toggling, UI controls, and routing reconciliation.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains; the previously reported stale-label, prior-service, and mapping-label issues are addressed by current cleanup and regeneration behavior.
Reviews (7): Last reviewed commit: "test(compose): enable domain in security..." | Re-trigger Greptile
Context used: