feat(domains): add toggle to enable/disable domains#4697
Open
gentslava wants to merge 4 commits into
Open
Conversation
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>
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?
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)