refactor: remove VLESS/Xray, Hy2-only stack
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+3
-21
@@ -37,15 +37,8 @@ source "$ENV_FILE"
|
||||
: "${VPS_IP:?请在 .env 中设置 VPS_IP}"
|
||||
: "${DOMAIN:?请在 .env 中设置 DOMAIN}"
|
||||
: "${ACME_EMAIL:?请在 .env 中设置 ACME_EMAIL}"
|
||||
: "${REALITY_SERVER_NAME:=www.microsoft.com}"
|
||||
: "${PANEL_USERNAME:=admin}"
|
||||
|
||||
if [[ -z "${REALITY_PRIVATE_KEY:-}" ]]; then
|
||||
log "未检测到 Reality 密钥,运行 generate-keys.sh ..."
|
||||
bash "$SCRIPT_DIR/generate-keys.sh"
|
||||
source "$ENV_FILE"
|
||||
fi
|
||||
|
||||
if [[ -z "${PANEL_PASSWORD:-}" ]]; then
|
||||
PANEL_PASSWORD="$(sing-box generate rand --base64 32 | tr -d '/+=' | head -c 20)"
|
||||
if grep -q "^PANEL_PASSWORD=" "$ENV_FILE" 2>/dev/null; then
|
||||
@@ -56,9 +49,6 @@ if [[ -z "${PANEL_PASSWORD:-}" ]]; then
|
||||
source "$ENV_FILE"
|
||||
fi
|
||||
|
||||
: "${REALITY_PRIVATE_KEY:?}"
|
||||
: "${REALITY_PUBLIC_KEY:?}"
|
||||
: "${REALITY_SHORT_ID:?}"
|
||||
: "${PANEL_PASSWORD:?}"
|
||||
|
||||
if [[ -z "${CLASH_API_SECRET:-}" ]]; then
|
||||
@@ -126,7 +116,6 @@ ufw default deny incoming
|
||||
ufw default allow outgoing
|
||||
ufw allow 22/tcp comment 'SSH'
|
||||
ufw allow 80/tcp comment 'HTTP-ACME-Panel'
|
||||
ufw allow 443/tcp comment 'Reality'
|
||||
ufw allow 8443:8499/udp comment 'Hysteria2-multi-node'
|
||||
ufw --force enable
|
||||
|
||||
@@ -187,12 +176,6 @@ log "初始化节点数据库 ..."
|
||||
log "生成 sing-box 服务端配置 (Hysteria2) ..."
|
||||
python3 "$ROOT_DIR/scripts/render-server.py"
|
||||
|
||||
log "安装 Xray (VLESS Reality 443) ..."
|
||||
bash -c "$(curl -fsSL https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install
|
||||
|
||||
log "生成 Xray 服务端配置 ..."
|
||||
python3 "$ROOT_DIR/scripts/render-xray.py"
|
||||
|
||||
log "创建 sing-box systemd 服务 ..."
|
||||
cat > /etc/systemd/system/sing-box.service <<'UNIT'
|
||||
[Unit]
|
||||
@@ -215,7 +198,7 @@ log "创建管理面板 systemd 服务 ..."
|
||||
cat > /etc/systemd/system/jiedian-panel.service <<UNIT
|
||||
[Unit]
|
||||
Description=jiedian admin panel
|
||||
After=network.target xray.service sing-box.service
|
||||
After=network.target sing-box.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
@@ -232,7 +215,7 @@ WantedBy=multi-user.target
|
||||
UNIT
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable xray sing-box jiedian-panel
|
||||
systemctl enable sing-box jiedian-panel
|
||||
|
||||
log "注册证书续期 reload 命令 ..."
|
||||
/root/.acme.sh/acme.sh --install-cert -d "$DOMAIN" \
|
||||
@@ -241,7 +224,7 @@ log "注册证书续期 reload 命令 ..."
|
||||
--reloadcmd "systemctl restart sing-box && systemctl reload nginx" \
|
||||
|| log "acme reloadcmd 注册失败,可忽略"
|
||||
|
||||
systemctl restart xray sing-box jiedian-panel
|
||||
systemctl restart sing-box jiedian-panel
|
||||
|
||||
log "部署完成!"
|
||||
echo ""
|
||||
@@ -255,6 +238,5 @@ echo ""
|
||||
echo "节点链接请在面板中添加/复制。"
|
||||
echo ""
|
||||
log "sing-box: systemctl status sing-box"
|
||||
log "Xray: systemctl status xray"
|
||||
log "面板: systemctl status jiedian-panel"
|
||||
log "卸载重装: bash scripts/uninstall.sh && bash scripts/install.sh"
|
||||
|
||||
Reference in New Issue
Block a user