fix: Dokploy domain.create uses 'host' (not 'hostName') + certificateType: letsencrypt
- Field name: hostName → host (verified via direct API test) - Added certificateType: 'letsencrypt' for automatic HTTPS cert provisioning - Updated createDomain in dokploy.ts + custom-domain route - HTTPS is enabled by default (https: true) - Let's Encrypt auto-provisions certificate for the subdomain
This commit is contained in:
1 parent
4b6a1946b4
commit
7e458ae698
2 files changed
+9
-5
No files matched your search
+7
-4
@@ -259,17 +259,19 @@ export function createDokployClient(config: DokployConfig) {
|
||||
|
||||
async function createDomain(input: {
|
||||
applicationId: string
|
||||
hostName: string
|
||||
host: string
|
||||
path?: string
|
||||
port?: number
|
||||
https?: boolean
|
||||
certificateType?: string
|
||||
}): Promise<DokployDomain> {
|
||||
const res = await call<{ domainId?: string; id?: string }>('/domain.create', {
|
||||
applicationId: input.applicationId,
|
||||
hostName: input.hostName,
|
||||
host: input.host,
|
||||
path: input.path ?? '/',
|
||||
port: input.port ?? 3000,
|
||||
https: input.https ?? true,
|
||||
certificateType: input.certificateType ?? 'letsencrypt',
|
||||
})
|
||||
const domainId = res.domainId ?? res.id
|
||||
if (!domainId) {
|
||||
@@ -277,7 +279,7 @@ export function createDokployClient(config: DokployConfig) {
|
||||
}
|
||||
return {
|
||||
domainId,
|
||||
hostName: input.hostName,
|
||||
hostName: input.host,
|
||||
applicationId: input.applicationId,
|
||||
https: input.https ?? true,
|
||||
}
|
||||
@@ -349,9 +351,10 @@ export function createDokployClient(config: DokployConfig) {
|
||||
try {
|
||||
domain = await createDomain({
|
||||
applicationId: app.applicationId,
|
||||
hostName: input.subdomain,
|
||||
host: input.subdomain,
|
||||
port: 3000,
|
||||
https: true,
|
||||
certificateType: 'letsencrypt',
|
||||
})
|
||||
} catch (e) {
|
||||
// Domain creation is non-fatal — app is already deployed
|
||||
|
||||
Reference in new issue
Block a user