feat: add custom domain support with SSL, DNS verification, and billing

Users can assign a custom domain to their app with automatic SSL via
cert-manager. Includes DNS verification flow (CNAME check), Persian
instructions, admin-configurable pricing via PlatformSetting, and
integration into the deploy wizard cost calculation.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
keyhan
2026-05-14 00:36:29 +03:30
parent d87b50c6a4
commit 435cf92817
18 changed files with 1082 additions and 89 deletions
@@ -8,7 +8,7 @@ import * as crypto from 'crypto';
import { Application } from './entities/application.entity';
import { CreateApplicationDto, UpdateApplicationDto } from './dto/application.dto';
import { ClustersService } from '../clusters/clusters.service';
import { UserRole, DatabaseType } from '../common/enums';
import { UserRole, DatabaseType, CustomDomainStatus } from '../common/enums';
@Injectable()
export class ApplicationsService {
@@ -76,6 +76,8 @@ export class ApplicationsService {
this.logger.log(`Generated DB credentials for app "${dto.name}" — user: ${dbUsername}`);
}
const customDomain = dto.customDomain?.toLowerCase().trim() || undefined;
const app = this.appsRepository.create({
...dto,
userId,
@@ -84,6 +86,8 @@ export class ApplicationsService {
dbUsername,
dbPassword,
subdomain: `${dto.name}-${userId.split('-')[0]}`,
customDomain: customDomain || undefined,
customDomainStatus: customDomain ? CustomDomainStatus.PENDING_DNS : CustomDomainStatus.NONE,
});
return this.appsRepository.save(app);
}