mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-19 10:25:20 +00:00
refactor(preview-deployment): remove dynamic import of getWebServerSettings and streamline IP retrieval logic
This commit is contained in:
@@ -9,7 +9,10 @@ import { IS_CLOUD } from "../constants";
|
|||||||
import { db } from "../db";
|
import { db } from "../db";
|
||||||
import * as schema from "../db/schema";
|
import * as schema from "../db/schema";
|
||||||
import { getUserByToken } from "../services/admin";
|
import { getUserByToken } from "../services/admin";
|
||||||
import { getWebServerSettings } from "../services/web-server-settings";
|
import {
|
||||||
|
getWebServerSettings,
|
||||||
|
updateWebServerSettings,
|
||||||
|
} from "../services/web-server-settings";
|
||||||
import { getHubSpotUTK, submitToHubSpot } from "../utils/tracking/hubspot";
|
import { getHubSpotUTK, submitToHubSpot } from "../utils/tracking/hubspot";
|
||||||
import { sendEmail } from "../verification/send-verification-email";
|
import { sendEmail } from "../verification/send-verification-email";
|
||||||
import { getPublicIpWithFallback } from "../wss/utils";
|
import { getPublicIpWithFallback } from "../wss/utils";
|
||||||
@@ -124,9 +127,6 @@ const { handler, api } = betterAuth({
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!IS_CLOUD) {
|
if (!IS_CLOUD) {
|
||||||
const { updateWebServerSettings } = await import(
|
|
||||||
"../services/web-server-settings"
|
|
||||||
);
|
|
||||||
await updateWebServerSettings({
|
await updateWebServerSettings({
|
||||||
serverIp: await getPublicIpWithFallback(),
|
serverIp: await getPublicIpWithFallback(),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ import { removeDirectoryCode } from "../utils/filesystem/directory";
|
|||||||
import { authGithub } from "../utils/providers/github";
|
import { authGithub } from "../utils/providers/github";
|
||||||
import { removeTraefikConfig } from "../utils/traefik/application";
|
import { removeTraefikConfig } from "../utils/traefik/application";
|
||||||
import { manageDomain } from "../utils/traefik/domain";
|
import { manageDomain } from "../utils/traefik/domain";
|
||||||
import { findUserById } from "./admin";
|
|
||||||
import { findApplicationById } from "./application";
|
import { findApplicationById } from "./application";
|
||||||
import { removeDeploymentsByPreviewDeploymentId } from "./deployment";
|
import { removeDeploymentsByPreviewDeploymentId } from "./deployment";
|
||||||
import { createDomain } from "./domain";
|
import { createDomain } from "./domain";
|
||||||
import { type Github, getIssueComment } from "./github";
|
import { type Github, getIssueComment } from "./github";
|
||||||
|
import { getWebServerSettings } from "./web-server-settings";
|
||||||
|
|
||||||
export type PreviewDeployment = typeof previewDeployments.$inferSelect;
|
export type PreviewDeployment = typeof previewDeployments.$inferSelect;
|
||||||
|
|
||||||
@@ -253,9 +253,6 @@ const generateWildcardDomain = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!ip) {
|
if (!ip) {
|
||||||
const { getWebServerSettings } = await import(
|
|
||||||
"../services/web-server-settings"
|
|
||||||
);
|
|
||||||
const settings = await getWebServerSettings();
|
const settings = await getWebServerSettings();
|
||||||
ip = settings?.serverIp || "";
|
ip = settings?.serverIp || "";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user