Move domain information to all in private

This commit is contained in:
Owen
2026-09-10 13:57:28 -04:00
parent e66f7fe71b
commit 8a97ed5200
5 changed files with 54 additions and 33 deletions
+3 -15
View File
@@ -21,6 +21,7 @@ import { LimitId } from "@server/lib/billing";
import { isSecondLevelDomain, isValidDomain } from "@server/lib/validators";
import { build } from "@server/build";
import config from "@server/lib/config";
import { createNs, createCname } from "#dynamic/lib/dns/generateDomains";
const paramsSchema = z.strictObject({
orgId: z.string()
@@ -283,8 +284,7 @@ export async function createOrgDomain(
// TODO: This needs to be cross region and not hardcoded
if (type === "ns") {
nsRecords = config.getRawConfig().dns.nameservers as string[];
nsRecords = createNs();
// Save NS records to database
for (const nsValue of nsRecords) {
recordsToInsert.push({
@@ -296,19 +296,7 @@ export async function createOrgDomain(
});
}
} else if (type === "cname") {
cnameRecords = [
{
value: `${domainId}.${config.getRawConfig().dns.cname_extension}`,
baseDomain: baseDomain
}
];
if (build == "saas") {
cnameRecords.push({
value: `_acme-challenge.${domainId}.${config.getRawConfig().dns.cname_extension}`,
baseDomain: `_acme-challenge.${baseDomain}`
});
}
cnameRecords = createCname(domainId, baseDomain);
// Save CNAME records to database
for (const cnameRecord of cnameRecords) {