From a8d18d6416fa67ce239fc8a8f317d8a14fb1d80b Mon Sep 17 00:00:00 2001 From: ruyawwj Date: Mon, 11 May 2026 05:28:05 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=B9=B6=E6=B7=BB=E5=8A=A0=E5=A4=9A=E8=AF=AD=E8=A8=80=E5=92=8C?= =?UTF-8?q?GitHub=E5=8A=A0=E9=80=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: traeagent --- install.sh | 21 ++++++++++++--------- update.sh | 11 +++++++---- x-ui.sh | 2 +- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/install.sh b/install.sh index 952aa3cf..84c070ce 100644 --- a/install.sh +++ b/install.sh @@ -14,6 +14,9 @@ xui_service="${XUI_SERVICE:=/etc/systemd/system}" GITHUB_MIRROR_DEFAULT="https://gh.kejilion.pro" GITHUB_RAW_DEFAULT="https://raw.githubusercontent.com" +REPO_OWNER="ruyawwj" +REPO_NAME="3x-ui" + check root [[ $EUID -ne 0 ]] && echo -e "${red}Fatal error: ${plain} Please run this script with root privilege \n " && exit 1 @@ -799,17 +802,17 @@ install_x-ui() { local github_raw=$(get_github_raw) if [ $# == 0 ]; then - tag_version=$(curl -Ls "https://api.github.com/repos/mhsanaei/3x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') + tag_version=$(curl -Ls "https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') if [[ ! -n "$tag_version" ]]; then echo -e "${yellow}Trying to fetch version with IPv4...${plain}" - tag_version=$(curl -4 -Ls "https://api.github.com/repos/mhsanaei/3x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') + tag_version=$(curl -4 -Ls "https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') if [[ ! -n "$tag_version" ]]; then echo -e "${red}Failed to fetch x-ui version, it may be due to GitHub API restrictions, please try it later${plain}" exit 1 fi fi echo -e "Got x-ui latest version: ${tag_version}, beginning the installation..." - curl -4fLRo ${xui_folder}-linux-$(arch).tar.gz https://github.com/mhsanaei/3x-ui/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz + curl -4fLRo ${xui_folder}-linux-$(arch).tar.gz https://github.com/${REPO_OWNER}/${REPO_NAME}/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz if [[ $? -ne 0 ]]; then echo -e "${red}Downloading x-ui failed, please be sure that your server can access GitHub ${plain}" exit 1 @@ -824,7 +827,7 @@ install_x-ui() { exit 1 fi - url="https://github.com/mhsanaei/3x-ui/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz" + url="https://github.com/${REPO_OWNER}/${REPO_NAME}/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz" echo -e "Beginning to install x-ui $1" curl -4fLRo ${xui_folder}-linux-$(arch).tar.gz ${url} if [[ $? -ne 0 ]]; then @@ -832,7 +835,7 @@ install_x-ui() { exit 1 fi fi - curl -4fLRo /usr/bin/x-ui-temp ${github_raw}/mhsanaei/3x-ui/main/x-ui.sh + curl -4fLRo /usr/bin/x-ui-temp ${github_raw}/${REPO_OWNER}/${REPO_NAME}/main/x-ui.sh if [[ $? -ne 0 ]]; then echo -e "${red}Failed to download x-ui.sh${plain}" exit 1 @@ -879,7 +882,7 @@ install_x-ui() { fi if [[ $release == "alpine" ]]; then - curl -4fLRo /etc/init.d/x-ui ${github_raw}/mhsanaei/3x-ui/main/x-ui.rc + curl -4fLRo /etc/init.d/x-ui ${github_raw}/${REPO_OWNER}/${REPO_NAME}/main/x-ui.rc if [[ $? -ne 0 ]]; then echo -e "${red}Failed to download x-ui.rc${plain}" exit 1 @@ -934,13 +937,13 @@ install_x-ui() { echo -e "${yellow}Service files not found in tar.gz, downloading from GitHub...${plain}" case "${release}" in ubuntu | debian | armbian) - curl -4fLRo ${xui_service}/x-ui.service ${github_raw}/mhsanaei/3x-ui/main/x-ui.service.debian > /dev/null 2>&1 + curl -4fLRo ${xui_service}/x-ui.service ${github_raw}/${REPO_OWNER}/${REPO_NAME}/main/x-ui.service.debian > /dev/null 2>&1 ;; arch | manjaro | parch) - curl -4fLRo ${xui_service}/x-ui.service ${github_raw}/mhsanaei/3x-ui/main/x-ui.service.arch > /dev/null 2>&1 + curl -4fLRo ${xui_service}/x-ui.service ${github_raw}/${REPO_OWNER}/${REPO_NAME}/main/x-ui.service.arch > /dev/null 2>&1 ;; *) - curl -4fLRo ${xui_service}/x-ui.service ${github_raw}/mhsanaei/3x-ui/main/x-ui.service.rhel > /dev/null 2>&1 + curl -4fLRo ${xui_service}/x-ui.service ${github_raw}/${REPO_OWNER}/${REPO_NAME}/main/x-ui.service.rhel > /dev/null 2>&1 ;; esac diff --git a/update.sh b/update.sh index ac2c3ef3..b7699974 100755 --- a/update.sh +++ b/update.sh @@ -14,6 +14,9 @@ xui_service="${XUI_SERVICE:=/etc/systemd/system}" GITHUB_MIRROR_DEFAULT="https://gh.kejilion.pro" GITHUB_RAW_DEFAULT="https://raw.githubusercontent.com" +REPO_OWNER="ruyawwj" +REPO_NAME="3x-ui" + [[ $EUID -ne 0 ]] && echo -e "${red}Fatal error: ${plain} Please run this script with root privilege \n " && exit 1 if [[ -f /etc/os-release ]]; then @@ -67,13 +70,13 @@ update_x-ui() { local github_raw=$(get_github_raw) if [ $# == 0 ]; then - tag_version=$(curl -4 -Ls "https://api.github.com/repos/mhsanaei/3x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') + tag_version=$(curl -4 -Ls "https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') if [[ ! -n "$tag_version" ]]; then echo -e "${yellow}Failed to fetch x-ui version, it may be due to GitHub API restrictions, please try it later${plain}" exit 1 fi echo -e "Got x-ui latest version: ${tag_version}, beginning the installation..." - curl -4fLRo ${xui_folder}-linux-$(arch).tar.gz https://github.com/mhsanaei/3x-ui/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz + curl -4fLRo ${xui_folder}-linux-$(arch).tar.gz https://github.com/${REPO_OWNER}/${REPO_NAME}/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz if [[ $? -ne 0 ]]; then echo -e "${red}Downloading x-ui failed, please be sure that your server can access GitHub ${plain}" exit 1 @@ -88,7 +91,7 @@ update_x-ui() { exit 1 fi - url="https://github.com/mhsanaei/3x-ui/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz" + url="https://github.com/${REPO_OWNER}/${REPO_NAME}/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz" echo -e "Beginning to install x-ui $1" curl -4fLRo ${xui_folder}-linux-$(arch).tar.gz ${url} if [[ $? -ne 0 ]]; then @@ -97,7 +100,7 @@ update_x-ui() { fi fi - curl -4fLRo /usr/bin/x-ui-temp ${github_raw}/mhsanaei/3x-ui/main/x-ui.sh + curl -4fLRo /usr/bin/x-ui-temp ${github_raw}/${REPO_OWNER}/${REPO_NAME}/main/x-ui.sh if [[ $? -ne 0 ]]; then echo -e "${red}Failed to download x-ui.sh${plain}" exit 1 diff --git a/x-ui.sh b/x-ui.sh index 5392ba7a..aaeadc80 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -101,7 +101,7 @@ mkdir -p "${log_folder}" iplimit_log_path="${log_folder}/3xipl.log" iplimit_banned_log_path="${log_folder}/3xipl-banned.log" -REPO_OWNER="mhsanaei" +REPO_OWNER="ruyawwj" REPO_NAME="3x-ui" confirm() {