mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-30 20:52:40 +00:00
Force tcp and udp ports when http mode
This commit is contained in:
@@ -215,9 +215,17 @@ export async function updateClientResources(
|
|||||||
enabled: true, // hardcoded for now
|
enabled: true, // hardcoded for now
|
||||||
// enabled: resourceData.enabled ?? true,
|
// enabled: resourceData.enabled ?? true,
|
||||||
alias: resourceData.alias || null,
|
alias: resourceData.alias || null,
|
||||||
disableIcmp: resourceData["disable-icmp"],
|
disableIcmp:
|
||||||
tcpPortRangeString: resourceData["tcp-ports"],
|
resourceData["disable-icmp"] ||
|
||||||
udpPortRangeString: resourceData["udp-ports"],
|
(resourceData.mode == "http" ? true : false), // default to true for http resources, otherwise false
|
||||||
|
tcpPortRangeString:
|
||||||
|
resourceData.mode == "http"
|
||||||
|
? "443,80"
|
||||||
|
: resourceData["tcp-ports"],
|
||||||
|
udpPortRangeString:
|
||||||
|
resourceData.mode == "http"
|
||||||
|
? ""
|
||||||
|
: resourceData["udp-ports"],
|
||||||
fullDomain: resourceData["full-domain"] || null,
|
fullDomain: resourceData["full-domain"] || null,
|
||||||
subdomain: domainInfo ? domainInfo.subdomain : null,
|
subdomain: domainInfo ? domainInfo.subdomain : null,
|
||||||
domainId: domainInfo ? domainInfo.domainId : null
|
domainId: domainInfo ? domainInfo.domainId : null
|
||||||
@@ -397,9 +405,17 @@ export async function updateClientResources(
|
|||||||
// enabled: resourceData.enabled ?? true,
|
// enabled: resourceData.enabled ?? true,
|
||||||
alias: resourceData.alias || null,
|
alias: resourceData.alias || null,
|
||||||
aliasAddress: aliasAddress,
|
aliasAddress: aliasAddress,
|
||||||
disableIcmp: resourceData["disable-icmp"],
|
disableIcmp:
|
||||||
tcpPortRangeString: resourceData["tcp-ports"],
|
resourceData["disable-icmp"] ||
|
||||||
udpPortRangeString: resourceData["udp-ports"],
|
(resourceData.mode == "http" ? true : false), // default to true for http resources, otherwise false
|
||||||
|
tcpPortRangeString:
|
||||||
|
resourceData.mode == "http"
|
||||||
|
? "443,80"
|
||||||
|
: resourceData["tcp-ports"],
|
||||||
|
udpPortRangeString:
|
||||||
|
resourceData.mode == "http"
|
||||||
|
? ""
|
||||||
|
: resourceData["udp-ports"],
|
||||||
fullDomain: resourceData["full-domain"] || null,
|
fullDomain: resourceData["full-domain"] || null,
|
||||||
subdomain: domainInfo ? domainInfo.subdomain : null,
|
subdomain: domainInfo ? domainInfo.subdomain : null,
|
||||||
domainId: domainInfo ? domainInfo.domainId : null
|
domainId: domainInfo ? domainInfo.domainId : null
|
||||||
|
|||||||
@@ -389,9 +389,10 @@ export async function createSiteResource(
|
|||||||
enabled,
|
enabled,
|
||||||
alias: alias ? alias.trim() : null,
|
alias: alias ? alias.trim() : null,
|
||||||
aliasAddress,
|
aliasAddress,
|
||||||
tcpPortRangeString,
|
tcpPortRangeString:
|
||||||
udpPortRangeString,
|
mode == "http" ? "443,80" : tcpPortRangeString,
|
||||||
disableIcmp,
|
udpPortRangeString: mode == "http" ? "" : udpPortRangeString,
|
||||||
|
disableIcmp: disableIcmp || (mode == "http" ? true : false), // default to true for http resources, otherwise false
|
||||||
domainId,
|
domainId,
|
||||||
subdomain: finalSubdomain,
|
subdomain: finalSubdomain,
|
||||||
fullDomain
|
fullDomain
|
||||||
@@ -496,7 +497,13 @@ export async function createSiteResource(
|
|||||||
`Created site resource ${newSiteResource.siteResourceId} for org ${orgId}`
|
`Created site resource ${newSiteResource.siteResourceId} for org ${orgId}`
|
||||||
);
|
);
|
||||||
|
|
||||||
if (ssl && mode === "http" && domainId && fullDomain && build != "oss") {
|
if (
|
||||||
|
ssl &&
|
||||||
|
mode === "http" &&
|
||||||
|
domainId &&
|
||||||
|
fullDomain &&
|
||||||
|
build != "oss"
|
||||||
|
) {
|
||||||
await createCertificate(domainId, fullDomain, db);
|
await createCertificate(domainId, fullDomain, db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -440,9 +440,12 @@ export async function updateSiteResource(
|
|||||||
destinationPort,
|
destinationPort,
|
||||||
enabled,
|
enabled,
|
||||||
alias: alias ? alias.trim() : null,
|
alias: alias ? alias.trim() : null,
|
||||||
tcpPortRangeString,
|
tcpPortRangeString:
|
||||||
udpPortRangeString,
|
mode == "http" ? "443,80" : tcpPortRangeString,
|
||||||
disableIcmp,
|
udpPortRangeString:
|
||||||
|
mode == "http" ? "" : udpPortRangeString,
|
||||||
|
disableIcmp:
|
||||||
|
disableIcmp || (mode == "http" ? true : false), // default to true for http resources, otherwise false
|
||||||
domainId,
|
domainId,
|
||||||
subdomain: finalSubdomain,
|
subdomain: finalSubdomain,
|
||||||
fullDomain,
|
fullDomain,
|
||||||
|
|||||||
Reference in New Issue
Block a user