fix: domain validation false negative on servers with multiple IPs

Validate against the server's SSH IP plus its detected public egress
IP, instead of only the stored SSH address.

Fixes #4658
This commit is contained in:
Mauricio Siu
2026-08-28 16:43:23 -06:00
parent bfc180dfef
commit 976161647f
3 changed files with 57 additions and 10 deletions
@@ -191,8 +191,7 @@ export const ShowDomains = ({ id, type }: Props) => {
try {
const result = await validateDomain({
domain: host,
serverIp:
application?.server?.ipAddress?.toString() || ip?.toString() || "",
serverId: application?.serverId ?? undefined,
});
setValidationStates((prev) => ({
+4 -2
View File
@@ -7,6 +7,7 @@ import {
findPreviewDeploymentById,
findServerById,
generateTraefikMeDomain,
getServerIpCandidates,
getWebServerSettings,
manageDomain,
removeDomain,
@@ -248,10 +249,11 @@ export const domainRouter = createTRPCRouter({
.input(
z.object({
domain: z.string(),
serverIp: z.string().optional(),
serverId: z.string().optional(),
}),
)
.mutation(async ({ input }) => {
return validateDomain(input.domain, input.serverIp);
const expectedIps = await getServerIpCandidates(input.serverId);
return validateDomain(input.domain, expectedIps);
}),
});