mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-15 16:59:35 +02:00
Make sure certs are created when creating and updating private resources
This commit is contained in:
@@ -769,7 +769,7 @@ export async function createSiteResource(
|
||||
|
||||
if (
|
||||
ssl &&
|
||||
mode === "http" &&
|
||||
(mode === "http" || mode == "inference") &&
|
||||
domainId &&
|
||||
fullDomain &&
|
||||
build != "oss"
|
||||
|
||||
@@ -30,6 +30,8 @@ import createHttpError from "http-errors";
|
||||
import { z } from "zod";
|
||||
import { fromError } from "zod-validation-error";
|
||||
import { clearSiteResourceAiConfig } from "@server/lib/aiInferenceResource";
|
||||
import { build } from "@server/build";
|
||||
import { createCertificate } from "../certificates/createCertificate";
|
||||
|
||||
const updateSiteResourceParamsSchema = z.strictObject({
|
||||
siteResourceId: z.coerce.number().int().positive()
|
||||
@@ -735,6 +737,16 @@ export async function updateSiteResource(
|
||||
|
||||
const finalUpdatedSiteResource = updatedSiteResource;
|
||||
|
||||
if (
|
||||
ssl &&
|
||||
(mode === "http" || mode == "inference") &&
|
||||
domainId &&
|
||||
fullDomain &&
|
||||
build != "oss"
|
||||
) {
|
||||
await createCertificate(domainId, fullDomain, db);
|
||||
}
|
||||
|
||||
rebuildClientAssociationsFromSiteResource(finalUpdatedSiteResource)
|
||||
.then(() =>
|
||||
waitForSiteResourceRebuildIdle(
|
||||
|
||||
Reference in New Issue
Block a user