-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat(domains): add custom wildcard domain support for applications (Organization and Project level setting) #3324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
amirhmoradi
wants to merge
11
commits into
Dokploy:canary
Choose a base branch
from
amirhmoradi:claude/fix-wildcard-migrations-IFoqx
base: canary
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat(domains): add custom wildcard domain support for applications (Organization and Project level setting) #3324
amirhmoradi
wants to merge
11
commits into
Dokploy:canary
from
amirhmoradi:claude/fix-wildcard-migrations-IFoqx
Conversation
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
Add the ability for organization admins and project admins to configure custom wildcard domains that replace the default traefik.me subdomains for auto-generated application domains. Features: - Organization-level wildcard domain setting (e.g., *-apps.example.com) - Project-level wildcard domain override with inheritance option - Updated domain generation to use custom wildcards when configured - New UI components for configuring wildcard domains in settings - Domain dialog tooltip shows active wildcard domain pattern The domain generation follows this hierarchy: 1. Project-specific wildcard domain (if set) 2. Organization wildcard domain (if project inherits and org has one) 3. Default traefik.me domain (fallback) Example: Setting wildcard domain to "*-apps.example.com" will generate domains like "myapp-a1b2c3-apps.example.com" for new applications.
…-domain-implementation-and-test Handle preview wildcard domains in generated hosts
…ustom-wildcard-domains-01Pa52auo5dyyAmSUGfCTvSr
The wildcard domain migration (originally 0131_dry_rictor.sql) conflicted with the canary branch migration 0131_volatile_beast.sql. The journal only tracked the canary migration, causing the wildcard migration to never be applied. Changes: - Renamed 0131_dry_rictor.sql to 0134_add_wildcard_domains.sql to avoid index conflict with 0131_volatile_beast.sql - Updated _journal.json to reference the new migration at idx 134 - Removed the invalid 0133_vibrant_melville entry (file did not exist) - Fixed 0134_snapshot.json to properly chain from 0132 and include all required columns (createEnvFile, isDefault, wildcardDomain, useOrganizationWildcard) This ensures drizzle-orm will correctly detect and apply the wildcard domain migration when the code is deployed.
…-migrations-IFoqx
3 tasks
Move migration execution to run BEFORE app.prepare() to ensure database schema changes are applied before any queries are made. This fixes errors like "column wildcardDomain does not exist" on existing installations when new schema columns are added. The previous order was: 1. app.prepare() - Next.js loads and may query DB 2. migration() - too late, queries already failed New order: 1. migration() - apply schema changes first 2. app.prepare() - safe to query with new columns
…res" This reverts commit 4d7f4a9.
This fixes the "column wildcardDomain does not exist" error that occurs when the wildcard domain migration hasn't been applied yet. The issue was that auth queries used `organization: true` which selects ALL columns from the organization table, including wildcardDomain. When validateRequest runs before migration completes, this causes errors. Changed to only select the specific columns actually needed: - Session creation callback: only needs organization.id - API key validation: only needs organization.ownerId - Session validation: only needs organization.ownerId This is the proper fix because: - It doesn't modify migration or startup logic - It only selects what's actually needed (better for performance too) - Works regardless of migration timing - Follows the principle of minimal data selection
a23046b to
20e5967
Compare
Fixes the migration not being applied on existing installations: 1. Renamed migration from 0134 to 0133 to fill the gap in sequence 2. Added IF NOT EXISTS to handle partial migration failures gracefully 3. Updated journal and snapshot with fresh IDs This ensures the migration is recognized as new and will be applied even if a previous attempt failed partially.
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?
Custom Wildcard Domains: Configure wildcard domains at the organization or project level for generated application and preview URLs.
NOTE: This takes over from #3297
Checklist
Before submitting this PR, please make sure that:
canarybranch.Issues related (if applicable)
None
Screenshots (if applicable)
TBD