链接迁移: fork 脚本复活指 Gitea、上游三件套中和、面板自更新链改指本仓
- install-master.sh/install-agent.sh: 二进制下载源由已封账号 aaaamoooo/3x-ui-diy 改指本仓 Gitea Releases (tag 沿用 v3.7.0-agent.1); README 同步撤下'暂不可用'标注 - install.sh/update.sh: 未被 fork 部署链引用, 整文件替换为中英双语短桩 (exit 1), 防旧习惯调用时静默装成/更新成上游原版 - x-ui.sh: 保留全部管理功能, 仅中和 install/update/update_dev/update_menu/ legacy_version/update_shell 的上游下载分支与 uninstall 打印的上游命令, 一律改为提示本仓 Gitea Releases 地址后退出该分支 - panel.go: 面板自更新运行时耦合处理 — panelUpdaterURL 与版本检查 API 由 MHSanaei GitHub 改指本仓 Gitea (raw update.sh + /api/v1 releases, 响应字段 tag_name/body/target_commitish 与原解析结构一致); 下载到的将是本仓 update.sh 短桩, 面板更新会安全失败而非覆盖成原版 - deploy/cloud-init: curl 上游 install.sh 改为本仓 install-master.sh (Gitea raw); 头部注明 XUI_* 非交互旋钮与 install-result.env 凭据回显在 fork 安装脚本下无等价物
This commit is contained in:
@@ -129,14 +129,16 @@ before_show_menu() {
|
||||
}
|
||||
|
||||
install() {
|
||||
bash <(curl -Ls https://raw.githubusercontent.com/MHSanaei/3x-ui/main/install.sh)
|
||||
if [[ $? == 0 ]]; then
|
||||
if [[ $# == 0 ]]; then
|
||||
start
|
||||
else
|
||||
start 0
|
||||
fi
|
||||
# Fork build (3x-ui-agent): the upstream one-click installer is disabled —
|
||||
# it would install the stock panel over this fork.
|
||||
# 本 fork 已禁用上游一键安装(会装成原版)。请从本仓 Releases 手动下载部署:
|
||||
echo -e "${yellow}This fork does not provide the upstream one-click installer (it installs the stock panel).${plain}"
|
||||
echo -e "${yellow}Please download the binary manually from this fork's Releases:${plain}"
|
||||
echo -e "${green}https://git.881218.xyz/rogue/3x-ui-agent/releases${plain}"
|
||||
if [[ $# == 0 ]]; then
|
||||
before_show_menu
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
update() {
|
||||
@@ -148,11 +150,16 @@ update() {
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
bash <(curl -Ls https://raw.githubusercontent.com/MHSanaei/3x-ui/main/update.sh)
|
||||
if [[ $? == 0 ]]; then
|
||||
LOGI "Update is complete, Panel has automatically restarted "
|
||||
# Fork build (3x-ui-agent): the upstream updater is disabled — it would
|
||||
# overwrite this fork with the stock panel.
|
||||
# 本 fork 已禁用上游更新(会覆盖成原版)。请手动从本仓 Releases 下载新版二进制替换:
|
||||
echo -e "${yellow}This fork cannot be updated via the upstream updater (it would overwrite the fork with the stock panel).${plain}"
|
||||
echo -e "${yellow}Please download the new binary manually from this fork's Releases and replace it:${plain}"
|
||||
echo -e "${green}https://git.881218.xyz/rogue/3x-ui-agent/releases${plain}"
|
||||
if [[ $# == 0 ]]; then
|
||||
before_show_menu
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
update_dev() {
|
||||
@@ -164,13 +171,16 @@ update_dev() {
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
# XUI_UPDATE_TAG tells update.sh to install the dev-latest pre-release
|
||||
# instead of the latest stable tag.
|
||||
XUI_UPDATE_TAG="dev-latest" bash <(curl -Ls https://raw.githubusercontent.com/MHSanaei/3x-ui/main/update.sh)
|
||||
if [[ $? == 0 ]]; then
|
||||
LOGI "Dev update is complete, Panel has automatically restarted "
|
||||
# Fork build (3x-ui-agent): there is no upstream dev channel for this
|
||||
# fork, and the upstream updater would overwrite it with the stock panel.
|
||||
# 本 fork 无上游 dev 更新通道。请手动从本仓 Releases 下载新版二进制替换:
|
||||
echo -e "${yellow}This fork has no upstream dev-channel update (the upstream updater would overwrite the fork).${plain}"
|
||||
echo -e "${yellow}Please download the new binary manually from this fork's Releases and replace it:${plain}"
|
||||
echo -e "${green}https://git.881218.xyz/rogue/3x-ui-agent/releases${plain}"
|
||||
if [[ $# == 0 ]]; then
|
||||
before_show_menu
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
replace_xui_script() {
|
||||
@@ -219,29 +229,28 @@ update_menu() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
if replace_xui_script "https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.sh" "false"; then
|
||||
chmod +x ${xui_folder}/x-ui.sh
|
||||
echo -e "${green}Update successful. The panel has automatically restarted.${plain}"
|
||||
exit 0
|
||||
else
|
||||
echo -e "${red}Failed to update the menu.${plain}"
|
||||
return 1
|
||||
# Fork build (3x-ui-agent): the menu script is maintained in this fork's
|
||||
# own repository; replacing it from upstream is disabled.
|
||||
# 本 fork 的菜单脚本随本仓维护,已禁用从上游自替换:
|
||||
echo -e "${yellow}This fork's menu script is maintained in its own repository; upstream self-update is disabled.${plain}"
|
||||
echo -e "${green}https://git.881218.xyz/rogue/3x-ui-agent${plain}"
|
||||
if [[ $# == 0 ]]; then
|
||||
before_show_menu
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
legacy_version() {
|
||||
echo -n "Enter the panel version (like 2.4.0):"
|
||||
read -r tag_version
|
||||
|
||||
if [ -z "$tag_version" ]; then
|
||||
echo "Panel version cannot be empty. Exiting."
|
||||
exit 1
|
||||
# Fork build (3x-ui-agent): installing upstream legacy versions is
|
||||
# disabled — it would replace this fork with the stock panel.
|
||||
# 本 fork 已禁用安装上游旧版本(会装成原版)。本 fork 的可用构建见 Releases:
|
||||
echo -e "${yellow}Installing upstream legacy versions is disabled in this fork.${plain}"
|
||||
echo -e "${yellow}For available builds of this fork, see its Releases:${plain}"
|
||||
echo -e "${green}https://git.881218.xyz/rogue/3x-ui-agent/releases${plain}"
|
||||
if [[ $# == 0 ]]; then
|
||||
before_show_menu
|
||||
fi
|
||||
# Use the entered panel version in the download link
|
||||
install_command="bash <(curl -Ls "https://raw.githubusercontent.com/mhsanaei/3x-ui/v$tag_version/install.sh") v$tag_version"
|
||||
|
||||
echo "Downloading and installing panel version $tag_version..."
|
||||
eval $install_command
|
||||
return 1
|
||||
}
|
||||
|
||||
# Function to handle the deletion of the script file
|
||||
@@ -302,8 +311,8 @@ uninstall() {
|
||||
|
||||
echo ""
|
||||
echo -e "Uninstalled Successfully.\n"
|
||||
echo "If you need to install this panel again, you can use below command:"
|
||||
echo -e "${green}bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)${plain}"
|
||||
echo "If you need to install this fork again, download the binary manually from its Releases page:"
|
||||
echo -e "${green}https://git.881218.xyz/rogue/3x-ui-agent/releases${plain}"
|
||||
echo ""
|
||||
# Trap the SIGTERM signal
|
||||
trap delete_script SIGTERM
|
||||
@@ -836,14 +845,12 @@ enable_bbr() {
|
||||
}
|
||||
|
||||
update_shell() {
|
||||
if replace_xui_script "https://github.com/MHSanaei/3x-ui/raw/main/x-ui.sh" "true"; then
|
||||
LOGI "Upgrade script succeeded, Please rerun the script"
|
||||
before_show_menu
|
||||
else
|
||||
echo ""
|
||||
LOGE "Failed to download script, Please check whether the machine can connect Github"
|
||||
before_show_menu
|
||||
fi
|
||||
# Fork build (3x-ui-agent): upstream self-update of this script is
|
||||
# disabled; the script is maintained in this fork's own repository.
|
||||
# 本 fork 已禁用脚本自更新(下载源为上游)。脚本随本仓维护:
|
||||
echo -e "${yellow}Self-update is disabled in this fork; the script is maintained in its own repository:${plain}"
|
||||
echo -e "${green}https://git.881218.xyz/rogue/3x-ui-agent${plain}"
|
||||
before_show_menu
|
||||
}
|
||||
|
||||
xui_pid() {
|
||||
|
||||
Reference in New Issue
Block a user