mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-18 18:23:18 +02:00
Generate the cert properly
This commit is contained in:
@@ -24,8 +24,6 @@ import logger from "@server/logger";
|
|||||||
import { defaultRoleAllowedActions } from "@server/routers/role/createRole";
|
import { defaultRoleAllowedActions } from "@server/routers/role/createRole";
|
||||||
import { getNextAvailableAliasAddress } from "../ip";
|
import { getNextAvailableAliasAddress } from "../ip";
|
||||||
import { createCertificate } from "@server/routers/certificates/createCertificate";
|
import { createCertificate } from "@server/routers/certificates/createCertificate";
|
||||||
import { isLicensedOrSubscribed } from "#dynamic/lib/isLicencedOrSubscribed";
|
|
||||||
import { tierMatrix } from "../billing/tierMatrix";
|
|
||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
import { LimitId } from "../billing";
|
import { LimitId } from "../billing";
|
||||||
import { usageService } from "../billing/usageService";
|
import { usageService } from "../billing/usageService";
|
||||||
|
|||||||
@@ -51,9 +51,6 @@ import { tierMatrix } from "../billing/tierMatrix";
|
|||||||
import { isValidCIDR, isValidIP, isValidUrlGlobPattern } from "../validators";
|
import { isValidCIDR, isValidIP, isValidUrlGlobPattern } from "../validators";
|
||||||
import { Config, isTargetsOnlyResource, TargetData } from "./types";
|
import { Config, isTargetsOnlyResource, TargetData } from "./types";
|
||||||
import { getOrCreateLabelIds, syncResourceLabels } from "./labels";
|
import { getOrCreateLabelIds, syncResourceLabels } from "./labels";
|
||||||
import HttpCode from "@server/types/HttpCode";
|
|
||||||
import createHttpError from "http-errors";
|
|
||||||
import next from "next";
|
|
||||||
import { LimitId } from "../billing";
|
import { LimitId } from "../billing";
|
||||||
import { usageService } from "../billing/usageService";
|
import { usageService } from "../billing/usageService";
|
||||||
import { syncInferenceAiConfig } from "./aiProviders";
|
import { syncInferenceAiConfig } from "./aiProviders";
|
||||||
|
|||||||
@@ -632,9 +632,7 @@ async function createHttpResource(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (build !== "oss") {
|
await createCertificate(domainId, fullDomain, db);
|
||||||
await createCertificate(domainId, fullDomain, db);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response<CreateResourceResponse>(res, {
|
return response<CreateResourceResponse>(res, {
|
||||||
data: resource,
|
data: resource,
|
||||||
|
|||||||
@@ -678,9 +678,7 @@ async function updateHttpResource(
|
|||||||
// Update the subdomain in the update data
|
// Update the subdomain in the update data
|
||||||
updateData.subdomain = finalSubdomain;
|
updateData.subdomain = finalSubdomain;
|
||||||
|
|
||||||
if (build != "oss") {
|
await createCertificate(domainId, fullDomain, db);
|
||||||
await createCertificate(domainId, fullDomain, db);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let headers = undefined;
|
let headers = undefined;
|
||||||
|
|||||||
@@ -739,8 +739,7 @@ export async function createSiteResource(
|
|||||||
ssl &&
|
ssl &&
|
||||||
(mode === "http" || mode == "inference") &&
|
(mode === "http" || mode == "inference") &&
|
||||||
domainId &&
|
domainId &&
|
||||||
fullDomain &&
|
fullDomain
|
||||||
build != "oss"
|
|
||||||
) {
|
) {
|
||||||
await createCertificate(domainId, fullDomain, db);
|
await createCertificate(domainId, fullDomain, db);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -718,8 +718,7 @@ export async function updateSiteResource(
|
|||||||
ssl &&
|
ssl &&
|
||||||
(mode === "http" || mode == "inference") &&
|
(mode === "http" || mode == "inference") &&
|
||||||
domainId &&
|
domainId &&
|
||||||
fullDomain &&
|
fullDomain
|
||||||
build != "oss"
|
|
||||||
) {
|
) {
|
||||||
await createCertificate(domainId, fullDomain, db);
|
await createCertificate(domainId, fullDomain, db);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user