fix: address code review feedback (glob guard, CN relay comments)

Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/ddb1f363-5bb4-457a-b769-794c1fe0489a

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-03-31 08:29:05 +00:00 committed by GitHub
parent eaa6c89864
commit 3f44e4fb44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 1 deletions

View File

@ -300,7 +300,8 @@ update() {
# 移除旧的SSL配置 (不再通过Xray回落提供HTTPS)
for conf in /etc/nginx/sites-enabled/ssl-*.conf; do
if [ -f "$conf" ] && grep -q "listen.*443\|listen.*8443" "$conf" 2>/dev/null; then
[ -e "$conf" ] || continue
if grep -q "listen.*443\|listen.*8443" "$conf" 2>/dev/null; then
echo " 移除旧SSL配置: $conf"
rm -f "$conf"
fi

View File

@ -148,6 +148,8 @@ function generateClashYaml(keys, serverHost) {
const cnRelayPort = getCnRelayPort();
// CN中转节点 (如果已配置)
// 注: CN中转是透明TCP转发(CN:2053 → SG:443)所以Reality设置仍指向SG的配置
// servername/public-key/short-id 与SG直连节点完全相同因为TLS握手实际发生在SG端
const cnProxyBlock = cnRelayHost ? `
- name: "🇨🇳 铸渊专线-CN中转"
type: vless

View File

@ -22,6 +22,8 @@
# ═══════════════════════════════════════════════
set -uo pipefail
# 注意: 不使用 set -e因为 grep/nc 等命令在无匹配时返回非零
# 关键步骤手动检查错误
# 颜色
RED='\033[0;31m'