Start creating ns one level down

This commit is contained in:
Owen
2026-05-01 16:51:17 -07:00
parent b907850344
commit fbf95c5363

View File

@@ -79,7 +79,7 @@ export async function createCertificate(
let domainToWrite = domain; let domainToWrite = domain;
if ( if (
domainRecord.type == "wildcard" && domainRecord.type == "wildcard" && // this is to fix the wildcard certs for traefik in self hosted NOT ON THE CLOUD
domainRecord.preferWildcardCert && domainRecord.preferWildcardCert &&
!domain.startsWith("*.") !domain.startsWith("*.")
) { ) {
@@ -89,6 +89,16 @@ export async function createCertificate(
domainToWrite = parts.slice(1).join("."); domainToWrite = parts.slice(1).join(".");
domainToWrite = `*.${domainToWrite}`; domainToWrite = `*.${domainToWrite}`;
} }
} else if (domainRecord.type == "ns") {
// first if we have a * in the domain for this case we dont want to include it because it will mess with the cert generator so remove it
if (domain.startsWith("*.")) {
domain = domain.slice(2);
}
const parts = domain.split(".");
if (parts.length > 2) {
domainToWrite = parts.slice(1).join(".");
}
} }
// No cert found, create a new one in pending state // No cert found, create a new one in pending state