diff --git a/server/proxy/config/xray-config-template.json b/server/proxy/config/xray-config-template.json index 959c40f8..4e9bdfaa 100644 --- a/server/proxy/config/xray-config-template.json +++ b/server/proxy/config/xray-config-template.json @@ -52,7 +52,6 @@ "xver": 0, "serverNames": [ "www.microsoft.com", - "www.apple.com", "www.amazon.com" ], "privateKey": "{{ZY_PROXY_REALITY_PRIVATE_KEY}}", diff --git a/server/proxy/deploy-proxy.sh b/server/proxy/deploy-proxy.sh index 458b29d9..c121140e 100644 --- a/server/proxy/deploy-proxy.sh +++ b/server/proxy/deploy-proxy.sh @@ -32,6 +32,25 @@ echo "════════════════════════ echo "🌐 铸渊专线 · 部署 · action=$ACTION" echo "════════════════════════════════════════" +# ── 共用: 确保Xray以root运行 (修复User=nobody问题) ── +ensure_xray_root_user() { + if [ ! -f /etc/systemd/system/xray.service.d/override.conf ]; then + mkdir -p /etc/systemd/system/xray.service.d + cat > /etc/systemd/system/xray.service.d/override.conf </dev/null || true health_check diff --git a/server/proxy/setup/install-xray.sh b/server/proxy/setup/install-xray.sh index 1f3a9d0a..5c8214c6 100644 --- a/server/proxy/setup/install-xray.sh +++ b/server/proxy/setup/install-xray.sh @@ -85,6 +85,19 @@ fi echo "[6/6] 创建数据目录..." mkdir -p /opt/zhuyuan/proxy/{config,data,logs} chown -R root:root /opt/zhuyuan/proxy +chmod 755 /opt/zhuyuan/proxy/logs + +# 修复: Xray官方安装脚本默认设置 User=nobody +# 导致无法写入日志目录 (permission denied) 且 systemd 警告 +# "Special user nobody configured, this is not safe!" +# 创建 systemd drop-in 覆盖,以 root 身份运行 (443端口需要root) +mkdir -p /etc/systemd/system/xray.service.d +cat > /etc/systemd/system/xray.service.d/override.conf <