feat: support wildcard custom domains in gateway#545
Merged
Conversation
Add fallback to `_dstack-app-address-wildcard.{parent}` TXT record
when exact `_dstack-app-address.{sni}` lookup fails. This allows a
single TXT record to route all subdomains of a custom domain to the
same app, while still allowing per-subdomain overrides via exact records.
8c95394 to
6b2a018
Compare
8 tasks
The else branch used ? operator which returned error immediately on exact lookup failure, preventing the wildcard fallback from executing. Use if-let instead to fall through gracefully.
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.
Summary
Add fallback to
_dstack-app-address-wildcard.{parent}TXT recordwhen exact
_dstack-app-address.{sni}lookup fails. This allows asingle TXT record to route all subdomains of a custom domain to the
same app, while still allowing per-subdomain overrides via exact records.
Lookup order
_dstack-app-address.{sni}— exact match_tapp-address.{sni}— legacy compat_dstack-app-address-wildcard.{parent}— wildcard fallbackTest plan
exact-test.test111.kvin.wangresolved via_dstack-app-address.exact-test.test111.kvin.wangTXT, cert CN=exact-test.test111.kvin.wang_dstack-app-address-wildcardTXT record —foo.test111.kvin.wangresolved via_dstack-app-address-wildcard.test111.kvin.wang, cert CN=*.test111.kvin.wangexact-test.test111.kvin.wang(appfdd0dbc3...) andfoo.test111.kvin.wang(app8de234a6...) route to different VMs with different certs