From 26b81e4dbc5f2a9443e9fbba6fba4ef63c89bcb0 Mon Sep 17 00:00:00 2001 From: Sagar Chhetri Date: Fri, 7 Aug 2026 08:46:36 +0545 Subject: [PATCH 1/8] feat: auto-validate DNS when Domains page loads Run domain DNS checks automatically once domains and server IP context are available, so users no longer need to click Validate DNS on every visit. --- .../application/domains/show-domains.tsx | 93 ++++++++++++------- 1 file changed, 59 insertions(+), 34 deletions(-) diff --git a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx index f4206ee95..000f7b557 100644 --- a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx +++ b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx @@ -25,7 +25,7 @@ import { XCircle, } from "lucide-react"; import Link from "next/link"; -import { useState } from "react"; +import { useCallback, useEffect, useRef, useState } from "react"; import { toast } from "sonner"; import { DialogAction } from "@/components/shared/dialog-action"; import { Badge } from "@/components/ui/badge"; @@ -87,7 +87,7 @@ export const ShowDomains = ({ id, type }: Props) => { const { data: permissions } = api.user.getPermissions.useQuery(); const canCreateDomain = permissions?.domain.create ?? false; const canDeleteDomain = permissions?.domain.delete ?? false; - const { data: application } = + const { data: application, isFetched: isApplicationFetched } = type === "application" ? api.application.one.useQuery( { @@ -108,6 +108,7 @@ export const ShowDomains = ({ id, type }: Props) => { const [validationStates, setValidationStates] = useState( {}, ); + const autoValidatedHostsRef = useRef>(new Set()); const [viewMode, setViewMode] = useState<"grid" | "table">(() => { if (typeof window !== "undefined") { return ( @@ -121,7 +122,7 @@ export const ShowDomains = ({ id, type }: Props) => { const [columnFilters, setColumnFilters] = useState([]); const [columnVisibility, setColumnVisibility] = useState({}); const [rowSelection, setRowSelection] = useState({}); - const { data: ip } = api.settings.getIp.useQuery(); + const { data: ip, isFetched: isIpFetched } = api.settings.getIp.useQuery(); const { data, @@ -182,41 +183,65 @@ export const ShowDomains = ({ id, type }: Props) => { } }; - const handleValidateDomain = async (host: string) => { - setValidationStates((prev) => ({ - ...prev, - [host]: { isLoading: true }, - })); - - try { - const result = await validateDomain({ - domain: host, - serverId: application?.serverId ?? undefined, - }); - + const handleValidateDomain = useCallback( + async (host: string) => { setValidationStates((prev) => ({ ...prev, - [host]: { - isLoading: false, - isValid: result.isValid, - error: result.error, - resolvedIp: result.resolvedIp, - cdnProvider: result.cdnProvider, - message: result.error && result.isValid ? result.error : undefined, - }, - })); - } catch (err) { - const error = err as Error; - setValidationStates((prev) => ({ - ...prev, - [host]: { - isLoading: false, - isValid: false, - error: error.message || "Failed to validate domain", - }, + [host]: { isLoading: true }, })); + + try { + const result = await validateDomain({ + domain: host, + serverIp: + application?.server?.ipAddress?.toString() || ip?.toString() || "", + }); + + setValidationStates((prev) => ({ + ...prev, + [host]: { + isLoading: false, + isValid: result.isValid, + error: result.error, + resolvedIp: result.resolvedIp, + cdnProvider: result.cdnProvider, + message: result.error && result.isValid ? result.error : undefined, + }, + })); + } catch (err) { + const error = err as Error; + setValidationStates((prev) => ({ + ...prev, + [host]: { + isLoading: false, + isValid: false, + error: error.message || "Failed to validate domain", + }, + })); + } + }, + [validateDomain, application?.server?.ipAddress, ip], + ); + + useEffect(() => { + autoValidatedHostsRef.current = new Set(); + setValidationStates({}); + }, [id]); + + useEffect(() => { + if (!data?.length || !isIpFetched || !isApplicationFetched) { + return; } - }; + + for (const item of data) { + if (autoValidatedHostsRef.current.has(item.host)) { + continue; + } + + autoValidatedHostsRef.current.add(item.host); + void handleValidateDomain(item.host); + } + }, [data, isIpFetched, isApplicationFetched, handleValidateDomain]); const columns = createColumns({ id, From f62e9b3a12ff3eb3c5b8ad221af322c7dfa07807 Mon Sep 17 00:00:00 2001 From: Sagar Chhetri Date: Fri, 7 Aug 2026 08:48:52 +0545 Subject: [PATCH 2/8] fix: harden auto DNS validation against stale and empty IP results Ignore in-flight validation results after switching services, wait for a real server IP before auto-checking, and limit concurrent DNS lookups. --- .../application/domains/show-domains.tsx | 97 ++++++++++++++++--- 1 file changed, 86 insertions(+), 11 deletions(-) diff --git a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx index 000f7b557..39ece9007 100644 --- a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx +++ b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx @@ -109,6 +109,7 @@ export const ShowDomains = ({ id, type }: Props) => { {}, ); const autoValidatedHostsRef = useRef>(new Set()); + const validationRequestIdRef = useRef(0); const [viewMode, setViewMode] = useState<"grid" | "table">(() => { if (typeof window !== "undefined") { return ( @@ -183,8 +184,26 @@ export const ShowDomains = ({ id, type }: Props) => { } }; + const resolveServerIp = useCallback(() => { + const remoteIp = application?.server?.ipAddress?.toString(); + if (application?.serverId) { + return remoteIp || undefined; + } + + return ip?.toString() || undefined; + }, [application?.server?.ipAddress, application?.serverId, ip]); + const handleValidateDomain = useCallback( - async (host: string) => { + async (host: string, serverIpOverride?: string) => { + const requestId = validationRequestIdRef.current; + const serverIp = + serverIpOverride ?? + (application?.server?.ipAddress?.toString() || ip?.toString() || ""); + + if (validationRequestIdRef.current !== requestId) { + return; + } + setValidationStates((prev) => ({ ...prev, [host]: { isLoading: true }, @@ -193,10 +212,13 @@ export const ShowDomains = ({ id, type }: Props) => { try { const result = await validateDomain({ domain: host, - serverIp: - application?.server?.ipAddress?.toString() || ip?.toString() || "", + serverIp, }); + if (validationRequestIdRef.current !== requestId) { + return; + } + setValidationStates((prev) => ({ ...prev, [host]: { @@ -209,6 +231,10 @@ export const ShowDomains = ({ id, type }: Props) => { }, })); } catch (err) { + if (validationRequestIdRef.current !== requestId) { + return; + } + const error = err as Error; setValidationStates((prev) => ({ ...prev, @@ -224,24 +250,73 @@ export const ShowDomains = ({ id, type }: Props) => { ); useEffect(() => { + validationRequestIdRef.current += 1; autoValidatedHostsRef.current = new Set(); setValidationStates({}); }, [id]); useEffect(() => { - if (!data?.length || !isIpFetched || !isApplicationFetched) { + if (!data?.length || !isApplicationFetched) { return; } - for (const item of data) { - if (autoValidatedHostsRef.current.has(item.host)) { - continue; + if (application?.serverId) { + if (!application.server?.ipAddress) { + return; } - - autoValidatedHostsRef.current.add(item.host); - void handleValidateDomain(item.host); + } else if (!isIpFetched) { + return; } - }, [data, isIpFetched, isApplicationFetched, handleValidateDomain]); + + const serverIp = resolveServerIp(); + if (!serverIp) { + return; + } + + const hostsToValidate = data + .map((item) => item.host) + .filter((host) => { + if (autoValidatedHostsRef.current.has(host)) { + return false; + } + + autoValidatedHostsRef.current.add(host); + return true; + }); + + if (hostsToValidate.length === 0) { + return; + } + + const maxConcurrent = 5; + let nextIndex = 0; + + const runNext = async () => { + while (nextIndex < hostsToValidate.length) { + const host = hostsToValidate[nextIndex]; + nextIndex += 1; + if (!host) { + continue; + } + await handleValidateDomain(host, serverIp); + } + }; + + void Promise.all( + Array.from( + { length: Math.min(maxConcurrent, hostsToValidate.length) }, + () => runNext(), + ), + ); + }, [ + data, + isIpFetched, + isApplicationFetched, + application?.serverId, + application?.server?.ipAddress, + resolveServerIp, + handleValidateDomain, + ]); const columns = createColumns({ id, From 1ef08bdb1b223bb85a36f48f27b0b6dcbc5693e1 Mon Sep 17 00:00:00 2001 From: Sagar Chhetri Date: Fri, 7 Aug 2026 09:00:30 +0545 Subject: [PATCH 3/8] fix: ignore stale DNS results when a newer host check starts Track a per-host validation generation so an older automatic check cannot overwrite a newer manual re-validation result. --- .../application/domains/show-domains.tsx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx index 39ece9007..6a12884eb 100644 --- a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx +++ b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx @@ -110,6 +110,7 @@ export const ShowDomains = ({ id, type }: Props) => { ); const autoValidatedHostsRef = useRef>(new Set()); const validationRequestIdRef = useRef(0); + const hostValidationRequestIdsRef = useRef>(new Map()); const [viewMode, setViewMode] = useState<"grid" | "table">(() => { if (typeof window !== "undefined") { return ( @@ -195,12 +196,20 @@ export const ShowDomains = ({ id, type }: Props) => { const handleValidateDomain = useCallback( async (host: string, serverIpOverride?: string) => { - const requestId = validationRequestIdRef.current; + const serviceRequestId = validationRequestIdRef.current; + const hostRequestId = + (hostValidationRequestIdsRef.current.get(host) ?? 0) + 1; + hostValidationRequestIdsRef.current.set(host, hostRequestId); + const serverIp = serverIpOverride ?? (application?.server?.ipAddress?.toString() || ip?.toString() || ""); - if (validationRequestIdRef.current !== requestId) { + const isCurrentRequest = () => + validationRequestIdRef.current === serviceRequestId && + hostValidationRequestIdsRef.current.get(host) === hostRequestId; + + if (!isCurrentRequest()) { return; } @@ -215,7 +224,7 @@ export const ShowDomains = ({ id, type }: Props) => { serverIp, }); - if (validationRequestIdRef.current !== requestId) { + if (!isCurrentRequest()) { return; } @@ -231,7 +240,7 @@ export const ShowDomains = ({ id, type }: Props) => { }, })); } catch (err) { - if (validationRequestIdRef.current !== requestId) { + if (!isCurrentRequest()) { return; } @@ -252,6 +261,7 @@ export const ShowDomains = ({ id, type }: Props) => { useEffect(() => { validationRequestIdRef.current += 1; autoValidatedHostsRef.current = new Set(); + hostValidationRequestIdsRef.current = new Map(); setValidationStates({}); }, [id]); From d79ce28bab440fd25fbf0c3f3edffe4812a92f85 Mon Sep 17 00:00:00 2001 From: Sagar Chhetri Date: Fri, 7 Aug 2026 11:38:19 +0545 Subject: [PATCH 4/8] fix: wait for service data before auto DNS validation Require the application/compose object to be present so auto-validation does not fall back to the global IP when service context is still missing. --- .../components/dashboard/application/domains/show-domains.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx index 6a12884eb..4db7e00d8 100644 --- a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx +++ b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx @@ -266,11 +266,11 @@ export const ShowDomains = ({ id, type }: Props) => { }, [id]); useEffect(() => { - if (!data?.length || !isApplicationFetched) { + if (!data?.length || !isApplicationFetched || !application) { return; } - if (application?.serverId) { + if (application.serverId) { if (!application.server?.ipAddress) { return; } From 5cacee8c2825b6ac37267a220fd3a718d1e39fef Mon Sep 17 00:00:00 2001 From: Sagar Chhetri Date: Fri, 7 Aug 2026 12:00:40 +0545 Subject: [PATCH 5/8] fix: include application in auto-validation effect deps Keep the effect dependency list in sync with the service-data guard so auto DNS validation reruns when the loaded service object becomes available. --- .../components/dashboard/application/domains/show-domains.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx index 4db7e00d8..9064ca780 100644 --- a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx +++ b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx @@ -322,6 +322,7 @@ export const ShowDomains = ({ id, type }: Props) => { data, isIpFetched, isApplicationFetched, + application, application?.serverId, application?.server?.ipAddress, resolveServerIp, From 1c099691b7e51bd91befa500650e75a92968da1c Mon Sep 17 00:00:00 2001 From: Sagar Chhetri Date: Fri, 7 Aug 2026 12:04:05 +0545 Subject: [PATCH 6/8] fix: re-run auto DNS validation when expected server IP changes Clear the processed-host cache when the resolved server IP changes so domain badges refresh against the current expected IP. --- .../dashboard/application/domains/show-domains.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx index 9064ca780..9a0615cb6 100644 --- a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx +++ b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx @@ -111,6 +111,7 @@ export const ShowDomains = ({ id, type }: Props) => { const autoValidatedHostsRef = useRef>(new Set()); const validationRequestIdRef = useRef(0); const hostValidationRequestIdsRef = useRef>(new Map()); + const lastAutoValidatedServerIpRef = useRef(undefined); const [viewMode, setViewMode] = useState<"grid" | "table">(() => { if (typeof window !== "undefined") { return ( @@ -262,6 +263,7 @@ export const ShowDomains = ({ id, type }: Props) => { validationRequestIdRef.current += 1; autoValidatedHostsRef.current = new Set(); hostValidationRequestIdsRef.current = new Map(); + lastAutoValidatedServerIpRef.current = undefined; setValidationStates({}); }, [id]); @@ -283,6 +285,11 @@ export const ShowDomains = ({ id, type }: Props) => { return; } + if (lastAutoValidatedServerIpRef.current !== serverIp) { + lastAutoValidatedServerIpRef.current = serverIp; + autoValidatedHostsRef.current = new Set(); + } + const hostsToValidate = data .map((item) => item.host) .filter((host) => { From 7dbf6014c878a26e422bc39445a63af7d4fd3631 Mon Sep 17 00:00:00 2001 From: Sagar Chhetri <45119768+sagarchhetribird@users.noreply.github.com> Date: Sat, 29 Aug 2026 12:49:38 +0545 Subject: [PATCH 7/8] test: harden domain DNS validation transitions --- .../services/domain-validation.test.ts | 48 +++++++++++++ .../application/domains/show-domains.tsx | 72 +++++++++++++------ .../application/domains/validation.ts | 33 +++++++++ 3 files changed, 130 insertions(+), 23 deletions(-) create mode 100644 apps/dokploy/__test__/services/domain-validation.test.ts create mode 100644 apps/dokploy/components/dashboard/application/domains/validation.ts diff --git a/apps/dokploy/__test__/services/domain-validation.test.ts b/apps/dokploy/__test__/services/domain-validation.test.ts new file mode 100644 index 000000000..02c4670b9 --- /dev/null +++ b/apps/dokploy/__test__/services/domain-validation.test.ts @@ -0,0 +1,48 @@ +import { describe, expect, it } from "vitest"; +import { + didServerIpChange, + getHostsToAutoValidate, + isCurrentValidation, +} from "@/components/dashboard/application/domains/validation"; + +describe("domain auto-validation", () => { + it("only schedules enabled, unvalidated hosts", () => { + const hosts = getHostsToAutoValidate( + [ + { host: "already.example.com", enabled: true }, + { host: "disabled.example.com", enabled: false }, + { host: "new.example.com", enabled: true }, + ], + new Set(["already.example.com"]), + ); + + expect(hosts).toEqual(["new.example.com"]); + }); + + it("rejects results from a previous service scope", () => { + expect( + isCurrentValidation({ + currentScopeRequestId: 2, + currentHostRequestId: 1, + hostRequestId: 1, + scopeRequestId: 1, + }), + ).toBe(false); + }); + + it("rejects an older request for the same host", () => { + expect( + isCurrentValidation({ + currentScopeRequestId: 1, + currentHostRequestId: 2, + hostRequestId: 1, + scopeRequestId: 1, + }), + ).toBe(false); + }); + + it("detects expected server IP changes", () => { + expect(didServerIpChange("203.0.113.10", "203.0.113.11")).toBe(true); + expect(didServerIpChange("203.0.113.10", "203.0.113.10")).toBe(false); + }); +}); diff --git a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx index 9a0615cb6..541ba3b7c 100644 --- a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx +++ b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx @@ -66,6 +66,11 @@ import { DnsHelperModal } from "./dns-helper-modal"; import { AddDomain } from "./handle-domain"; import { HandleForwardAuth } from "./handle-forward-auth"; import { COMPOSE_REDEPLOY_TOAST, ComposeRedeployAlert } from "./redeploy-hint"; +import { + didServerIpChange, + getHostsToAutoValidate, + isCurrentValidation, +} from "./validation"; export type ValidationState = { isLoading: boolean; @@ -112,6 +117,9 @@ export const ShowDomains = ({ id, type }: Props) => { const validationRequestIdRef = useRef(0); const hostValidationRequestIdsRef = useRef>(new Map()); const lastAutoValidatedServerIpRef = useRef(undefined); + const activeValidationScopeRef = useRef(`${type}:${id}`); + const lastObservedServerIpRef = useRef(undefined); + const validationScope = `${type}:${id}`; const [viewMode, setViewMode] = useState<"grid" | "table">(() => { if (typeof window !== "undefined") { return ( @@ -194,6 +202,22 @@ export const ShowDomains = ({ id, type }: Props) => { return ip?.toString() || undefined; }, [application?.server?.ipAddress, application?.serverId, ip]); + const resolvedServerIp = resolveServerIp(); + + if (activeValidationScopeRef.current !== validationScope) { + activeValidationScopeRef.current = validationScope; + validationRequestIdRef.current += 1; + autoValidatedHostsRef.current = new Set(); + hostValidationRequestIdsRef.current = new Map(); + lastAutoValidatedServerIpRef.current = undefined; + } + + if (didServerIpChange(lastObservedServerIpRef.current, resolvedServerIp)) { + lastObservedServerIpRef.current = resolvedServerIp; + validationRequestIdRef.current += 1; + hostValidationRequestIdsRef.current = new Map(); + autoValidatedHostsRef.current = new Set(); + } const handleValidateDomain = useCallback( async (host: string, serverIpOverride?: string) => { @@ -202,13 +226,15 @@ export const ShowDomains = ({ id, type }: Props) => { (hostValidationRequestIdsRef.current.get(host) ?? 0) + 1; hostValidationRequestIdsRef.current.set(host, hostRequestId); - const serverIp = - serverIpOverride ?? - (application?.server?.ipAddress?.toString() || ip?.toString() || ""); + const serverIp = serverIpOverride ?? resolveServerIp() ?? ""; const isCurrentRequest = () => - validationRequestIdRef.current === serviceRequestId && - hostValidationRequestIdsRef.current.get(host) === hostRequestId; + isCurrentValidation({ + currentScopeRequestId: validationRequestIdRef.current, + currentHostRequestId: hostValidationRequestIdsRef.current.get(host), + hostRequestId, + scopeRequestId: serviceRequestId, + }); if (!isCurrentRequest()) { return; @@ -256,16 +282,19 @@ export const ShowDomains = ({ id, type }: Props) => { })); } }, - [validateDomain, application?.server?.ipAddress, ip], + [validateDomain, resolveServerIp], ); useEffect(() => { - validationRequestIdRef.current += 1; - autoValidatedHostsRef.current = new Set(); - hostValidationRequestIdsRef.current = new Map(); - lastAutoValidatedServerIpRef.current = undefined; setValidationStates({}); - }, [id]); + + return () => { + validationRequestIdRef.current += 1; + autoValidatedHostsRef.current = new Set(); + hostValidationRequestIdsRef.current = new Map(); + lastAutoValidatedServerIpRef.current = undefined; + }; + }, [validationScope]); useEffect(() => { if (!data?.length || !isApplicationFetched || !application) { @@ -280,7 +309,7 @@ export const ShowDomains = ({ id, type }: Props) => { return; } - const serverIp = resolveServerIp(); + const serverIp = resolvedServerIp; if (!serverIp) { return; } @@ -290,16 +319,13 @@ export const ShowDomains = ({ id, type }: Props) => { autoValidatedHostsRef.current = new Set(); } - const hostsToValidate = data - .map((item) => item.host) - .filter((host) => { - if (autoValidatedHostsRef.current.has(host)) { - return false; - } - - autoValidatedHostsRef.current.add(host); - return true; - }); + const hostsToValidate = getHostsToAutoValidate( + data, + autoValidatedHostsRef.current, + ); + hostsToValidate.forEach((host) => { + autoValidatedHostsRef.current.add(host); + }); if (hostsToValidate.length === 0) { return; @@ -332,7 +358,7 @@ export const ShowDomains = ({ id, type }: Props) => { application, application?.serverId, application?.server?.ipAddress, - resolveServerIp, + resolvedServerIp, handleValidateDomain, ]); diff --git a/apps/dokploy/components/dashboard/application/domains/validation.ts b/apps/dokploy/components/dashboard/application/domains/validation.ts new file mode 100644 index 000000000..25c4c0f95 --- /dev/null +++ b/apps/dokploy/components/dashboard/application/domains/validation.ts @@ -0,0 +1,33 @@ +export type AutoValidationDomain = { + host: string; + enabled?: boolean; +}; + +export const getHostsToAutoValidate = ( + domains: readonly AutoValidationDomain[], + validatedHosts: ReadonlySet, +) => + domains + .filter( + (domain) => domain.enabled !== false && !validatedHosts.has(domain.host), + ) + .map((domain) => domain.host); + +export const isCurrentValidation = ({ + currentScopeRequestId, + currentHostRequestId, + hostRequestId, + scopeRequestId, +}: { + currentScopeRequestId: number; + currentHostRequestId: number | undefined; + hostRequestId: number; + scopeRequestId: number; +}) => + currentScopeRequestId === scopeRequestId && + currentHostRequestId === hostRequestId; + +export const didServerIpChange = ( + previousServerIp: string | undefined, + serverIp: string | undefined, +) => previousServerIp !== serverIp; From 5c422007f6e3eeffb63dd207b547715a20bde500 Mon Sep 17 00:00:00 2001 From: Sagar Chhetri <45119768+sagarchhetribird@users.noreply.github.com> Date: Sat, 29 Aug 2026 12:53:58 +0545 Subject: [PATCH 8/8] fix: use server-scoped DNS validation --- .../dashboard/application/domains/show-domains.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx index 541ba3b7c..a3060735d 100644 --- a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx +++ b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx @@ -220,14 +220,12 @@ export const ShowDomains = ({ id, type }: Props) => { } const handleValidateDomain = useCallback( - async (host: string, serverIpOverride?: string) => { + async (host: string) => { const serviceRequestId = validationRequestIdRef.current; const hostRequestId = (hostValidationRequestIdsRef.current.get(host) ?? 0) + 1; hostValidationRequestIdsRef.current.set(host, hostRequestId); - const serverIp = serverIpOverride ?? resolveServerIp() ?? ""; - const isCurrentRequest = () => isCurrentValidation({ currentScopeRequestId: validationRequestIdRef.current, @@ -248,7 +246,7 @@ export const ShowDomains = ({ id, type }: Props) => { try { const result = await validateDomain({ domain: host, - serverIp, + serverId: application?.serverId ?? undefined, }); if (!isCurrentRequest()) { @@ -282,7 +280,7 @@ export const ShowDomains = ({ id, type }: Props) => { })); } }, - [validateDomain, resolveServerIp], + [validateDomain, application?.serverId], ); useEffect(() => { @@ -341,7 +339,7 @@ export const ShowDomains = ({ id, type }: Props) => { if (!host) { continue; } - await handleValidateDomain(host, serverIp); + await handleValidateDomain(host); } };