整改基线:封存公网端口分离与远程后端回归候选
This commit is contained in:
1 parent
89e5d6c0c8
commit
6683f1cf9f
23 files changed
+338
-43
No files matched your search
@@ -46,7 +46,10 @@ export const buildFinalURL = (sslData, webDomain, location = currentLocation())
|
||||
const proxyMode = isProxyTLSMode(sslData)
|
||||
const configuredPort = target.port
|
||||
const targetPort = Number(sslData?.httpsPort)
|
||||
if (!proxyMode) {
|
||||
const publicPort = Number(sslData?.publicHttpsPort)
|
||||
if (Number.isInteger(publicPort) && publicPort > 0 && publicPort <= 65535) {
|
||||
target.port = publicPort === DEFAULT_HTTPS_PORT ? '' : String(publicPort)
|
||||
} else if (!proxyMode) {
|
||||
target.port = targetPort > 0 && targetPort !== DEFAULT_HTTPS_PORT ? String(targetPort) : ''
|
||||
} else if (!isNonDefaultPort(target.protocol, configuredPort)) {
|
||||
target.port = ''
|
||||
@@ -144,4 +147,4 @@ export const probeService = async (sslData, webDomain, location = currentLocatio
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,7 @@ export function getRecommendedPort(config, path) {
|
||||
case 'http.port':
|
||||
return config.http?.tlsMode === 'proxy' ? 8080 : 80
|
||||
case 'http.httpsPort':
|
||||
case 'http.publicHttpsPort':
|
||||
return 443
|
||||
case 'relay.relayPort':
|
||||
return smtpPorts.get(relaySecurityForMail(config))
|
||||
@@ -113,7 +114,8 @@ const baseGroups = [
|
||||
min: 1,
|
||||
show: config => config.http?.tlsMode !== 'proxy' && !!config.http?.httpsEnabled,
|
||||
hint: '默认使用 443;需要避开端口占用时可手动修改。'
|
||||
})
|
||||
}),
|
||||
port('http.publicHttpsPort', '公网 HTTPS 端口', { fallback: 0 })
|
||||
])
|
||||
]
|
||||
|
||||
|
||||
Reference in new issue
Block a user