整改基线:封存公网端口分离与远程后端回归候选
Security Checks / security (push) Waiting to run

This commit is contained in:
xuans committed 2026-09-18 01:05:50 +08:00
1 parent a4280e7abc
commit d193324e6d
23 files changed
+338 -43

No files matched your search

+5 -2
View File
@@ -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 })
])
]