From 0ff0e83c9f486dcce0221939135be4504551b646 Mon Sep 17 00:00:00 2001 From: Owen Date: Wed, 27 May 2026 17:19:04 -0700 Subject: [PATCH] Complete removal of http and protocol from public --- server/lib/blueprints/applyBlueprint.ts | 2 +- server/lib/blueprints/proxyResources.ts | 47 +++++++++---- server/lib/blueprints/types.ts | 68 ++++++++++++------- server/lib/telemetry.ts | 14 ++-- server/lib/traefik/getTraefikConfig.ts | 12 ++-- .../private/lib/traefik/getTraefikConfig.ts | 2 +- server/routers/newt/buildConfiguration.ts | 11 +-- server/routers/resource/createResourceRule.ts | 2 +- server/routers/resource/deleteResource.ts | 2 +- server/routers/resource/getUserResources.ts | 10 ++- server/routers/resource/updateResource.ts | 2 +- server/routers/resource/updateResourceRule.ts | 6 +- server/routers/target/createTarget.ts | 2 +- server/routers/target/deleteTarget.ts | 2 +- server/routers/target/updateTarget.ts | 2 +- .../resources/proxy/[niceId]/general/page.tsx | 18 +++-- .../resources/proxy/[niceId]/http/page.tsx | 6 +- .../resources/proxy/[niceId]/layout.tsx | 2 +- .../resources/proxy/[niceId]/rules/page.tsx | 21 +++--- .../[orgId]/settings/resources/proxy/page.tsx | 6 +- src/components/MemberResourcesPortal.tsx | 22 +----- src/components/ProxyResourcesTable.tsx | 23 ++++--- src/components/ResourceInfoBox.tsx | 10 +-- src/components/SiteResourcesOverview.tsx | 8 +-- 24 files changed, 169 insertions(+), 131 deletions(-) diff --git a/server/lib/blueprints/applyBlueprint.ts b/server/lib/blueprints/applyBlueprint.ts index 8ca66971a..c4471c7ce 100644 --- a/server/lib/blueprints/applyBlueprint.ts +++ b/server/lib/blueprints/applyBlueprint.ts @@ -106,7 +106,7 @@ export async function applyBlueprint({ site.newt.newtId, [target], matchingHealthcheck ? [matchingHealthcheck] : [], - result.proxyResource.protocol, + result.proxyResource.mode === "udp" ? "udp" : "tcp", site.newt.version ); } diff --git a/server/lib/blueprints/proxyResources.ts b/server/lib/blueprints/proxyResources.ts index 178991962..897a7a77b 100644 --- a/server/lib/blueprints/proxyResources.ts +++ b/server/lib/blueprints/proxyResources.ts @@ -36,6 +36,7 @@ import { isValidRegionId } from "@server/db/regions"; import { isLicensedOrSubscribed } from "#dynamic/lib/isLicencedOrSubscribed"; import { fireHealthCheckUnknownAlert } from "@server/lib/alerts"; import { tierMatrix } from "../billing/tierMatrix"; +import { http } from "winston"; export type ProxyResourcesResults = { proxyResource: Resource; @@ -198,9 +199,6 @@ export async function updateProxyResources( ) .limit(1); - const http = resourceData.protocol == "http"; - const protocol = - resourceData.protocol == "http" ? "tcp" : resourceData.protocol; const resourceEnabled = resourceData.enabled == undefined || resourceData.enabled == null ? true @@ -216,7 +214,9 @@ export async function updateProxyResources( if (existingResource) { let domain; - if (http) { + if ( + ["http", "ssh", "rdp", "vnc"].includes(resourceData.mode || "") + ) { domain = await getDomain( existingResource.resourceId, resourceData["full-domain"]!, @@ -246,10 +246,17 @@ export async function updateProxyResources( .update(resources) .set({ name: resourceData.name || "Unnamed Resource", - protocol: protocol || "tcp", - http: http, - proxyPort: http ? null : resourceData["proxy-port"], - fullDomain: http ? resourceData["full-domain"] : null, + mode: resourceData.mode, + proxyPort: ["http", "ssh", "rdp", "vnc"].includes( + resourceData.mode || "" + ) + ? null + : resourceData["proxy-port"], + fullDomain: ["http", "ssh", "rdp", "vnc"].includes( + resourceData.mode || "" + ) + ? resourceData["full-domain"] + : null, subdomain: domain ? domain.subdomain : null, domainId: domain ? domain.domainId : null, wildcard: domain ? domain.wildcard : false, @@ -466,7 +473,10 @@ export async function updateProxyResources( .set({ siteId: site.siteId, ip: targetData.hostname, - method: http ? targetData.method : null, + method: + resourceData.mode == "http" // the other types of ssh, rdp, and vnc use the browser gateway targets and not this one so this is okay + ? targetData.method + : null, port: targetData.port, enabled: targetData.enabled, path: targetData.path, @@ -687,7 +697,9 @@ export async function updateProxyResources( } else { // create a brand new resource let domain; - if (http) { + if ( + ["http", "ssh", "rdp", "vnc"].includes(resourceData.mode || "") + ) { domain = await getDomain( undefined, resourceData["full-domain"]!, @@ -711,10 +723,17 @@ export async function updateProxyResources( orgId, niceId: resourceNiceId, name: resourceData.name || "Unnamed Resource", - protocol: protocol || "tcp", - http: http, - proxyPort: http ? null : resourceData["proxy-port"], - fullDomain: http ? resourceData["full-domain"] : null, + mode: resourceData.mode, + proxyPort: ["http", "ssh", "rdp", "vnc"].includes( + resourceData.mode || "" + ) + ? null + : resourceData["proxy-port"], + fullDomain: ["http", "ssh", "rdp", "vnc"].includes( + resourceData.mode || "" + ) + ? resourceData["full-domain"] + : null, subdomain: domain ? domain.subdomain : null, domainId: domain ? domain.domainId : null, wildcard: domain ? domain.wildcard : false, diff --git a/server/lib/blueprints/types.ts b/server/lib/blueprints/types.ts index 13f4caa8f..1dff334b0 100644 --- a/server/lib/blueprints/types.ts +++ b/server/lib/blueprints/types.ts @@ -162,10 +162,13 @@ export const HeaderSchema = z.object({ }); // Schema for individual resource -export const ResourceSchema = z +export const PublicResourceSchema = z .object({ name: z.string().optional(), - protocol: z.enum(["http", "tcp", "udp"]).optional(), + protocol: z + .enum(["http", "tcp", "udp", "ssh", "rdp", "vnc"]) + .optional(), // this was the old one and is now DEPRECATED in favor of the mode + mode: z.enum(["http", "tcp", "udp", "ssh", "rdp", "vnc"]).optional(), ssl: z.boolean().optional(), scheme: z.enum(["http", "https"]).optional(), "full-domain": z.string().optional(), @@ -185,9 +188,10 @@ export const ResourceSchema = z return true; } - // Otherwise, require name and protocol for full resource definition + // Otherwise, require name and protocol/mode for full resource definition return ( - resource.name !== undefined && resource.protocol !== undefined + resource.name !== undefined && + (resource.mode !== undefined || resource.protocol !== undefined) ); }, { @@ -201,8 +205,8 @@ export const ResourceSchema = z return true; } - // If protocol is http, all targets must have method field - if (resource.protocol === "http") { + // If protocol/mode is http, all targets must have method field + if ((resource.mode ?? resource.protocol) === "http") { return resource.targets.every( (target) => target == null || target.method !== undefined ); @@ -220,8 +224,9 @@ export const ResourceSchema = z return true; } - // If protocol is tcp or udp, no target should have method field - if (resource.protocol === "tcp" || resource.protocol === "udp") { + // If protocol/mode is tcp or udp, no target should have method field + const effectiveProtocol1 = resource.mode ?? resource.protocol; + if (effectiveProtocol1 === "tcp" || effectiveProtocol1 === "udp") { return resource.targets.every( (target) => target == null || target.method === undefined ); @@ -239,8 +244,8 @@ export const ResourceSchema = z return true; } - // If protocol is http, it must have a full-domain - if (resource.protocol === "http") { + // If protocol/mode is http, it must have a full-domain + if ((resource.mode ?? resource.protocol) === "http") { return ( resource["full-domain"] !== undefined && resource["full-domain"].length > 0 @@ -259,8 +264,9 @@ export const ResourceSchema = z return true; } - // If protocol is tcp or udp, it must have both proxy-port - if (resource.protocol === "tcp" || resource.protocol === "udp") { + // If protocol/mode is tcp or udp, it must have both proxy-port + const effectiveProtocol2 = resource.mode ?? resource.protocol; + if (effectiveProtocol2 === "tcp" || effectiveProtocol2 === "udp") { return resource["proxy-port"] !== undefined; } return true; @@ -277,8 +283,9 @@ export const ResourceSchema = z return true; } - // If protocol is tcp or udp, it must not have auth - if (resource.protocol === "tcp" || resource.protocol === "udp") { + // If protocol/mode is tcp or udp, it must not have auth + const effectiveProtocol3 = resource.mode ?? resource.protocol; + if (effectiveProtocol3 === "tcp" || effectiveProtocol3 === "udp") { return resource.auth === undefined; } return true; @@ -340,7 +347,8 @@ export const ResourceSchema = z if (parts.includes("*", 1)) return false; // no further wildcards if (parts.length < 3) return false; // need at least *.label.tld - const labelRegex = /^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$|^[a-zA-Z0-9]$/; + const labelRegex = + /^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$|^[a-zA-Z0-9]$/; return parts.slice(1).every((label) => labelRegex.test(label)); }, { @@ -348,16 +356,23 @@ export const ResourceSchema = z message: 'Wildcard full-domain must have "*" as the leftmost label only, followed by at least two valid hostname labels (e.g. "*.example.com" or "*.level1.example.com"). Patterns like "*example.com" or "level2.*.example.com" are not supported.' } - ); + ) + .transform((resource) => { + // Normalize: prefer mode, fall back to protocol for backwards compatibility + if (resource.mode === undefined && resource.protocol !== undefined) { + resource.mode = resource.protocol; + } + return resource; + }); export function isTargetsOnlyResource(resource: any): boolean { return Object.keys(resource).length === 1 && resource.targets; } -export const ClientResourceSchema = z +export const PrivateResourceSchema = z .object({ name: z.string().min(1).max(255), - mode: z.enum(["host", "cidr", "http"]), + mode: z.enum(["host", "cidr", "http", "ssh"]), site: z.string().optional(), // DEPRECATED IN FAVOR OF sites sites: z.array(z.string()).optional().default([]), // protocol: z.enum(["tcp", "udp"]).optional(), @@ -435,19 +450,19 @@ export const ClientResourceSchema = z export const ConfigSchema = z .object({ "proxy-resources": z - .record(z.string(), ResourceSchema) + .record(z.string(), PublicResourceSchema) .optional() .prefault({}), "public-resources": z - .record(z.string(), ResourceSchema) + .record(z.string(), PublicResourceSchema) .optional() .prefault({}), "client-resources": z - .record(z.string(), ClientResourceSchema) + .record(z.string(), PrivateResourceSchema) .optional() .prefault({}), "private-resources": z - .record(z.string(), ClientResourceSchema) + .record(z.string(), PrivateResourceSchema) .optional() .prefault({}), sites: z.record(z.string(), SiteSchema).optional().prefault({}) @@ -472,10 +487,13 @@ export const ConfigSchema = z } return data as { - "proxy-resources": Record>; + "proxy-resources": Record< + string, + z.infer + >; "client-resources": Record< string, - z.infer + z.infer >; sites: Record>; }; @@ -614,5 +632,5 @@ export const ConfigSchema = z // Type inference from the schema export type Site = z.infer; export type Target = z.infer; -export type Resource = z.infer; +export type Resource = z.infer; export type Config = z.infer; diff --git a/server/lib/telemetry.ts b/server/lib/telemetry.ts index 55c01c6b1..77f7740c5 100644 --- a/server/lib/telemetry.ts +++ b/server/lib/telemetry.ts @@ -2,7 +2,14 @@ import { PostHog } from "posthog-node"; import config from "./config"; import { getHostMeta } from "./hostMeta"; import logger from "@server/logger"; -import { alertRules, apiKeys, blueprints, db, roles, siteResources } from "@server/db"; +import { + alertRules, + apiKeys, + blueprints, + db, + roles, + siteResources +} from "@server/db"; import { sites, users, orgs, resources, clients, idp } from "@server/db"; import { eq, count, notInArray, and, isNotNull, isNull } from "drizzle-orm"; import { APP_VERSION } from "./consts"; @@ -143,8 +150,7 @@ class TelemetryClient { .select({ name: resources.name, sso: resources.sso, - protocol: resources.protocol, - http: resources.http + mode: resources.mode }) .from(resources); @@ -311,7 +317,7 @@ class TelemetryClient { (r) => r.sso ).length, num_resources_non_http: stats.resources.filter( - (r) => !r.http + (r) => r.mode !== "http" ).length, num_newt_sites: stats.sites.filter((s) => s.type === "newt") .length, diff --git a/server/lib/traefik/getTraefikConfig.ts b/server/lib/traefik/getTraefikConfig.ts index 7379cad7f..518dd964c 100644 --- a/server/lib/traefik/getTraefikConfig.ts +++ b/server/lib/traefik/getTraefikConfig.ts @@ -55,9 +55,7 @@ export async function getTraefikConfig( resourceName: resources.name, fullDomain: resources.fullDomain, ssl: resources.ssl, - http: resources.http, proxyPort: resources.proxyPort, - protocol: resources.protocol, subdomain: resources.subdomain, domainId: resources.domainId, enabled: resources.enabled, @@ -68,6 +66,7 @@ export async function getTraefikConfig( headers: resources.headers, proxyProtocol: resources.proxyProtocol, proxyProtocolVersion: resources.proxyProtocolVersion, + mode: resources.mode, // Target fields targetId: targets.targetId, @@ -115,8 +114,8 @@ export async function getTraefikConfig( ), inArray(sites.type, siteTypes), allowRawResources - ? isNotNull(resources.http) // ignore the http check if allow_raw_resources is true - : eq(resources.http, true) + ? inArray(resources.mode, ["http", "udp", "tcp"]) // allow all three + : eq(resources.mode, "http") ) ) .orderBy(desc(targets.priority), targets.targetId); // stable ordering @@ -166,9 +165,8 @@ export async function getTraefikConfig( key: key, fullDomain: row.fullDomain, ssl: row.ssl, - http: row.http, + mode: row.mode, proxyPort: row.proxyPort, - protocol: row.protocol, subdomain: row.subdomain, domainId: row.domainId, enabled: row.enabled, @@ -580,7 +578,7 @@ export async function getTraefikConfig( continue; } - const protocol = resource.protocol.toLowerCase(); + const protocol = resource.mode === "udp" ? "udp" : "tcp"; // all of the other ones are tcp const port = resource.proxyPort; if (!port) { diff --git a/server/private/lib/traefik/getTraefikConfig.ts b/server/private/lib/traefik/getTraefikConfig.ts index c2e18e4b2..f2227a7bc 100644 --- a/server/private/lib/traefik/getTraefikConfig.ts +++ b/server/private/lib/traefik/getTraefikConfig.ts @@ -944,7 +944,7 @@ export async function getTraefikConfig( continue; } - const protocol = resource.protocol.toLowerCase(); + const protocol = resource.mode == "udp" ? "udp" : "tcp"; const port = resource.proxyPort; if (!port) { diff --git a/server/routers/newt/buildConfiguration.ts b/server/routers/newt/buildConfiguration.ts index cc2bd782b..135920d6f 100644 --- a/server/routers/newt/buildConfiguration.ts +++ b/server/routers/newt/buildConfiguration.ts @@ -197,7 +197,7 @@ export async function buildTargetConfigurationForNewtClient( siteId: number, version?: string | null ) { - // Get all enabled targets with their resource protocol information + // Get all enabled targets with their resource mode information const allTargets = await db .select({ resourceId: targets.resourceId, @@ -207,7 +207,7 @@ export async function buildTargetConfigurationForNewtClient( port: targets.port, internalPort: targets.internalPort, enabled: targets.enabled, - protocol: resources.protocol + mode: resources.mode }) .from(targets) .innerJoin(resources, eq(targets.resourceId, resources.resourceId)) @@ -252,10 +252,11 @@ export async function buildTargetConfigurationForNewtClient( const formattedTarget = `${target.internalPort}:${formatEndpoint(target.ip, target.port)}`; // Add to the appropriate protocol array - if (target.protocol === "tcp") { - acc.tcpTargets.push(formattedTarget); - } else { + if (target.mode === "udp") { acc.udpTargets.push(formattedTarget); + } else { + // all other modes are tcp + acc.tcpTargets.push(formattedTarget); } return acc; diff --git a/server/routers/resource/createResourceRule.ts b/server/routers/resource/createResourceRule.ts index 200ee07d4..a9870c0e6 100644 --- a/server/routers/resource/createResourceRule.ts +++ b/server/routers/resource/createResourceRule.ts @@ -94,7 +94,7 @@ export async function createResourceRule( ); } - if (!resource.http) { + if (!["http", "ssh", "rdp", "vnc"].includes(resource.mode)) { return next( createHttpError( HttpCode.BAD_REQUEST, diff --git a/server/routers/resource/deleteResource.ts b/server/routers/resource/deleteResource.ts index 682fd6aa9..ca644d299 100644 --- a/server/routers/resource/deleteResource.ts +++ b/server/routers/resource/deleteResource.ts @@ -106,7 +106,7 @@ export async function deleteResource( // [target], [], // deleting the target from newt causes issues because we cant unbind the port. this needs to be fixed in newt before we can do this healthChecksToBeRemoved, - deletedResource.protocol, + deletedResource.mode === "udp" ? "udp" : "tcp", newt.version ); } diff --git a/server/routers/resource/getUserResources.ts b/server/routers/resource/getUserResources.ts index 48df9735e..c2df90833 100644 --- a/server/routers/resource/getUserResources.ts +++ b/server/routers/resource/getUserResources.ts @@ -120,7 +120,7 @@ export async function getUserResources( ssl: boolean; enabled: boolean; sso: boolean; - protocol: string; + mode: string; emailWhitelistEnabled: boolean; }> = []; if (accessibleResourceIds.length > 0) { @@ -132,7 +132,7 @@ export async function getUserResources( ssl: resources.ssl, enabled: resources.enabled, sso: resources.sso, - protocol: resources.protocol, + mode: resources.mode, emailWhitelistEnabled: resources.emailWhitelistEnabled }) .from(resources) @@ -316,7 +316,7 @@ export async function getUserResources( hasPincode || hasWhitelist ), - protocol: resource.protocol, + mode: resource.mode, sso: resource.sso, password: hasPassword, pincode: hasPincode, @@ -332,7 +332,6 @@ export async function getUserResources( name: siteResource.name, destination: siteResource.destination, mode: siteResource.mode, - protocol: siteResource.scheme, ssl: siteResource.ssl, fullDomain: siteResource.fullDomain, enabled: siteResource.enabled, @@ -380,14 +379,13 @@ export type GetUserResourcesResponse = { domain: string; enabled: boolean; protected: boolean; - protocol: string; + mode: string; }>; siteResources: Array<{ siteResourceId: number; name: string; destination: string; mode: string; - protocol: string | null; tcpPortRangeString: string | null; udpPortRangeString: string | null; disableIcmp: boolean | null; diff --git a/server/routers/resource/updateResource.ts b/server/routers/resource/updateResource.ts index bd6a9424c..17984eb2b 100644 --- a/server/routers/resource/updateResource.ts +++ b/server/routers/resource/updateResource.ts @@ -247,7 +247,7 @@ export async function updateResource( ); } - if (resource.http) { + if (["http", "ssh", "rdp", "vnc"].includes(resource.mode)) { // HANDLE UPDATING HTTP RESOURCES return await updateHttpResource( { diff --git a/server/routers/resource/updateResourceRule.ts b/server/routers/resource/updateResourceRule.ts index 4074fd93a..8242f2ade 100644 --- a/server/routers/resource/updateResourceRule.ts +++ b/server/routers/resource/updateResourceRule.ts @@ -26,7 +26,9 @@ const updateResourceRuleParamsSchema = z.strictObject({ const updateResourceRuleSchema = z .strictObject({ action: z.enum(["ACCEPT", "DROP", "PASS"]).optional(), - match: z.enum(["CIDR", "IP", "PATH", "COUNTRY", "ASN", "REGION"]).optional(), + match: z + .enum(["CIDR", "IP", "PATH", "COUNTRY", "ASN", "REGION"]) + .optional(), value: z.string().min(1).optional(), priority: z.int(), enabled: z.boolean().optional() @@ -102,7 +104,7 @@ export async function updateResourceRule( ); } - if (!resource.http) { + if (!["http", "ssh", "rdp", "vnc"].includes(resource.mode)) { return next( createHttpError( HttpCode.BAD_REQUEST, diff --git a/server/routers/target/createTarget.ts b/server/routers/target/createTarget.ts index c629e378e..f6e2d72ef 100644 --- a/server/routers/target/createTarget.ts +++ b/server/routers/target/createTarget.ts @@ -314,7 +314,7 @@ export async function createTarget( newt.newtId, newTarget, healthCheck, - resource.protocol, + resource.mode === "udp" ? "udp" : "tcp", newt.version ); } diff --git a/server/routers/target/deleteTarget.ts b/server/routers/target/deleteTarget.ts index 685c41e7e..5a4b028b3 100644 --- a/server/routers/target/deleteTarget.ts +++ b/server/routers/target/deleteTarget.ts @@ -126,7 +126,7 @@ export async function deleteTarget( // [deletedTarget], [], // deleting the target from newt causes issues because we cant unbind the port. this needs to be fixed in newt before we can do this [deletedHealthCheck], - resource.protocol, + resource.mode === "udp" ? "udp" : "tcp", newt.version ); } diff --git a/server/routers/target/updateTarget.ts b/server/routers/target/updateTarget.ts index 4533dc2e5..f3bdb1a9d 100644 --- a/server/routers/target/updateTarget.ts +++ b/server/routers/target/updateTarget.ts @@ -332,7 +332,7 @@ export async function updateTarget( newt.newtId, [updatedTarget], [updatedHc], - resource.protocol, + resource.mode === "udp" ? "udp" : "tcp", newt.version ); } 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 704f6a352..848f8c29d 100644 --- a/src/app/[orgId]/settings/resources/proxy/[niceId]/general/page.tsx +++ b/src/app/[orgId]/settings/resources/proxy/[niceId]/general/page.tsx @@ -146,7 +146,7 @@ function MaintenanceSectionForm({ } } - if (!resource.http) { + if (!["http", "ssh", "rdp", "vnc"].includes(resource.mode)) { return null; } @@ -176,7 +176,9 @@ function MaintenanceSectionForm({ render={({ field }) => { const isDisabled = !isPaidUser(tierMatrix.maintencePage) || - resource.http === false; + !["http", "ssh", "rdp", "vnc"].includes( + resource.mode + ); return ( @@ -462,14 +464,14 @@ export default function GeneralForm() { .refine( (data) => { // For non-HTTP resources, proxyPort should be defined - if (!resource.http) { + if (!["http", "ssh", "rdp", "vnc"].includes(resource.mode)) { return data.proxyPort !== undefined; } // For HTTP resources, proxyPort should be undefined return data.proxyPort === undefined; }, { - message: !resource.http + message: !["http", "ssh", "rdp", "vnc"].includes(resource.mode) ? "Port number is required for non-HTTP resources" : "Port number should not be set for HTTP resources", path: ["proxyPort"] @@ -623,7 +625,9 @@ export default function GeneralForm() { /> - {!resource.http && ( + {!["http", "ssh", "rdp", "vnc"].includes( + resource.mode + ) && ( <> )} - {resource.http && ( + {["http", "ssh", "rdp", "vnc"].includes( + resource.mode + ) && (
- {resource.http && ( + {["http", "ssh", "rdp", "vnc"].includes(resource.mode) && ( )} - {!resource.http && resource.protocol == "tcp" && ( + {resource.mode == "tcp" && ( - {resource.http && resource.mode == "http" && ( + {resource.mode == "http" && ( {RuleMatch.PATH} @@ -1037,15 +1037,14 @@ export default function ResourceRules(props: { - {resource.http && - resource.mode == - "http" && ( - - { - RuleMatch.PATH - } - - )} + {resource.mode == + "http" && ( + + { + RuleMatch.PATH + } + + )} {RuleMatch.IP} diff --git a/src/app/[orgId]/settings/resources/proxy/page.tsx b/src/app/[orgId]/settings/resources/proxy/page.tsx index 24b191164..44430e226 100644 --- a/src/app/[orgId]/settings/resources/proxy/page.tsx +++ b/src/app/[orgId]/settings/resources/proxy/page.tsx @@ -108,11 +108,11 @@ export default async function ProxyResourcesPage( orgId: params.orgId, nice: resource.niceId, domain: `${resource.ssl ? "https://" : "http://"}${toUnicode(resource.fullDomain || "")}`, - protocol: resource.protocol, proxyPort: resource.proxyPort, - http: resource.http, labels: resource.labels, - authState: !resource.http + authState: !["http", "ssh", "rdp", "vnc"].includes( + resource.mode || "" + ) ? "none" : resource.sso || resource.pincodeId !== null || diff --git a/src/components/MemberResourcesPortal.tsx b/src/components/MemberResourcesPortal.tsx index 87d527e11..954aab25e 100644 --- a/src/components/MemberResourcesPortal.tsx +++ b/src/components/MemberResourcesPortal.tsx @@ -49,7 +49,7 @@ type Resource = { domain: string; enabled: boolean; protected: boolean; - protocol: string; + mode: string; // "http", "tcp", "udp", "rdp", "vnc", "ssh" // Auth method fields sso?: boolean; password?: boolean; @@ -64,7 +64,6 @@ type SiteResource = { name: string; destination: string; mode: string; - protocol: string | null; ssl: boolean; fullDomain: string | null; enabled: boolean; @@ -882,21 +881,6 @@ export default function MemberResourcesPortal({ }
- {siteResource.protocol && ( -
- - {t( - "protocol" - )} - : - - - { - siteResource.protocol - } - -
- )}
{t( @@ -954,7 +938,7 @@ export default function MemberResourcesPortal({ siteResource.fullDomain ? ( /* HTTP mode - show as clickable link */ ) : siteResource.alias ? ( @@ -1037,7 +1021,7 @@ export default function MemberResourcesPortal({