Skip to content

feat(preview-deployments): variable templates and settings overhaul#4291

Open
colocated wants to merge 4 commits intoDokploy:canaryfrom
colocated:feat/overhaul-preview-deployments-settings
Open

feat(preview-deployments): variable templates and settings overhaul#4291
colocated wants to merge 4 commits intoDokploy:canaryfrom
colocated:feat/overhaul-preview-deployments-settings

Conversation

@colocated
Copy link
Copy Markdown
Contributor

@colocated colocated commented Apr 23, 2026

What is this PR about?

Overhauls the Preview Deployment settings experience. Adds {variable} URL templates, support for four dynamic-DNS providers, and a redesigned settings modal. Preview domains and paths can now use {appname}, {branch}, {pr}, {hash} placeholders alongside the legacy *.domain.com wildcard — no more long hashed subdomains unless you want them.

Key features

  • New variables supported in preview deployment URLs{appname}, {branch}, {pr}, {hash} (case-insensitive) for both the Domain Template and Path fields. Example: pr-{pr}.preview.example.com with path /pr-{pr}/.
  • New dynamic DNS providers supported — traefik.me, nip.io, sslip.io, backname.io are auto-detected and the server IP is injected in the format each service requires (position differs per service).
  • Complete UI overhaul for easier use — Sectioned layout (Routing, HTTPS & Certificates, Triggers & Access), clickable variable chips that insert tokens at the cursor, live preview of the resolved URL, and a clear greyed-out state when the feature is off.
  • Turning on preview deployments no longer closes the modal — The enable toggle lives at the top of the modal and no longer unmounts the settings on flip, preventing in-progress changes being lost across the resulting refetch.
  • HTTPS gets disabled for dynamic DNS options that do not support HTTPS — Currently just traefik.me. When such a domain is entered the HTTPS switch is forced off and locked with an inline explanation.

Checklist

Before submitting this PR, please make sure that:

Issues related (if applicable)

N/A

Screenshots (if applicable)

image image image image image image image HTTPS is not force disabled when using other non-traefik.me providers, and the warning disappears.

Greptile Summary

This PR overhauls the Preview Deployment settings UI — adding {variable} URL templates, four dynamic-DNS provider integrations (traefik.me, nip.io, sslip.io, backname.io), variable-chip insertion, a live URL preview, and a sectioned modal layout. All three previously-flagged concerns are now resolved: unknown tokens are preserved by substitute and rejected by assertNoUnresolvedTokens, mixed */{…} templates are caught by both the zod superRefine and resolveWildcardDomain, and the wildcard path retains the original appName-slugIp single-label format so existing traefik.me URLs are not broken.

Confidence Score: 5/5

Safe to merge; all previously flagged P1s are addressed and only a cosmetic IP preview discrepancy remains.

All prior P1 issues (silent unknown-token substitution, mixed wildcard+template acceptance, unslugified appname, URL format change for existing traefik.me users) are definitively resolved in this revision. The one remaining finding is a P2 UI discrepancy in the example URL when server.ipAddress is unset, which does not affect actual deployment logic.

No files require special attention.

Reviews (4): Last reviewed commit: "fix: dont allow wildcard and variables i..." | Re-trigger Greptile

Add {appname}/{branch}/{pr}/{hash} templates for preview domains and
paths alongside the legacy `*` wildcard. Auto-detect traefik.me,
nip.io, sslip.io and backname.io to inject the server IP.

Overhaul the settings modal: sectioned layout, clickable variable
chips, live preview URL, greyed-out form when disabled, HTTPS lock
for traefik.me, form state survives enable-toggle refetches.
@colocated colocated requested a review from Siumauricio as a code owner April 23, 2026 10:20
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request labels Apr 23, 2026
Comment thread packages/server/src/utils/traefik/preview-domain.ts
Comment thread packages/server/src/utils/traefik/preview-domain.ts
Comment thread packages/server/src/services/preview-deployment.ts
Preserve unknown {...} tokens in substitute and throw with a listing of
supported variables so typos surface instead of producing a mangled
domain. Slugify {appname} alongside the other variables for consistency.
Add resolveWildcardDomain helper so the legacy *.traefik.me URL shape
(appname-ip.traefik.me) is preserved for wildcard-mode users on any
dynamic DNS provider; template-mode users keep the new two-label shape.
@colocated
Copy link
Copy Markdown
Contributor Author

All three inline comments addressed in 29fe9b7:

  • Unknown {variable} tokens now throw with a clear error listing supported vars instead of silently producing a mangled domain.
  • {appname} is pre-slugified consistently with {branch}, {pr}, {hash}.
  • Added resolveWildcardDomain helper that preserves the legacy appname-ip.traefik.me single-label format for *. wildcard mode on any dynamic DNS provider — existing preview deployments keep their URL shape, and template-mode users opt into the new format.

@greptileai please re-review.

@colocated
Copy link
Copy Markdown
Contributor Author

yes i got claude to autofix, i was feeling lazy after i'd redesigned the UI 🤣

@colocated
Copy link
Copy Markdown
Contributor Author

not doing that again, claude broke the preview url box ffs

@colocated
Copy link
Copy Markdown
Contributor Author

@greptileai run it back

Comment thread packages/server/src/utils/traefik/preview-domain.ts
@colocated
Copy link
Copy Markdown
Contributor Author

@greptileai review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant