From 8fa62a0908207033628ed184770a912385652231 Mon Sep 17 00:00:00 2001 From: Owen Date: Wed, 24 Dec 2025 10:47:01 -0500 Subject: [PATCH 1/2] Respect http status for url & maintenance mode Fixes #2164 --- .../resources/proxy/[niceId]/general/page.tsx | 17 ++++++++++++++--- src/components/ResourceInfoBox.tsx | 12 ++++++------ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/app/[orgId]/settings/resources/proxy/[niceId]/general/page.tsx b/src/app/[orgId]/settings/resources/proxy/[niceId]/general/page.tsx index 7cf9339b..d8f050d3 100644 --- a/src/app/[orgId]/settings/resources/proxy/[niceId]/general/page.tsx +++ b/src/app/[orgId]/settings/resources/proxy/[niceId]/general/page.tsx @@ -164,6 +164,10 @@ function MaintenanceSectionForm({ return isEnterpriseNotLicensed || isSaasNotSubscribed; }; + if (!resource.http) { + return null; + } + return ( @@ -437,9 +441,16 @@ export default function GeneralForm() { ); const resourceFullDomainName = useMemo(() => { - const url = new URL(resourceFullDomain); - return url.hostname; - }, [resourceFullDomain]); + if (!resource.fullDomain) { + return ""; + } + try { + const url = new URL(resourceFullDomain); + return url.hostname; + } catch { + return ""; + } + }, [resourceFullDomain, resource.fullDomain]); const [selectedDomain, setSelectedDomain] = useState<{ domainId: string; diff --git a/src/components/ResourceInfoBox.tsx b/src/components/ResourceInfoBox.tsx index 6ef7521f..187edb5b 100644 --- a/src/components/ResourceInfoBox.tsx +++ b/src/components/ResourceInfoBox.tsx @@ -32,12 +32,6 @@ export default function ResourceInfoBox({}: ResourceInfoBoxType) { - - URL - - - - {t("identifier")} @@ -46,6 +40,12 @@ export default function ResourceInfoBox({}: ResourceInfoBoxType) { {resource.http ? ( <> + + URL + + + + {t("authentication")} From 40eeb9b7cb4398bbbe057eccf2c3417e3f16babe Mon Sep 17 00:00:00 2001 From: Owen Date: Wed, 24 Dec 2025 10:49:18 -0500 Subject: [PATCH 2/2] Allow all in country in blueprints Fixes #2163 --- server/lib/blueprints/types.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/server/lib/blueprints/types.ts b/server/lib/blueprints/types.ts index cbd2553f..650d5b18 100644 --- a/server/lib/blueprints/types.ts +++ b/server/lib/blueprints/types.ts @@ -111,32 +111,30 @@ export const RuleSchema = z .refine( (rule) => { if (rule.match === "country") { - // Check if it's a valid 2-letter country code - return /^[A-Z]{2}$/.test(rule.value); + // Check if it's a valid 2-letter country code or "ALL" + return /^[A-Z]{2}$/.test(rule.value) || rule.value === "ALL"; } return true; }, { path: ["value"], message: - "Value must be a 2-letter country code when match is 'country'" + "Value must be a 2-letter country code or 'ALL' when match is 'country'" } ) .refine( (rule) => { if (rule.match === "asn") { - // Check if it's either AS format or just a number + // Check if it's either AS format or "ALL" const asNumberPattern = /^AS\d+$/i; - const isASFormat = asNumberPattern.test(rule.value); - const isNumeric = /^\d+$/.test(rule.value); - return isASFormat || isNumeric; + return asNumberPattern.test(rule.value) || rule.value === "ALL"; } return true; }, { path: ["value"], message: - "Value must be either 'AS' format or a number when match is 'asn'" + "Value must be 'AS' format or 'ALL' when match is 'asn'" } );