From 9d6db1e84723008bcb83cf6489f0cedc5d9e0c2b Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 11 Aug 2025 17:06:29 +0800 Subject: [PATCH 01/61] Update nginx.conf --- plugins/openresty/conf/nginx.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/openresty/conf/nginx.conf b/plugins/openresty/conf/nginx.conf index d03ddbdd2..403c248b8 100644 --- a/plugins/openresty/conf/nginx.conf +++ b/plugins/openresty/conf/nginx.conf @@ -32,6 +32,10 @@ http client_body_buffer_size 50m; client_max_body_size 50m; + # video big file opt + # aio threads; + directio 4m; + output_buffers 16 512k; sendfile on; tcp_nopush on; tcp_nodelay on; From e61be60f7107f9dd693b67b51c3ff04f261e0c56 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 11 Aug 2025 17:11:38 +0800 Subject: [PATCH 02/61] Update linux.conf --- plugins/sys-opt/tpl/linux.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/sys-opt/tpl/linux.conf b/plugins/sys-opt/tpl/linux.conf index c6b1cd8a4..f074f6516 100755 --- a/plugins/sys-opt/tpl/linux.conf +++ b/plugins/sys-opt/tpl/linux.conf @@ -34,6 +34,12 @@ net.ipv4.tcp_fin_timeout = 1 net.ipv4.tcp_keepalive_time = 30 net.ipv4.ip_local_port_range = 1024 65001 + +# vm opt +vm.dirty_ratio = 40 +vm.dirty_background_ratio = 10 +vm.swappiness = 10 +vm.vfs_cache_pressure = 500 vm.overcommit_memory=1 vm.max_map_count = 262144 From ad1035547d077fae4deb76b6697e90c1c6fe4647 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 11 Aug 2025 17:48:01 +0800 Subject: [PATCH 03/61] Update nginx.conf --- plugins/openresty/conf/nginx.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/openresty/conf/nginx.conf b/plugins/openresty/conf/nginx.conf index 403c248b8..f183385dc 100644 --- a/plugins/openresty/conf/nginx.conf +++ b/plugins/openresty/conf/nginx.conf @@ -11,6 +11,9 @@ events use {$EVENT_MODEL}; worker_connections 51200; multi_accept on; + + # file/video close the mutex lock when under high load + # accept_mutex off; } http From 1c4140daec0e5c3fc85b5ee9eb39fa1322037cef Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 11 Aug 2025 17:48:18 +0800 Subject: [PATCH 04/61] Update nginx.conf --- plugins/openresty/conf/nginx.conf | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/openresty/conf/nginx.conf b/plugins/openresty/conf/nginx.conf index f183385dc..d0b66ff63 100644 --- a/plugins/openresty/conf/nginx.conf +++ b/plugins/openresty/conf/nginx.conf @@ -45,8 +45,6 @@ http keepalive_timeout 60; - - fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; From 5c77dd91e7dad86f376272a41ca3fcda0d83f94d Mon Sep 17 00:00:00 2001 From: dami Date: Sun, 17 Aug 2025 17:25:34 +0800 Subject: [PATCH 05/61] Update nosql_mongodb.py --- plugins/data_query/nosql_mongodb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/data_query/nosql_mongodb.py b/plugins/data_query/nosql_mongodb.py index 9b22b9118..68ed451c3 100755 --- a/plugins/data_query/nosql_mongodb.py +++ b/plugins/data_query/nosql_mongodb.py @@ -170,7 +170,7 @@ class nosqlMongodb(): keys = ["bind_ip", "port"] result['host'] = '127.0.0.1' - rep = 'port\s*=\s*(.*)' + rep = r'port\s*=\s*(.*)' ip_re = re.search(rep, mgdb_content) if ip_re: result['port'] = int(ip_re.groups()[0].strip()) From 23e000afb30ab58ce1ed069d85e2461e3be891d1 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 15:57:38 +0800 Subject: [PATCH 06/61] Update install_dev.sh --- scripts/install_dev.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 46bfba4db..1eae92ac9 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -100,6 +100,10 @@ fi echo "local:${LOCAL_ADDR}" echo "OSNAME:${OSNAME}" +declare -A PROXY_URL +PROXY_URL["gh-proxy.com"]="https://gh-proxy.com" + + if [ $OSNAME != "macos" ];then if id www &> /dev/null ;then From f12db7e55f88a7bf42f9cbf83204a0219994b47a Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 16:03:31 +0800 Subject: [PATCH 07/61] Update install_dev.sh --- scripts/install_dev.sh | 106 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 1eae92ac9..22cf646b5 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -1,9 +1,23 @@ #!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin export PATH + +RED='\033[31m' +GREEN='\033[32m' +YELLOW='\033[33m' +BLUE='\033[34m' +PLAIN='\033[0m' +BOLD='\033[1m' +SUCCESS='[\033[32mOK\033[0m]' +COMPLETE='[\033[32mDONE\033[0m]' +WARN='[\033[33mWARN\033[0m]' +ERROR='[\033[31mERROR\033[0m]' +WORKING='[\033[34m*\033[0m]' + # LANG=en_US.UTF-8 is64bit=`getconf LONG_BIT` + if [ -f /www/server/mdserver-web/tools.py ];then echo -e "存在旧版代码,不能安装!,已知风险的情况下" echo -e "rm -rf /www/server/mdserver-web" @@ -81,6 +95,12 @@ if [ "$EUID" -ne 0 ] && [ "$OSNAME" != "macos" ];then exit fi +ARCH=$(uname -m) + +SYSTEM_NAME=$(cat $LinuxRelease | grep -E "^NAME=" | awk -F '=' '{print$2}' | sed "s/[\'\"]//g") +SYSTEM_VERSION_NUMBER=$(cat /etc/os-release | grep -E "VERSION_ID=" | awk -F '=' '{print$2}' | sed "s/[\'\"]//g") +SOURCE_BRANCH=${SYSTEM_JUDGMENT,,} + # HTTP_PREFIX="https://" # LOCAL_ADDR=common # ping -c 1 github.com > /dev/null 2>&1 @@ -104,6 +124,92 @@ declare -A PROXY_URL PROXY_URL["gh-proxy.com"]="https://gh-proxy.com" +SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) +SOURCE_LIST_KEY=(${SOURCE_LIST_KEY_SORT_TMP//'\n'/}) +SOURCE_LIST_LEN=${#PROXY_URL[*]} + +function AutoSizeStr(){ + NAME_STR=$1 + NAME_NUM=$2 + + NAME_STR_LEN=`echo "$NAME_STR" | wc -L` + NAME_NUM_LEN=`echo "$NAME_NUM" | wc -L` + + fix_len=35 + remaining_len=`expr $fix_len - $NAME_STR_LEN - $NAME_NUM_LEN` + FIX_SPACE=' ' + for ((ass_i=1;ass_i<=$remaining_len;ass_i++)) + do + FIX_SPACE="$FIX_SPACE " + done + echo -e " ❖ ${1}${FIX_SPACE}${2})" +} + +function ChooseProxyURL(){ + clear + echo -e '+---------------------------------------------------+' + echo -e '| |' + echo -e '| ============================================= |' + echo -e '| |' + echo -e '| 欢迎使用 Linux 一键安装mdserver-web面板源码 |' + echo -e '| |' + echo -e '| ============================================= |' + echo -e '| |' + echo -e '+---------------------------------------------------+' + echo -e '' + echo -e '#####################################################' + echo -e '' + echo -e ' 提供以下代理地址可供选择:' + echo -e '' + echo -e '#####################################################' + echo -e '' + cm_i=0 + for V in ${SOURCE_LIST_KEY[@]}; do + num=`expr $cm_i + 1` + AutoSizeStr "${V}" "$num" + cm_i=`expr $cm_i + 1` + done + echo -e '' + echo -e '#####################################################' + echo -e '' + echo -e " 运行环境 ${BLUE}${SYSTEM_NAME} ${SYSTEM_VERSION_NUMBER} ${SYSTEM_ARCH}${PLAIN}" + echo -e " 系统时间 ${BLUE}$(date "+%Y-%m-%d %H:%M:%S")${PLAIN}" + echo -e '' + echo -e '#####################################################' + CHOICE_A=$(echo -e "\n${BOLD}└─ 请选择并输入你想使用的代理地址 [ 1-${SOURCE_LIST_LEN} ]:${PLAIN}") + + read -p "${CHOICE_A}" INPUT + # echo $INPUT + if [ "$INPUT" == "" ];then + INPUT=1 + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n默认选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + fi + + if [ "$INPUT" -lt "0" ];then + INPUT=1 + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n低于边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + sleep 2s + fi + + if [ "$INPUT" -gt "${SOURCE_LIST_LEN}" ];then + INPUT=${SOURCE_LIST_LEN} + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n超出边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + sleep 2s + fi + + INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$INPUT]} + CHOICE_VERSION=${PY_VERSION[$INPUT_KEY]} +} + +ChooseProxyURL + if [ $OSNAME != "macos" ];then if id www &> /dev/null ;then From 164a450784eb1c64c45124f5134549f112b9503c Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 16:10:14 +0800 Subject: [PATCH 08/61] update --- scripts/choose_proxy.sh | 107 ++++++++++++++++++++++++++++++++++++++++++++++++ scripts/install_dev.sh | 2 +- 2 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 scripts/choose_proxy.sh diff --git a/scripts/choose_proxy.sh b/scripts/choose_proxy.sh new file mode 100644 index 000000000..8c29f6038 --- /dev/null +++ b/scripts/choose_proxy.sh @@ -0,0 +1,107 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin +export PATH + +RED='\033[31m' +GREEN='\033[32m' +YELLOW='\033[33m' +BLUE='\033[34m' +PLAIN='\033[0m' +BOLD='\033[1m' +SUCCESS='[\033[32mOK\033[0m]' +COMPLETE='[\033[32mDONE\033[0m]' +WARN='[\033[33mWARN\033[0m]' +ERROR='[\033[31mERROR\033[0m]' +WORKING='[\033[34m*\033[0m]' + +declare -A PROXY_URL +PROXY_URL["gh-proxy\.com"]="https://gh-proxy.com" + +SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) +SOURCE_LIST_KEY=(${SOURCE_LIST_KEY_SORT_TMP//'\n'/}) +SOURCE_LIST_LEN=${#PROXY_URL[*]} + +function AutoSizeStr(){ + NAME_STR=$1 + NAME_NUM=$2 + + NAME_STR_LEN=`echo "$NAME_STR" | wc -L` + NAME_NUM_LEN=`echo "$NAME_NUM" | wc -L` + + fix_len=35 + remaining_len=`expr $fix_len - $NAME_STR_LEN - $NAME_NUM_LEN` + FIX_SPACE=' ' + for ((ass_i=1;ass_i<=$remaining_len;ass_i++)) + do + FIX_SPACE="$FIX_SPACE " + done + echo -e " ❖ ${1}${FIX_SPACE}${2})" +} + +function ChooseProxyURL(){ + clear + echo -e '+---------------------------------------------------+' + echo -e '| |' + echo -e '| ============================================= |' + echo -e '| |' + echo -e '| 欢迎使用 Linux 一键安装mdserver-web面板源码 |' + echo -e '| |' + echo -e '| ============================================= |' + echo -e '| |' + echo -e '+---------------------------------------------------+' + echo -e '' + echo -e '#####################################################' + echo -e '' + echo -e ' 提供以下代理地址可供选择:' + echo -e '' + echo -e '#####################################################' + echo -e '' + cm_i=0 + for V in ${SOURCE_LIST_KEY[@]}; do + num=`expr $cm_i + 1` + AutoSizeStr "${V}" "$num" + cm_i=`expr $cm_i + 1` + done + echo -e '' + echo -e '#####################################################' + echo -e '' + echo -e " 运行环境 ${BLUE}${SYSTEM_NAME} ${SYSTEM_VERSION_NUMBER} ${SYSTEM_ARCH}${PLAIN}" + echo -e " 系统时间 ${BLUE}$(date "+%Y-%m-%d %H:%M:%S")${PLAIN}" + echo -e '' + echo -e '#####################################################' + CHOICE_A=$(echo -e "\n${BOLD}└─ 请选择并输入你想使用的代理地址 [ 1-${SOURCE_LIST_LEN} ]:${PLAIN}") + + read -p "${CHOICE_A}" INPUT + # echo $INPUT + if [ "$INPUT" == "" ];then + INPUT=1 + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n默认选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + fi + + if [ "$INPUT" -lt "0" ];then + INPUT=1 + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n低于边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + sleep 2s + fi + + if [ "$INPUT" -gt "${SOURCE_LIST_LEN}" ];then + INPUT=${SOURCE_LIST_LEN} + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n超出边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + sleep 2s + fi + + INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$INPUT]} + CHOICE_VERSION=${PY_VERSION[$INPUT_KEY]} + + echo $CHOICE_VERSION +} + +ChooseProxyURL + diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 22cf646b5..73252f4d1 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -121,7 +121,7 @@ echo "local:${LOCAL_ADDR}" echo "OSNAME:${OSNAME}" declare -A PROXY_URL -PROXY_URL["gh-proxy.com"]="https://gh-proxy.com" +PROXY_URL["gh-proxy\.com"]="https://gh-proxy.com" SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) From 485ab6793cfd5eafc9a4bf906280eaa09e3caff4 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 16:13:35 +0800 Subject: [PATCH 09/61] Update install_dev.sh --- scripts/install_dev.sh | 174 ++++++++++++++++++++++++------------------------- 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 73252f4d1..02069be34 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -33,93 +33,6 @@ LOG_FILE=/var/log/mw-install.log { -if [ -f /etc/motd ];then - echo "welcome to mdserver-web panel" > /etc/motd -fi - -startTime=`date +%s` - -_os=`uname` -echo "use system: ${_os}" - - -if [ ${_os} == "Darwin" ]; then - OSNAME='macos' -elif grep -Eq "openSUSE" /etc/*-release; then - OSNAME='opensuse' - zypper refresh - zypper install -y wget curl zip unzip unrar rar -elif grep -Eq "FreeBSD" /etc/*-release; then - OSNAME='freebsd' - pkg install -y wget curl zip unzip unrar rar -elif grep -Eqi "EulerOS" /etc/*-release || grep -Eqi "openEuler" /etc/*-release; then - OSNAME='euler' - yum install -y wget curl zip unzip tar crontabs -elif grep -Eqi "CentOS" /etc/issue || grep -Eqi "CentOS" /etc/*-release; then - OSNAME='rhel' - yum install -y wget zip unzip tar -elif grep -Eqi "Fedora" /etc/issue || grep -Eqi "Fedora" /etc/*-release; then - OSNAME='rhel' - yum install -y wget zip unzip tar -elif grep -Eqi "Rocky" /etc/issue || grep -Eqi "Rocky" /etc/*-release; then - OSNAME='rhel' - yum install -y wget zip unzip -elif grep -Eqi "Anolis" /etc/issue || grep -Eqi "Anolis" /etc/*-release; then - OSNAME='rhel' - yum install -y wget curl zip unzip tar crontabs -elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eqi "AlmaLinux" /etc/*-release; then - OSNAME='rhel' - yum install -y wget zip unzip tar -elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eqi "Amazon Linux" /etc/*-release; then - OSNAME='amazon' - yum install -y wget zip unzip tar -elif grep -Eqi "Ubuntu" /etc/issue || grep -Eqi "Ubuntu" /etc/*-release; then - OSNAME='ubuntu' - apt install -y wget zip unzip tar -elif grep -Eqi "Debian" /etc/issue || grep -Eqi "Debian" /etc/*-release; then - OSNAME='debian' - apt update -y - apt install -y devscripts - apt install -y wget zip unzip tar -elif grep -Eqi "Alpine" /etc/issue || grep -Eqi "Alpine" /etc/*-release; then - OSNAME='alpine' - apk update - apk add devscripts -force-broken-world - apk add curl wget zip unzip tar -force-broken-world -else - OSNAME='unknow' -fi - -if [ "$EUID" -ne 0 ] && [ "$OSNAME" != "macos" ];then - echo "Please run as root!" - exit -fi - -ARCH=$(uname -m) - -SYSTEM_NAME=$(cat $LinuxRelease | grep -E "^NAME=" | awk -F '=' '{print$2}' | sed "s/[\'\"]//g") -SYSTEM_VERSION_NUMBER=$(cat /etc/os-release | grep -E "VERSION_ID=" | awk -F '=' '{print$2}' | sed "s/[\'\"]//g") -SOURCE_BRANCH=${SYSTEM_JUDGMENT,,} - -# HTTP_PREFIX="https://" -# LOCAL_ADDR=common -# ping -c 1 github.com > /dev/null 2>&1 -# if [ "$?" != "0" ];then -# LOCAL_ADDR=cn -# HTTP_PREFIX="https://mirror.ghproxy.com/" -# fi - -HTTP_PREFIX="https://" -LOCAL_ADDR=common -cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") -if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then - LOCAL_ADDR=cn - HTTP_PREFIX="https://mirror.ghproxy.com/" -fi - -echo "local:${LOCAL_ADDR}" -echo "OSNAME:${OSNAME}" - declare -A PROXY_URL PROXY_URL["gh-proxy\.com"]="https://gh-proxy.com" @@ -210,6 +123,93 @@ function ChooseProxyURL(){ ChooseProxyURL +if [ -f /etc/motd ];then + echo "welcome to mdserver-web panel" > /etc/motd +fi + +startTime=`date +%s` + +_os=`uname` +echo "use system: ${_os}" + + +if [ ${_os} == "Darwin" ]; then + OSNAME='macos' +elif grep -Eq "openSUSE" /etc/*-release; then + OSNAME='opensuse' + zypper refresh + zypper install -y wget curl zip unzip unrar rar +elif grep -Eq "FreeBSD" /etc/*-release; then + OSNAME='freebsd' + pkg install -y wget curl zip unzip unrar rar +elif grep -Eqi "EulerOS" /etc/*-release || grep -Eqi "openEuler" /etc/*-release; then + OSNAME='euler' + yum install -y wget curl zip unzip tar crontabs +elif grep -Eqi "CentOS" /etc/issue || grep -Eqi "CentOS" /etc/*-release; then + OSNAME='rhel' + yum install -y wget zip unzip tar +elif grep -Eqi "Fedora" /etc/issue || grep -Eqi "Fedora" /etc/*-release; then + OSNAME='rhel' + yum install -y wget zip unzip tar +elif grep -Eqi "Rocky" /etc/issue || grep -Eqi "Rocky" /etc/*-release; then + OSNAME='rhel' + yum install -y wget zip unzip +elif grep -Eqi "Anolis" /etc/issue || grep -Eqi "Anolis" /etc/*-release; then + OSNAME='rhel' + yum install -y wget curl zip unzip tar crontabs +elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eqi "AlmaLinux" /etc/*-release; then + OSNAME='rhel' + yum install -y wget zip unzip tar +elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eqi "Amazon Linux" /etc/*-release; then + OSNAME='amazon' + yum install -y wget zip unzip tar +elif grep -Eqi "Ubuntu" /etc/issue || grep -Eqi "Ubuntu" /etc/*-release; then + OSNAME='ubuntu' + apt install -y wget zip unzip tar +elif grep -Eqi "Debian" /etc/issue || grep -Eqi "Debian" /etc/*-release; then + OSNAME='debian' + apt update -y + apt install -y devscripts + apt install -y wget zip unzip tar +elif grep -Eqi "Alpine" /etc/issue || grep -Eqi "Alpine" /etc/*-release; then + OSNAME='alpine' + apk update + apk add devscripts -force-broken-world + apk add curl wget zip unzip tar -force-broken-world +else + OSNAME='unknow' +fi + +if [ "$EUID" -ne 0 ] && [ "$OSNAME" != "macos" ];then + echo "Please run as root!" + exit +fi + +ARCH=$(uname -m) + +SYSTEM_NAME=$(cat $LinuxRelease | grep -E "^NAME=" | awk -F '=' '{print$2}' | sed "s/[\'\"]//g") +SYSTEM_VERSION_NUMBER=$(cat /etc/os-release | grep -E "VERSION_ID=" | awk -F '=' '{print$2}' | sed "s/[\'\"]//g") +SOURCE_BRANCH=${SYSTEM_JUDGMENT,,} + +# HTTP_PREFIX="https://" +# LOCAL_ADDR=common +# ping -c 1 github.com > /dev/null 2>&1 +# if [ "$?" != "0" ];then +# LOCAL_ADDR=cn +# HTTP_PREFIX="https://mirror.ghproxy.com/" +# fi + +HTTP_PREFIX="https://" +LOCAL_ADDR=common +cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") +if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then + LOCAL_ADDR=cn + HTTP_PREFIX="https://mirror.ghproxy.com/" +fi + +echo "local:${LOCAL_ADDR}" +echo "OSNAME:${OSNAME}" + if [ $OSNAME != "macos" ];then if id www &> /dev/null ;then From 2943d1f1b74dfb9148468c31efe8eb6e8b494ce7 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 16:14:53 +0800 Subject: [PATCH 10/61] Update install_dev.sh --- scripts/install_dev.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 02069be34..ee09b759d 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -85,7 +85,6 @@ function ChooseProxyURL(){ echo -e '' echo -e '#####################################################' echo -e '' - echo -e " 运行环境 ${BLUE}${SYSTEM_NAME} ${SYSTEM_VERSION_NUMBER} ${SYSTEM_ARCH}${PLAIN}" echo -e " 系统时间 ${BLUE}$(date "+%Y-%m-%d %H:%M:%S")${PLAIN}" echo -e '' echo -e '#####################################################' From 6602119ee797586fa31ac35934f5dc2ea163edc9 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 16:15:57 +0800 Subject: [PATCH 11/61] Update install_dev.sh --- scripts/install_dev.sh | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index ee09b759d..7f5875ae9 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -33,6 +33,22 @@ LOG_FILE=/var/log/mw-install.log { +# HTTP_PREFIX="https://" +# LOCAL_ADDR=common +# ping -c 1 github.com > /dev/null 2>&1 +# if [ "$?" != "0" ];then +# LOCAL_ADDR=cn +# HTTP_PREFIX="https://mirror.ghproxy.com/" +# fi + +HTTP_PREFIX="https://" +LOCAL_ADDR=common +cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") +if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then + LOCAL_ADDR=cn + HTTP_PREFIX="https://mirror.ghproxy.com/" +fi + declare -A PROXY_URL PROXY_URL["gh-proxy\.com"]="https://gh-proxy.com" @@ -184,27 +200,7 @@ if [ "$EUID" -ne 0 ] && [ "$OSNAME" != "macos" ];then exit fi -ARCH=$(uname -m) -SYSTEM_NAME=$(cat $LinuxRelease | grep -E "^NAME=" | awk -F '=' '{print$2}' | sed "s/[\'\"]//g") -SYSTEM_VERSION_NUMBER=$(cat /etc/os-release | grep -E "VERSION_ID=" | awk -F '=' '{print$2}' | sed "s/[\'\"]//g") -SOURCE_BRANCH=${SYSTEM_JUDGMENT,,} - -# HTTP_PREFIX="https://" -# LOCAL_ADDR=common -# ping -c 1 github.com > /dev/null 2>&1 -# if [ "$?" != "0" ];then -# LOCAL_ADDR=cn -# HTTP_PREFIX="https://mirror.ghproxy.com/" -# fi - -HTTP_PREFIX="https://" -LOCAL_ADDR=common -cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") -if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then - LOCAL_ADDR=cn - HTTP_PREFIX="https://mirror.ghproxy.com/" -fi echo "local:${LOCAL_ADDR}" echo "OSNAME:${OSNAME}" From 0593be9928d6f1f1f5c0ad3882ad7df44ae996f9 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 16:18:18 +0800 Subject: [PATCH 12/61] Update install_dev.sh --- scripts/install_dev.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 7f5875ae9..18f87906b 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -49,14 +49,15 @@ if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then HTTP_PREFIX="https://mirror.ghproxy.com/" fi -declare -A PROXY_URL -PROXY_URL["gh-proxy\.com"]="https://gh-proxy.com" +if [ "$LOCAL_ADDR" != "common" ];then + declare -A PROXY_URL + PROXY_URL['gh-proxy.com']="https://gh-proxy.com" + SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) + SOURCE_LIST_KEY=(${SOURCE_LIST_KEY_SORT_TMP//'\n'/}) + SOURCE_LIST_LEN=${#PROXY_URL[*]} +fi -SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) -SOURCE_LIST_KEY=(${SOURCE_LIST_KEY_SORT_TMP//'\n'/}) -SOURCE_LIST_LEN=${#PROXY_URL[*]} - function AutoSizeStr(){ NAME_STR=$1 NAME_NUM=$2 From 4b3116067022bde0ba5a2441ed3019d011144913 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 16:19:48 +0800 Subject: [PATCH 13/61] Update install_dev.sh --- scripts/install_dev.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 18f87906b..54d3a1470 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -41,17 +41,17 @@ LOG_FILE=/var/log/mw-install.log # HTTP_PREFIX="https://mirror.ghproxy.com/" # fi -HTTP_PREFIX="https://" LOCAL_ADDR=common cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then LOCAL_ADDR=cn - HTTP_PREFIX="https://mirror.ghproxy.com/" fi if [ "$LOCAL_ADDR" != "common" ];then declare -A PROXY_URL PROXY_URL['gh-proxy.com']="https://gh-proxy.com" + + SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) SOURCE_LIST_KEY=(${SOURCE_LIST_KEY_SORT_TMP//'\n'/}) SOURCE_LIST_LEN=${#PROXY_URL[*]} From 106af5b17719e87519dccedfd0274bc81e570f11 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 16:21:14 +0800 Subject: [PATCH 14/61] Update install_dev.sh --- scripts/install_dev.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 54d3a1470..c596547c5 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -49,9 +49,9 @@ fi if [ "$LOCAL_ADDR" != "common" ];then declare -A PROXY_URL - PROXY_URL['gh-proxy.com']="https://gh-proxy.com" + PROXY_URL["gh-proxy"]="https://gh-proxy.com/" + - SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) SOURCE_LIST_KEY=(${SOURCE_LIST_KEY_SORT_TMP//'\n'/}) SOURCE_LIST_LEN=${#PROXY_URL[*]} From b27cb78f62cc8305c78113c7ff9672bbcb196627 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 16:21:26 +0800 Subject: [PATCH 15/61] Update install_dev.sh --- scripts/install_dev.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index c596547c5..817f7688a 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -47,15 +47,15 @@ if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then LOCAL_ADDR=cn fi -if [ "$LOCAL_ADDR" != "common" ];then - declare -A PROXY_URL - PROXY_URL["gh-proxy"]="https://gh-proxy.com/" +# if [ "$LOCAL_ADDR" != "common" ];then +declare -A PROXY_URL +PROXY_URL["gh-proxy"]="https://gh-proxy.com/" - SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) - SOURCE_LIST_KEY=(${SOURCE_LIST_KEY_SORT_TMP//'\n'/}) - SOURCE_LIST_LEN=${#PROXY_URL[*]} -fi +SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) +SOURCE_LIST_KEY=(${SOURCE_LIST_KEY_SORT_TMP//'\n'/}) +SOURCE_LIST_LEN=${#PROXY_URL[*]} +# fi function AutoSizeStr(){ From 2b7725432268765139bba0f5186045764651476f Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 16:22:57 +0800 Subject: [PATCH 16/61] Update install_dev.sh --- scripts/install_dev.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 817f7688a..e29681a6a 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -89,7 +89,7 @@ function ChooseProxyURL(){ echo -e '' echo -e '#####################################################' echo -e '' - echo -e ' 提供以下代理地址可供选择:' + echo -e ' 提供以下国内代理地址可供选择: ' echo -e '' echo -e '#####################################################' echo -e '' From ba937c1e77b04a26a29dbd2400cdc8ca9bbaca93 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 16:25:54 +0800 Subject: [PATCH 17/61] update --- scripts/choose_proxy.sh | 107 ------------------------------------------------ scripts/install_dev.sh | 20 +++------ 2 files changed, 5 insertions(+), 122 deletions(-) delete mode 100644 scripts/choose_proxy.sh diff --git a/scripts/choose_proxy.sh b/scripts/choose_proxy.sh deleted file mode 100644 index 8c29f6038..000000000 --- a/scripts/choose_proxy.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/bash -PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin -export PATH - -RED='\033[31m' -GREEN='\033[32m' -YELLOW='\033[33m' -BLUE='\033[34m' -PLAIN='\033[0m' -BOLD='\033[1m' -SUCCESS='[\033[32mOK\033[0m]' -COMPLETE='[\033[32mDONE\033[0m]' -WARN='[\033[33mWARN\033[0m]' -ERROR='[\033[31mERROR\033[0m]' -WORKING='[\033[34m*\033[0m]' - -declare -A PROXY_URL -PROXY_URL["gh-proxy\.com"]="https://gh-proxy.com" - -SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) -SOURCE_LIST_KEY=(${SOURCE_LIST_KEY_SORT_TMP//'\n'/}) -SOURCE_LIST_LEN=${#PROXY_URL[*]} - -function AutoSizeStr(){ - NAME_STR=$1 - NAME_NUM=$2 - - NAME_STR_LEN=`echo "$NAME_STR" | wc -L` - NAME_NUM_LEN=`echo "$NAME_NUM" | wc -L` - - fix_len=35 - remaining_len=`expr $fix_len - $NAME_STR_LEN - $NAME_NUM_LEN` - FIX_SPACE=' ' - for ((ass_i=1;ass_i<=$remaining_len;ass_i++)) - do - FIX_SPACE="$FIX_SPACE " - done - echo -e " ❖ ${1}${FIX_SPACE}${2})" -} - -function ChooseProxyURL(){ - clear - echo -e '+---------------------------------------------------+' - echo -e '| |' - echo -e '| ============================================= |' - echo -e '| |' - echo -e '| 欢迎使用 Linux 一键安装mdserver-web面板源码 |' - echo -e '| |' - echo -e '| ============================================= |' - echo -e '| |' - echo -e '+---------------------------------------------------+' - echo -e '' - echo -e '#####################################################' - echo -e '' - echo -e ' 提供以下代理地址可供选择:' - echo -e '' - echo -e '#####################################################' - echo -e '' - cm_i=0 - for V in ${SOURCE_LIST_KEY[@]}; do - num=`expr $cm_i + 1` - AutoSizeStr "${V}" "$num" - cm_i=`expr $cm_i + 1` - done - echo -e '' - echo -e '#####################################################' - echo -e '' - echo -e " 运行环境 ${BLUE}${SYSTEM_NAME} ${SYSTEM_VERSION_NUMBER} ${SYSTEM_ARCH}${PLAIN}" - echo -e " 系统时间 ${BLUE}$(date "+%Y-%m-%d %H:%M:%S")${PLAIN}" - echo -e '' - echo -e '#####################################################' - CHOICE_A=$(echo -e "\n${BOLD}└─ 请选择并输入你想使用的代理地址 [ 1-${SOURCE_LIST_LEN} ]:${PLAIN}") - - read -p "${CHOICE_A}" INPUT - # echo $INPUT - if [ "$INPUT" == "" ];then - INPUT=1 - TMP_INPUT=`expr $INPUT - 1` - INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} - echo -e "\n默认选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" - fi - - if [ "$INPUT" -lt "0" ];then - INPUT=1 - TMP_INPUT=`expr $INPUT - 1` - INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} - echo -e "\n低于边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" - sleep 2s - fi - - if [ "$INPUT" -gt "${SOURCE_LIST_LEN}" ];then - INPUT=${SOURCE_LIST_LEN} - TMP_INPUT=`expr $INPUT - 1` - INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} - echo -e "\n超出边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" - sleep 2s - fi - - INPUT=`expr $INPUT - 1` - INPUT_KEY=${SOURCE_LIST_KEY[$INPUT]} - CHOICE_VERSION=${PY_VERSION[$INPUT_KEY]} - - echo $CHOICE_VERSION -} - -ChooseProxyURL - diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index e29681a6a..3a1e9fd1e 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -222,21 +222,11 @@ if [ $OSNAME != "macos" ];then mkdir -p /www/backup/site if [ ! -d /www/server/mdserver-web ];then - - if [ "$LOCAL_ADDR" == "common" ];then - curl --insecure -sSLo /tmp/dev.zip ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/dev.zip - cd /tmp && unzip /tmp/dev.zip - mv -f /tmp/mdserver-web-dev /www/server/mdserver-web - rm -rf /tmp/dev.zip - rm -rf /tmp/mdserver-web-dev - else - # curl --insecure -sSLo /tmp/dev.zip https://code.midoks.icu/midoks/mdserver-web/archive/dev.zip - wget --no-check-certificate -O /tmp/dev.zip https://code.midoks.icu/midoks/mdserver-web/archive/dev.zip - cd /tmp && unzip /tmp/dev.zip - mv -f /tmp/mdserver-web /www/server/mdserver-web - rm -rf /tmp/dev.zip - rm -rf /tmp/mdserver-web - fi + curl --insecure -sSLo /tmp/dev.zip ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/dev.zip + d /tmp && unzip /tmp/dev.zip + mv -f /tmp/mdserver-web-dev /www/server/mdserver-web + rm -rf /tmp/dev.zip + rm -rf /tmp/mdserver-web-dev fi # install acme.sh From 5b4ceb49df90b065d43b33c3c1acb84a4dd463c3 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 16:27:54 +0800 Subject: [PATCH 18/61] Update install_dev.sh --- scripts/install_dev.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 3a1e9fd1e..9f263781d 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -33,14 +33,7 @@ LOG_FILE=/var/log/mw-install.log { -# HTTP_PREFIX="https://" -# LOCAL_ADDR=common -# ping -c 1 github.com > /dev/null 2>&1 -# if [ "$?" != "0" ];then -# LOCAL_ADDR=cn -# HTTP_PREFIX="https://mirror.ghproxy.com/" -# fi - +HTTP_PREFIX="https://" LOCAL_ADDR=common cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then @@ -134,7 +127,7 @@ function ChooseProxyURL(){ INPUT=`expr $INPUT - 1` INPUT_KEY=${SOURCE_LIST_KEY[$INPUT]} - CHOICE_VERSION=${PY_VERSION[$INPUT_KEY]} + HTTP_PREFIX=${PROXY_URL[$INPUT_KEY]} } ChooseProxyURL From 4591c9006b922fc45585e6a6789bb56ee1916db9 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 16:28:23 +0800 Subject: [PATCH 19/61] Update install_dev.sh --- scripts/install_dev.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 9f263781d..efd92e281 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -215,6 +215,7 @@ if [ $OSNAME != "macos" ];then mkdir -p /www/backup/site if [ ! -d /www/server/mdserver-web ];then + echo "downloading ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/dev.zip" curl --insecure -sSLo /tmp/dev.zip ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/dev.zip d /tmp && unzip /tmp/dev.zip mv -f /tmp/mdserver-web-dev /www/server/mdserver-web From d36d2fa4b404aa3e5a0c083e5b47aa11328eb415 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 16:29:07 +0800 Subject: [PATCH 20/61] Update install_dev.sh --- scripts/install_dev.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index efd92e281..a85089e47 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -226,8 +226,8 @@ if [ $OSNAME != "macos" ];then # install acme.sh if [ ! -d /root/.acme.sh ];then if [ "$LOCAL_ADDR" != "common" ];then - # curl -sSL -o /tmp/acme.tar.gz ${HTTP_PREFIX}github.com/acmesh-official/acme.sh/archive/master.tar.gz - curl --insecure -sSLo /tmp/acme.tar.gz https://gitee.com/neilpang/acme.sh/repository/archive/master.tar.gz + curl -sSL -o /tmp/acme.tar.gz ${HTTP_PREFIX}github.com/acmesh-official/acme.sh/archive/master.tar.gz + # curl --insecure -sSLo /tmp/acme.tar.gz https://gitee.com/neilpang/acme.sh/repository/archive/master.tar.gz tar xvzf /tmp/acme.tar.gz -C /tmp cd /tmp/acme.sh-master bash acme.sh install From 37206916e49ec98e586938fa43cdad2206bc5f1d Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 16:29:49 +0800 Subject: [PATCH 21/61] Update install_dev.sh --- scripts/install_dev.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index a85089e47..494c560e5 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -74,7 +74,7 @@ function ChooseProxyURL(){ echo -e '| |' echo -e '| ============================================= |' echo -e '| |' - echo -e '| 欢迎使用 Linux 一键安装mdserver-web面板源码 |' + echo -e '| 欢迎使用 Linux 一键安装mdserver-web面板源码 |' echo -e '| |' echo -e '| ============================================= |' echo -e '| |' From 3cd9b52d2a6a5267afb375c13a98334847d4bb17 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 16:30:13 +0800 Subject: [PATCH 22/61] Update install_dev.sh --- scripts/install_dev.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 494c560e5..6e5fa789b 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -217,7 +217,7 @@ if [ $OSNAME != "macos" ];then if [ ! -d /www/server/mdserver-web ];then echo "downloading ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/dev.zip" curl --insecure -sSLo /tmp/dev.zip ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/dev.zip - d /tmp && unzip /tmp/dev.zip + cd /tmp && unzip /tmp/dev.zip mv -f /tmp/mdserver-web-dev /www/server/mdserver-web rm -rf /tmp/dev.zip rm -rf /tmp/mdserver-web-dev From a148e27211357e5680a6fc70845f564bde81f8cd Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 16:33:57 +0800 Subject: [PATCH 23/61] Update install_dev.sh --- scripts/install_dev.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 6e5fa789b..f68c58eb8 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -40,15 +40,15 @@ if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then LOCAL_ADDR=cn fi -# if [ "$LOCAL_ADDR" != "common" ];then -declare -A PROXY_URL -PROXY_URL["gh-proxy"]="https://gh-proxy.com/" +if [ "$LOCAL_ADDR" != "common" ];then + declare -A PROXY_URL + PROXY_URL["gh-proxy"]="https://gh-proxy.com/" -SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) -SOURCE_LIST_KEY=(${SOURCE_LIST_KEY_SORT_TMP//'\n'/}) -SOURCE_LIST_LEN=${#PROXY_URL[*]} -# fi + SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) + SOURCE_LIST_KEY=(${SOURCE_LIST_KEY_SORT_TMP//'\n'/}) + SOURCE_LIST_LEN=${#PROXY_URL[*]} +fi function AutoSizeStr(){ @@ -130,7 +130,9 @@ function ChooseProxyURL(){ HTTP_PREFIX=${PROXY_URL[$INPUT_KEY]} } -ChooseProxyURL +if [ "$LOCAL_ADDR" != "common" ];then + ChooseProxyURL +fi if [ -f /etc/motd ];then echo "welcome to mdserver-web panel" > /etc/motd From b93d77c90707cf71a9ec48ac309cb53035161081 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 16:35:00 +0800 Subject: [PATCH 24/61] Update install_dev.sh --- scripts/install_dev.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index f68c58eb8..bede7c70c 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -197,7 +197,6 @@ if [ "$EUID" -ne 0 ] && [ "$OSNAME" != "macos" ];then fi - echo "local:${LOCAL_ADDR}" echo "OSNAME:${OSNAME}" From a0886e1a3d831166c241d05fef448a534353d6c4 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 17:01:11 +0800 Subject: [PATCH 25/61] Update install_dev.sh --- scripts/install_dev.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index bede7c70c..cb00c1c27 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -42,7 +42,10 @@ fi if [ "$LOCAL_ADDR" != "common" ];then declare -A PROXY_URL - PROXY_URL["gh-proxy"]="https://gh-proxy.com/" + PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" + PROXY_URL["ghproxy_link"]="https://ghproxy.link/" + PROXY_URL["gitclone_com"]="https://gitclone.com/" + SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) @@ -243,6 +246,7 @@ fi echo "use system version: ${OSNAME}" if [ "${OSNAME}" == "macos" ];then + # bash < (curl -sSL https://raw.githubusercontent.com/midoks/mdserver-web/refs/heads/dev/scripts/install/macos.sh) curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/master/scripts/install/macos.sh | bash else cd /www/server/mdserver-web && bash scripts/install/${OSNAME}.sh From 8eea4072f686c1719f07f8d401f75fc3bda84333 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 17:03:19 +0800 Subject: [PATCH 26/61] Update install_dev.sh --- scripts/install_dev.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index cb00c1c27..739b2d26e 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -231,7 +231,6 @@ if [ $OSNAME != "macos" ];then if [ ! -d /root/.acme.sh ];then if [ "$LOCAL_ADDR" != "common" ];then curl -sSL -o /tmp/acme.tar.gz ${HTTP_PREFIX}github.com/acmesh-official/acme.sh/archive/master.tar.gz - # curl --insecure -sSLo /tmp/acme.tar.gz https://gitee.com/neilpang/acme.sh/repository/archive/master.tar.gz tar xvzf /tmp/acme.tar.gz -C /tmp cd /tmp/acme.sh-master bash acme.sh install From e634c44797698a208d870a32e7ddfd3538b7165c Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 17:04:58 +0800 Subject: [PATCH 27/61] Update install_dev.sh --- scripts/install_dev.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 739b2d26e..ca0758a39 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -234,10 +234,8 @@ if [ $OSNAME != "macos" ];then tar xvzf /tmp/acme.tar.gz -C /tmp cd /tmp/acme.sh-master bash acme.sh install - fi - - if [ ! -d /root/.acme.sh ];then - curl https://get.acme.sh | sh + else + curl https://get.acme.sh | sh fi fi fi From 90c024dfe55c575b3ef4719e2950d7cae9fd70f5 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 17:05:35 +0800 Subject: [PATCH 28/61] Update install_dev.sh --- scripts/install_dev.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index ca0758a39..cefdb3f73 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -235,7 +235,7 @@ if [ $OSNAME != "macos" ];then cd /tmp/acme.sh-master bash acme.sh install else - curl https://get.acme.sh | sh + curl -fsSL https://get.acme.sh | bash fi fi fi From ca4fa30cdb31bb695b043f94310ae5482eb7b87b Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 17:11:40 +0800 Subject: [PATCH 29/61] Update install_dev.sh --- scripts/install_dev.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index cefdb3f73..f0b620e87 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -243,8 +243,7 @@ fi echo "use system version: ${OSNAME}" if [ "${OSNAME}" == "macos" ];then - # bash < (curl -sSL https://raw.githubusercontent.com/midoks/mdserver-web/refs/heads/dev/scripts/install/macos.sh) - curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/master/scripts/install/macos.sh | bash + curl --insecure -fsSL ${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/refs/heads/dev/scripts/install/macos.sh | bash else cd /www/server/mdserver-web && bash scripts/install/${OSNAME}.sh fi From 0b4b8a62aaec4f480eeed4df5a377b4eb0659087 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 17:16:29 +0800 Subject: [PATCH 30/61] Update install_dev.sh --- scripts/install_dev.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index f0b620e87..2dd7b4b07 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -77,7 +77,7 @@ function ChooseProxyURL(){ echo -e '| |' echo -e '| ============================================= |' echo -e '| |' - echo -e '| 欢迎使用 Linux 一键安装mdserver-web面板源码 |' + echo -e '| 欢迎使用 Linux 一键安装mdserver-web面板源码 |' echo -e '| |' echo -e '| ============================================= |' echo -e '| |' From f16a2a7fec51bb3c4078517fdab1bcfeb0c6ffd9 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 17:37:33 +0800 Subject: [PATCH 31/61] update --- scripts/install_dev.sh | 8 ++++++++ scripts/t.sh | 11 +++++++++++ 2 files changed, 19 insertions(+) create mode 100644 scripts/t.sh diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 2dd7b4b07..bc5452f43 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -135,6 +135,14 @@ function ChooseProxyURL(){ if [ "$LOCAL_ADDR" != "common" ];then ChooseProxyURL + + DOMAIN=`echo $HTTP_PREFIX | sed 's|https://||g'` + DOMAIN=`echo $DOMAIN | sed 's|/||g'` + ping -c 3 $DOMAIN > /dev/null 2>&1 + if [ "$?" != "0" ];then + echo "无效代理地址:${DOMAIN}" + exit + fi fi if [ -f /etc/motd ];then diff --git a/scripts/t.sh b/scripts/t.sh new file mode 100644 index 000000000..9d87cb143 --- /dev/null +++ b/scripts/t.sh @@ -0,0 +1,11 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH +export LANG=en_US.UTF-8 + + +DOMAIN="https://gh-proxy.com/" + +DOMAIN=`echo $DOMAIN | sed 's|https://||g'` +DOMAIN=`echo $DOMAIN | sed 's|/||g'` +echo $DOMAIN \ No newline at end of file From 35904bd79d9bdf4c873e4969d4e2730038679495 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 17:41:12 +0800 Subject: [PATCH 32/61] Update install_dev.sh --- scripts/install_dev.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index bc5452f43..dc6227fc7 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -45,7 +45,7 @@ if [ "$LOCAL_ADDR" != "common" ];then PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" PROXY_URL["ghproxy_link"]="https://ghproxy.link/" PROXY_URL["gitclone_com"]="https://gitclone.com/" - + PROXY_URL["source"]="https://" SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) From 57e36c5fdb61f63f99fdce3980be726f8527f593 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 17:45:02 +0800 Subject: [PATCH 33/61] Update mw.tpl --- scripts/init.d/mw.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 633207765..2afc588ff 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -256,9 +256,9 @@ mw_install(){ fi if [ "$LOCAL_ADDR" == "common" ];then - curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh | bash + bash <(bash -fsSL "https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh") else - curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/dev/scripts/install.sh | bash + bash <(bash -fsSL "https://code.midoks.icu/midoks/mdserver-web/raw/branch/dev/scripts/install.sh") fi } From 9831216ca4f90c8f92b61d905aae0b11fd734fc0 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 18:03:43 +0800 Subject: [PATCH 34/61] Update install_dev.sh --- scripts/install_dev.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index dc6227fc7..0fea874a4 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -136,13 +136,15 @@ function ChooseProxyURL(){ if [ "$LOCAL_ADDR" != "common" ];then ChooseProxyURL - DOMAIN=`echo $HTTP_PREFIX | sed 's|https://||g'` - DOMAIN=`echo $DOMAIN | sed 's|/||g'` - ping -c 3 $DOMAIN > /dev/null 2>&1 - if [ "$?" != "0" ];then - echo "无效代理地址:${DOMAIN}" - exit - fi + if [ "$DOMAIN" != "http://" ];then + DOMAIN=`echo $HTTP_PREFIX | sed 's|https://||g'` + DOMAIN=`echo $DOMAIN | sed 's|/||g'` + ping -c 3 $DOMAIN > /dev/null 2>&1 + if [ "$?" != "0" ];then + echo "无效代理地址:${DOMAIN}" + exit + fi + if fi if [ -f /etc/motd ];then From e5591cc59e6cdd4774437965570d8b2cb8f849b7 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 18:08:17 +0800 Subject: [PATCH 35/61] Update install_dev.sh --- scripts/install_dev.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 0fea874a4..cc0f05fa8 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -144,7 +144,7 @@ if [ "$LOCAL_ADDR" != "common" ];then echo "无效代理地址:${DOMAIN}" exit fi - if + fi fi if [ -f /etc/motd ];then From b06100d0dca1c1920fdbe914cc01c32f71051fae Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 19:07:07 +0800 Subject: [PATCH 36/61] Update README.md --- README.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6ff25272f..15668dc26 100644 --- a/README.md +++ b/README.md @@ -118,13 +118,13 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443: - 初始安装 ``` -curl --insecure -fsSL https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/install.sh | bash +bash <(curl --insecure -fsSL https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/install.sh) ``` - 直接更新 ``` -curl --insecure -fsSL https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/update.sh | bash +bash <(curl --insecure -fsSL https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/update.sh) ``` - 卸载脚本 @@ -138,8 +138,9 @@ wget --no-check-certificate -O uninstall.sh https://cdn.jsdelivr.net/gh/midoks/m - 初始安装 ``` -curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh | bash -curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/master/scripts/install.sh | bash + +bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install.sh) +bash <(curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/master/scripts/install.sh) ``` - 直接更新 @@ -167,8 +168,8 @@ curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev ### DEV使用 ``` -curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install_dev.sh | bash -curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh | bash +bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install_dev.sh) +bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh) wget --no-check-certificate -O install.sh https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install.sh && bash install.sh @@ -176,8 +177,8 @@ wget --no-check-certificate -O uninstall.sh https://raw.githubusercontent.com/mi curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/quick/debug.sh | bash -curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/dev/scripts/install_dev.sh | bash -curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/dev/scripts/update_dev.sh | bash +bash <(curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/dev/scripts/install_dev.sh) +bash <(curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/dev/scripts/update_dev.sh) ``` ### 旧版安装/更新 From 47a60b41a8d920bcdd3ad5a8a7f949ed6704a236 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 19:30:17 +0800 Subject: [PATCH 37/61] up --- scripts/install.sh | 185 +++++++++++++++++++++++++++++++++++++------------ scripts/install_dev.sh | 2 +- scripts/lib.sh | 8 --- scripts/update.sh | 147 ++++++++++++++++++++++++++++++++------- scripts/update_dev.sh | 165 ++++++++++++++++++++++++++++++++++--------- 5 files changed, 398 insertions(+), 109 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 67d44431b..6a2702da8 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,6 +1,20 @@ #!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin export PATH + +RED='\033[31m' +GREEN='\033[32m' +YELLOW='\033[33m' +BLUE='\033[34m' +PLAIN='\033[0m' +BOLD='\033[1m' +SUCCESS='[\033[32mOK\033[0m]' +COMPLETE='[\033[32mDONE\033[0m]' +WARN='[\033[33mWARN\033[0m]' +ERROR='[\033[31mERROR\033[0m]' +WORKING='[\033[34m*\033[0m]' + + # LANG=en_US.UTF-8 is64bit=`getconf LONG_BIT` @@ -12,9 +26,122 @@ if [ -f /www/server/mdserver-web/tools.py ];then fi LOG_FILE=/var/log/mw-install.log - { +HTTP_PREFIX="https://" +LOCAL_ADDR=common +cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") +if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then + LOCAL_ADDR=cn +fi + +if [ "$LOCAL_ADDR" != "common" ];then + declare -A PROXY_URL + PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" + PROXY_URL["ghproxy_link"]="https://ghproxy.link/" + PROXY_URL["gitclone_com"]="https://gitclone.com/" + PROXY_URL["source"]="https://" + + + SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) + SOURCE_LIST_KEY=(${SOURCE_LIST_KEY_SORT_TMP//'\n'/}) + SOURCE_LIST_LEN=${#PROXY_URL[*]} +fi + + +function AutoSizeStr(){ + NAME_STR=$1 + NAME_NUM=$2 + + NAME_STR_LEN=`echo "$NAME_STR" | wc -L` + NAME_NUM_LEN=`echo "$NAME_NUM" | wc -L` + + fix_len=35 + remaining_len=`expr $fix_len - $NAME_STR_LEN - $NAME_NUM_LEN` + FIX_SPACE=' ' + for ((ass_i=1;ass_i<=$remaining_len;ass_i++)) + do + FIX_SPACE="$FIX_SPACE " + done + echo -e " ❖ ${1}${FIX_SPACE}${2})" +} + +function ChooseProxyURL(){ + clear + echo -e '+---------------------------------------------------+' + echo -e '| |' + echo -e '| ============================================= |' + echo -e '| |' + echo -e '| 欢迎使用 Linux 一键安装mdserver-web面板源码 |' + echo -e '| |' + echo -e '| ============================================= |' + echo -e '| |' + echo -e '+---------------------------------------------------+' + echo -e '' + echo -e '#####################################################' + echo -e '' + echo -e ' 提供以下国内代理地址可供选择: ' + echo -e '' + echo -e '#####################################################' + echo -e '' + cm_i=0 + for V in ${SOURCE_LIST_KEY[@]}; do + num=`expr $cm_i + 1` + AutoSizeStr "${V}" "$num" + cm_i=`expr $cm_i + 1` + done + echo -e '' + echo -e '#####################################################' + echo -e '' + echo -e " 系统时间 ${BLUE}$(date "+%Y-%m-%d %H:%M:%S")${PLAIN}" + echo -e '' + echo -e '#####################################################' + CHOICE_A=$(echo -e "\n${BOLD}└─ 请选择并输入你想使用的代理地址 [ 1-${SOURCE_LIST_LEN} ]:${PLAIN}") + + read -p "${CHOICE_A}" INPUT + # echo $INPUT + if [ "$INPUT" == "" ];then + INPUT=1 + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n默认选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + fi + + if [ "$INPUT" -lt "0" ];then + INPUT=1 + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n低于边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + sleep 2s + fi + + if [ "$INPUT" -gt "${SOURCE_LIST_LEN}" ];then + INPUT=${SOURCE_LIST_LEN} + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n超出边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + sleep 2s + fi + + INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$INPUT]} + HTTP_PREFIX=${PROXY_URL[$INPUT_KEY]} +} + +if [ "$LOCAL_ADDR" != "common" ];then + ChooseProxyURL + + if [ "$DOMAIN" != "http://" ];then + DOMAIN=`echo $HTTP_PREFIX | sed 's|https://||g'` + DOMAIN=`echo $DOMAIN | sed 's|/||g'` + ping -c 3 $DOMAIN > /dev/null 2>&1 + if [ "$?" != "0" ];then + echo "无效代理地址:${DOMAIN}" + exit + fi + fi +fi + if [ -f /etc/motd ];then echo "welcome to mdserver-web panel" > /etc/motd fi @@ -76,24 +203,8 @@ if [ "$EUID" -ne 0 ] && [ "$OSNAME" != "macos" ];then exit fi - -# HTTP_PREFIX="https://" -# LOCAL_ADDR=common -# ping -c 1 github.com > /dev/null 2>&1 -# if [ "$?" != "0" ];then -# LOCAL_ADDR=cn -# HTTP_PREFIX="https://mirror.ghproxy.com/" -# fi - -HTTP_PREFIX="https://" -LOCAL_ADDR=common -cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") -if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then - LOCAL_ADDR=cn - HTTP_PREFIX="https://mirror.ghproxy.com/" -fi - -echo "local:${LOCAL_ADDR}" +echo "LOCAL:${LOCAL_ADDR}" +echo "OSNAME:${OSNAME}" if [ $OSNAME != "macos" ];then if id www &> /dev/null ;then @@ -109,44 +220,30 @@ if [ $OSNAME != "macos" ];then mkdir -p /www/backup/database mkdir -p /www/backup/site - # https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/install.sh if [ ! -d /www/server/mdserver-web ];then - if [ "$LOCAL_ADDR" == "common" ];then - curl --insecure -sSLo /tmp/master.zip ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/master.zip - cd /tmp && unzip /tmp/master.zip - mv -f /tmp/mdserver-web-master /www/server/mdserver-web - rm -rf /tmp/master.zip - rm -rf /tmp/mdserver-web-master - else - # curl --insecure -sSLo /tmp/master.zip https://code.midoks.icu/midoks/mdserver-web/archive/master.zip - wget --no-check-certificate -O /tmp/master.zip https://code.midoks.icu/midoks/mdserver-web/archive/master.zip - cd /tmp && unzip /tmp/master.zip - mv -f /tmp/mdserver-web /www/server/mdserver-web - rm -rf /tmp/master.zip - rm -rf /tmp/mdserver-web - fi - - + curl --insecure -sSLo /tmp/master.zip ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/master.tar.gz + cd /tmp && tar -zxvf /tmp/master.tar.gz + mv -f /tmp/mdserver-web-master /www/server/mdserver-web + rm -rf /tmp/master.tar.gz + rm -rf /tmp/mdserver-web-master fi # install acme.sh if [ ! -d /root/.acme.sh ];then if [ "$LOCAL_ADDR" != "common" ];then - curl --insecure -sSLo /tmp/acme.tar.gz https://gitee.com/neilpang/acme.sh/repository/archive/master.tar.gz - tar xvzf /tmp/acme.tar.gz -C /tmp - cd /tmp/acme.sh-master + curl --insecure -sSLo /tmp/acme.sh-master.tar.gz ${HTTP_PREFIX}github.com/acmesh-official/acme.sh/archive/refs/heads/master.tar.gz + tar xvzf /tmp/acme.sh-master.tar.gz -C /tmp + cd /tmp/acme.sh-master.tar.gz bash acme.sh install - fi - - if [ ! -d /root/.acme.sh ];then - curl https://get.acme.sh | sh + else + curl -fsSL https://get.acme.sh | bash fi fi fi echo "use system version: ${OSNAME}" if [ "${OSNAME}" == "macos" ];then - curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/master/scripts/install/macos.sh | bash + curl --insecure -fsSL ${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/refs/heads/dev/scripts/install/macos.sh | bash else cd /www/server/mdserver-web && bash scripts/install/${OSNAME}.sh fi diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index cc0f05fa8..822a674a6 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -210,7 +210,7 @@ if [ "$EUID" -ne 0 ] && [ "$OSNAME" != "macos" ];then fi -echo "local:${LOCAL_ADDR}" +echo "LOCAL:${LOCAL_ADDR}" echo "OSNAME:${OSNAME}" if [ $OSNAME != "macos" ];then diff --git a/scripts/lib.sh b/scripts/lib.sh index dfeb7d551..f9329b1e4 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -57,19 +57,11 @@ fi echo "system:${OSNAME}:${VERSION_ID}" -# HTTP_PREFIX="https://" -# LOCAL_ADDR=common -# ping -c 1 github.com > /dev/null 2>&1 -# if [ "$?" != "0" ];then -# LOCAL_ADDR=cn -# HTTP_PREFIX="https://mirror.ghproxy.com/" -# fi HTTP_PREFIX="https://" LOCAL_ADDR=common cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then LOCAL_ADDR=cn - HTTP_PREFIX="https://mirror.ghproxy.com/" fi PIPSRC="https://pypi.python.org/simple" diff --git a/scripts/update.sh b/scripts/update.sh index e658b4e53..efec043d1 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -27,9 +27,123 @@ if [ ${_os} != "Darwin" ] && [ ! -d /www/server/mdserver-web/logs ]; then fi LOG_FILE=/var/log/mw-update.log - { +HTTP_PREFIX="https://" +LOCAL_ADDR=common +cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") +if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then + LOCAL_ADDR=cn +fi + +if [ "$LOCAL_ADDR" != "common" ];then + declare -A PROXY_URL + PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" + PROXY_URL["ghproxy_link"]="https://ghproxy.link/" + PROXY_URL["gitclone_com"]="https://gitclone.com/" + PROXY_URL["source"]="https://" + + + SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) + SOURCE_LIST_KEY=(${SOURCE_LIST_KEY_SORT_TMP//'\n'/}) + SOURCE_LIST_LEN=${#PROXY_URL[*]} +fi + + +function AutoSizeStr(){ + NAME_STR=$1 + NAME_NUM=$2 + + NAME_STR_LEN=`echo "$NAME_STR" | wc -L` + NAME_NUM_LEN=`echo "$NAME_NUM" | wc -L` + + fix_len=35 + remaining_len=`expr $fix_len - $NAME_STR_LEN - $NAME_NUM_LEN` + FIX_SPACE=' ' + for ((ass_i=1;ass_i<=$remaining_len;ass_i++)) + do + FIX_SPACE="$FIX_SPACE " + done + echo -e " ❖ ${1}${FIX_SPACE}${2})" +} + +function ChooseProxyURL(){ + clear + echo -e '+---------------------------------------------------+' + echo -e '| |' + echo -e '| ============================================= |' + echo -e '| |' + echo -e '| 欢迎使用 Linux 一键安装mdserver-web面板源码 |' + echo -e '| |' + echo -e '| ============================================= |' + echo -e '| |' + echo -e '+---------------------------------------------------+' + echo -e '' + echo -e '#####################################################' + echo -e '' + echo -e ' 提供以下国内代理地址可供选择: ' + echo -e '' + echo -e '#####################################################' + echo -e '' + cm_i=0 + for V in ${SOURCE_LIST_KEY[@]}; do + num=`expr $cm_i + 1` + AutoSizeStr "${V}" "$num" + cm_i=`expr $cm_i + 1` + done + echo -e '' + echo -e '#####################################################' + echo -e '' + echo -e " 系统时间 ${BLUE}$(date "+%Y-%m-%d %H:%M:%S")${PLAIN}" + echo -e '' + echo -e '#####################################################' + CHOICE_A=$(echo -e "\n${BOLD}└─ 请选择并输入你想使用的代理地址 [ 1-${SOURCE_LIST_LEN} ]:${PLAIN}") + + read -p "${CHOICE_A}" INPUT + # echo $INPUT + if [ "$INPUT" == "" ];then + INPUT=1 + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n默认选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + fi + + if [ "$INPUT" -lt "0" ];then + INPUT=1 + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n低于边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + sleep 2s + fi + + if [ "$INPUT" -gt "${SOURCE_LIST_LEN}" ];then + INPUT=${SOURCE_LIST_LEN} + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n超出边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + sleep 2s + fi + + INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$INPUT]} + HTTP_PREFIX=${PROXY_URL[$INPUT_KEY]} +} + + +if [ "$LOCAL_ADDR" != "common" ];then + ChooseProxyURL + + if [ "$DOMAIN" != "http://" ];then + DOMAIN=`echo $HTTP_PREFIX | sed 's|https://||g'` + DOMAIN=`echo $DOMAIN | sed 's|/||g'` + ping -c 3 $DOMAIN > /dev/null 2>&1 + if [ "$?" != "0" ];then + echo "无效代理地址:${DOMAIN}" + exit + fi + fi +fi + if [ ${_os} == "Darwin" ]; then OSNAME='macos' elif grep -Eqi "openSUSE" /etc/*-release; then @@ -74,37 +188,22 @@ else OSNAME='unknow' fi - -HTTP_PREFIX="https://" -LOCAL_ADDR=common -cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") -if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then - LOCAL_ADDR=cn - HTTP_PREFIX="https://mirror.ghproxy.com/" -fi -echo "local:${LOCAL_ADDR}" +echo "LOCAL:${LOCAL_ADDR}" CP_CMD=/usr/bin/cp if [ -f /bin/cp ];then CP_CMD=/bin/cp fi -if [ "$LOCAL_ADDR" != "common" ];then - # curl --insecure -sSLo /tmp/master.zip https://code.midoks.icu/midoks/mdserver-web/archive/master.zip - wget --no-check-certificate -O /tmp/master.zip https://code.midoks.icu/midoks/mdserver-web/archive/master.zip - cd /tmp && unzip /tmp/master.zip +echo "update mdserver-web code start" - $CP_CMD -rf /tmp/mdserver-web/* /www/server/mdserver-web - rm -rf /tmp/master.zip - rm -rf /tmp/mdserver-web -else - curl --insecure -sSLo /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master +curl --insecure -sSLo /tmp/master.tar.gz ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/master.tar.gz +cd /tmp && tar -zxvf /tmp/master.tar.gz +$CP_CMD -rf /tmp/mdserver-web-master/* /www/server/mdserver-web +rm -rf /tmp/master.tar.gz +rm -rf /tmp/mdserver-web-master - cd /tmp && unzip /tmp/master.zip - $CP_CMD -rf /tmp/mdserver-web-master/* /www/server/mdserver-web - rm -rf /tmp/master.zip - rm -rf /tmp/mdserver-web-master -fi +echo "update mdserver-web code end" #pip uninstall public diff --git a/scripts/update_dev.sh b/scripts/update_dev.sh index 2a743d008..67381afce 100755 --- a/scripts/update_dev.sh +++ b/scripts/update_dev.sh @@ -1,6 +1,19 @@ #!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin export PATH + +RED='\033[31m' +GREEN='\033[32m' +YELLOW='\033[33m' +BLUE='\033[34m' +PLAIN='\033[0m' +BOLD='\033[1m' +SUCCESS='[\033[32mOK\033[0m]' +COMPLETE='[\033[32mDONE\033[0m]' +WARN='[\033[33mWARN\033[0m]' +ERROR='[\033[31mERROR\033[0m]' +WORKING='[\033[34m*\033[0m]' + # LANG=en_US.UTF-8 is64bit=`getconf LONG_BIT` @@ -29,6 +42,121 @@ LOG_FILE=/var/log/mw-update.log { +HTTP_PREFIX="https://" +LOCAL_ADDR=common +cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") +if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then + LOCAL_ADDR=cn +fi + +if [ "$LOCAL_ADDR" != "common" ];then + declare -A PROXY_URL + PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" + PROXY_URL["ghproxy_link"]="https://ghproxy.link/" + PROXY_URL["gitclone_com"]="https://gitclone.com/" + PROXY_URL["source"]="https://" + + + SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) + SOURCE_LIST_KEY=(${SOURCE_LIST_KEY_SORT_TMP//'\n'/}) + SOURCE_LIST_LEN=${#PROXY_URL[*]} +fi + + +function AutoSizeStr(){ + NAME_STR=$1 + NAME_NUM=$2 + + NAME_STR_LEN=`echo "$NAME_STR" | wc -L` + NAME_NUM_LEN=`echo "$NAME_NUM" | wc -L` + + fix_len=35 + remaining_len=`expr $fix_len - $NAME_STR_LEN - $NAME_NUM_LEN` + FIX_SPACE=' ' + for ((ass_i=1;ass_i<=$remaining_len;ass_i++)) + do + FIX_SPACE="$FIX_SPACE " + done + echo -e " ❖ ${1}${FIX_SPACE}${2})" +} + +function ChooseProxyURL(){ + clear + echo -e '+---------------------------------------------------+' + echo -e '| |' + echo -e '| ============================================= |' + echo -e '| |' + echo -e '| 欢迎使用 Linux 一键安装mdserver-web面板源码 |' + echo -e '| |' + echo -e '| ============================================= |' + echo -e '| |' + echo -e '+---------------------------------------------------+' + echo -e '' + echo -e '#####################################################' + echo -e '' + echo -e ' 提供以下国内代理地址可供选择: ' + echo -e '' + echo -e '#####################################################' + echo -e '' + cm_i=0 + for V in ${SOURCE_LIST_KEY[@]}; do + num=`expr $cm_i + 1` + AutoSizeStr "${V}" "$num" + cm_i=`expr $cm_i + 1` + done + echo -e '' + echo -e '#####################################################' + echo -e '' + echo -e " 系统时间 ${BLUE}$(date "+%Y-%m-%d %H:%M:%S")${PLAIN}" + echo -e '' + echo -e '#####################################################' + CHOICE_A=$(echo -e "\n${BOLD}└─ 请选择并输入你想使用的代理地址 [ 1-${SOURCE_LIST_LEN} ]:${PLAIN}") + + read -p "${CHOICE_A}" INPUT + # echo $INPUT + if [ "$INPUT" == "" ];then + INPUT=1 + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n默认选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + fi + + if [ "$INPUT" -lt "0" ];then + INPUT=1 + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n低于边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + sleep 2s + fi + + if [ "$INPUT" -gt "${SOURCE_LIST_LEN}" ];then + INPUT=${SOURCE_LIST_LEN} + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n超出边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + sleep 2s + fi + + INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$INPUT]} + HTTP_PREFIX=${PROXY_URL[$INPUT_KEY]} +} + + +if [ "$LOCAL_ADDR" != "common" ];then + ChooseProxyURL + + if [ "$DOMAIN" != "http://" ];then + DOMAIN=`echo $HTTP_PREFIX | sed 's|https://||g'` + DOMAIN=`echo $DOMAIN | sed 's|/||g'` + ping -c 3 $DOMAIN > /dev/null 2>&1 + if [ "$?" != "0" ];then + echo "无效代理地址:${DOMAIN}" + exit + fi + fi +fi + if [ ${_os} == "Darwin" ]; then OSNAME='macos' elif grep -Eqi "openSUSE" /etc/*-release; then @@ -70,21 +198,6 @@ else OSNAME='unknow' fi -# HTTP_PREFIX="https://" -# LOCAL_ADDR=common -# ping -c 1 github.com > /dev/null 2>&1 -# if [ "$?" != "0" ];then -# LOCAL_ADDR=cn -# HTTP_PREFIX="https://mirror.ghproxy.com/" -# fi -HTTP_PREFIX="https://" -LOCAL_ADDR=common -cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") -if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then - LOCAL_ADDR=cn - HTTP_PREFIX="https://mirror.ghproxy.com/" -fi - echo "local:${LOCAL_ADDR}" CP_CMD=/usr/bin/cp @@ -94,26 +207,14 @@ fi echo "update mdserver-web code start" -if [ "$LOCAL_ADDR" != "common" ];then - wget --no-check-certificate -O /tmp/dev.zip https://code.midoks.icu/midoks/mdserver-web/archive/dev.zip - # curl --insecure -sSLo /tmp/dev.zip https://code.midoks.icu/midoks/mdserver-web/archive/dev.zip - cd /tmp && unzip /tmp/dev.zip - - $CP_CMD -rf /tmp/mdserver-web/* /www/server/mdserver-web - rm -rf /tmp/master.zip - rm -rf /tmp/mdserver-web -else - curl --insecure -sSLo /tmp/dev.zip ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/dev.zip - cd /tmp && unzip /tmp/dev.zip - $CP_CMD -rf /tmp/mdserver-web-dev/* /www/server/mdserver-web - rm -rf /tmp/dev.zip - rm -rf /tmp/mdserver-web-dev -fi +curl --insecure -sSLo /tmp/dev.tar.gz ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/dev.tar.gz +cd /tmp && tar -zxvf /tmp/dev.tar.gz +$CP_CMD -rf /tmp/mdserver-web-dev/* /www/server/mdserver-web +rm -rf /tmp/dev.tar.gz +rm -rf /tmp/mdserver-web-dev echo "update mdserver-web code end" -rm -rf /tmp/dev.zip -rm -rf /tmp/mdserver-web-dev #pip uninstall public echo "use system version: ${OSNAME}" From 4533e87befbeab94adb0a56582cd8f23d7cd7b2c Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 19:50:29 +0800 Subject: [PATCH 38/61] Update mw.tpl --- scripts/init.d/mw.tpl | 113 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 102 insertions(+), 11 deletions(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 2afc588ff..62534cb8f 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -243,23 +243,52 @@ error_logs() tail -n 100 ${PANEL_DIR}/logs/panel_error.log } + +mw_common_proxy(){ + HTTP_PREFIX="https://" + LOCAL_ADDR=common + cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") + if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then + LOCAL_ADDR=cn + fi + + if [ "$LOCAL_ADDR" != "common" ];then + declare -A PROXY_URL + PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" + PROXY_URL["ghproxy_link"]="https://ghproxy.link/" + PROXY_URL["gitclone_com"]="https://gitclone.com/" + PROXY_URL["source"]="https://" + + + SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) + SOURCE_LIST_KEY=(${SOURCE_LIST_KEY_SORT_TMP//'\n'/}) + SOURCE_LIST_LEN=${#PROXY_URL[*]} + fi + + if [ "$LOCAL_ADDR" != "common" ];then + ChooseProxyURL + + if [ "$DOMAIN" != "http://" ];then + DOMAIN=`echo $HTTP_PREFIX | sed 's|https://||g'` + DOMAIN=`echo $DOMAIN | sed 's|/||g'` + ping -c 3 $DOMAIN > /dev/null 2>&1 + if [ "$?" != "0" ];then + echo "无效代理地址:${DOMAIN}" + exit + fi + fi + fi +} + mw_install(){ if [ -f ${PANEL_DIR}/task.py ];then echo "与后续版本差异太大,不再提供更新" exit 0 fi - LOCAL_ADDR=common - cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") - if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then - LOCAL_ADDR=cn - fi - - if [ "$LOCAL_ADDR" == "common" ];then - bash <(bash -fsSL "https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh") - else - bash <(bash -fsSL "https://code.midoks.icu/midoks/mdserver-web/raw/branch/dev/scripts/install.sh") - fi + mw_common_proxy + bash <(curl -fsSL "{$HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh") + echo "bash <(curl -fsSL "{$HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh")" } mw_update() @@ -398,6 +427,68 @@ function AutoSizeStr(){ echo -e " ❖ ${1}${FIX_SPACE}${2})" } +function ChooseProxyURL(){ + clear + echo -e '+---------------------------------------------------+' + echo -e '| |' + echo -e '| ============================================= |' + echo -e '| |' + echo -e '| 欢迎使用 Linux 一键安装mdserver-web面板源码 |' + echo -e '| |' + echo -e '| ============================================= |' + echo -e '| |' + echo -e '+---------------------------------------------------+' + echo -e '' + echo -e '#####################################################' + echo -e '' + echo -e ' 提供以下国内代理地址可供选择: ' + echo -e '' + echo -e '#####################################################' + echo -e '' + cm_i=0 + for V in ${SOURCE_LIST_KEY[@]}; do + num=`expr $cm_i + 1` + AutoSizeStr "${V}" "$num" + cm_i=`expr $cm_i + 1` + done + echo -e '' + echo -e '#####################################################' + echo -e '' + echo -e " 系统时间 ${BLUE}$(date "+%Y-%m-%d %H:%M:%S")${PLAIN}" + echo -e '' + echo -e '#####################################################' + CHOICE_A=$(echo -e "\n${BOLD}└─ 请选择并输入你想使用的代理地址 [ 1-${SOURCE_LIST_LEN} ]:${PLAIN}") + + read -p "${CHOICE_A}" INPUT + # echo $INPUT + if [ "$INPUT" == "" ];then + INPUT=1 + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n默认选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + fi + + if [ "$INPUT" -lt "0" ];then + INPUT=1 + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n低于边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + sleep 2s + fi + + if [ "$INPUT" -gt "${SOURCE_LIST_LEN}" ];then + INPUT=${SOURCE_LIST_LEN} + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n超出边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + sleep 2s + fi + + INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$INPUT]} + HTTP_PREFIX=${PROXY_URL[$INPUT_KEY]} +} + mw_connect_mysql(){ # choose mysql login From 679a1f0d051e52c4fe26e13e9d9639a8e584b250 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 19:53:43 +0800 Subject: [PATCH 39/61] Update mw.tpl --- scripts/init.d/mw.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 62534cb8f..de2fd5878 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -287,8 +287,8 @@ mw_install(){ fi mw_common_proxy - bash <(curl -fsSL "{$HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh") - echo "bash <(curl -fsSL "{$HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh")" + bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh") + echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh")" } mw_update() From 9f081359b06b9c7aeab0ed6feb2edb217b505769 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 19:54:17 +0800 Subject: [PATCH 40/61] Update mw.tpl --- scripts/init.d/mw.tpl | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index de2fd5878..09e587630 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -298,17 +298,9 @@ mw_update() exit 0 fi - LOCAL_ADDR=common - cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") - if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then - LOCAL_ADDR=cn - fi - - if [ "$LOCAL_ADDR" == "common" ];then - curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh | bash - else - curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/dev/scripts/update.sh | bash - fi + mw_common_proxy + bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh") + echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh")" } mw_update_dev() From 8a240e2c9cdabfb08ef0a383294ffce1e38c3978 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 19:55:45 +0800 Subject: [PATCH 41/61] Update mw.tpl --- scripts/init.d/mw.tpl | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 09e587630..cffcccca8 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -309,18 +309,10 @@ mw_update_dev() echo "与后续版本差异太大,不再提供更新" exit 0 fi - - LOCAL_ADDR=common - cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") - if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then - LOCAL_ADDR=cn - fi - - if [ "$LOCAL_ADDR" == "common" ];then - curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh | bash - else - curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/dev/scripts/update_dev.sh | bash - fi + + mw_common_proxy + bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh") + echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh")" cd ${PANEL_DIR} } From 72934000b0b39530901683efc51a18254d0d294c Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 19:56:48 +0800 Subject: [PATCH 42/61] Update mw.tpl --- scripts/init.d/mw.tpl | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index cffcccca8..e2dfe26da 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -322,17 +322,10 @@ mw_update_venv() rm -rf ${PANEL_DIR}/lib64 rm -rf ${PANEL_DIR}/lib - LOCAL_ADDR=common - cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") - if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then - LOCAL_ADDR=cn - fi + mw_common_proxy + bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh") + echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh")" - if [ "$LOCAL_ADDR" == "common" ];then - curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh | bash - else - curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/dev/scripts/update_dev.sh | bash - fi cd ${PANEL_DIR} } From 5e24086476e462d4f02f85e19a0f3d397916b367 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 19:58:04 +0800 Subject: [PATCH 43/61] Delete t.sh --- scripts/t.sh | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 scripts/t.sh diff --git a/scripts/t.sh b/scripts/t.sh deleted file mode 100644 index 9d87cb143..000000000 --- a/scripts/t.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin -export PATH -export LANG=en_US.UTF-8 - - -DOMAIN="https://gh-proxy.com/" - -DOMAIN=`echo $DOMAIN | sed 's|https://||g'` -DOMAIN=`echo $DOMAIN | sed 's|/||g'` -echo $DOMAIN \ No newline at end of file From 19ec0ddcb903856acf5258808ce409940349b470 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 20:00:41 +0800 Subject: [PATCH 44/61] Update mw.tpl --- scripts/init.d/mw.tpl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index e2dfe26da..73b547f4c 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -288,7 +288,7 @@ mw_install(){ mw_common_proxy bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh") - echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh")" + # echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh")" } mw_update() @@ -300,7 +300,7 @@ mw_update() mw_common_proxy bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh") - echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh")" + # echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh")" } mw_update_dev() @@ -312,7 +312,7 @@ mw_update_dev() mw_common_proxy bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh") - echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh")" + # echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh")" cd ${PANEL_DIR} } @@ -324,8 +324,7 @@ mw_update_venv() mw_common_proxy bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh") - echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh")" - + # echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh")" cd ${PANEL_DIR} } From c31a95dd4b1a157ee2edb4cfe216cf3e89801989 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 20:03:30 +0800 Subject: [PATCH 45/61] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 15668dc26..4e384798a 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,7 @@ bash <(curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/bra - 直接更新 ``` -curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh | bash +bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh) ``` - 卸载脚本 @@ -161,7 +161,7 @@ wget --no-check-certificate -O uninstall.sh https://raw.githubusercontent.com/mi - 需已经安装mdserver-web ``` -curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/quick/app.sh | bash +bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/quick/app.sh) ``` @@ -175,7 +175,7 @@ wget --no-check-certificate -O install.sh https://raw.githubusercontent.com/mido wget --no-check-certificate -O uninstall.sh https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/uninstall.sh && bash uninstall.sh -curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/quick/debug.sh | bash +bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/quick/debug.sh) bash <(curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/dev/scripts/install_dev.sh) bash <(curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/dev/scripts/update_dev.sh) @@ -195,7 +195,7 @@ cd /www/server/mdserver-web && rm -rf lib64 cd /www/server/mdserver-web && rm -rf bin cd /www/server/mdserver-web && rm -rf include -mw update/mw update_dev +mw update/mw update_dev/mw dev ``` ### 捐赠地址 USDT(TRC20) From 5f42e94da7a1eef716a5b91530deefbe991a7a0c Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 20:05:56 +0800 Subject: [PATCH 46/61] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 4e384798a..cc77a6a11 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,9 @@ bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-w ### DEV使用 ``` +bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install.sh) +bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update.sh) + bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install_dev.sh) bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh) From 73c8117a6788cafd221ee9d52452254f69d44de0 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 20:07:31 +0800 Subject: [PATCH 47/61] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cc77a6a11..9239e03d7 100644 --- a/README.md +++ b/README.md @@ -168,8 +168,8 @@ bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-w ### DEV使用 ``` -bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install.sh) -bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update.sh) +bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh) +bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh) bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install_dev.sh) bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh) From fa2dda6ee4c68837202e39f6fe51353106ad4e46 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 20:08:43 +0800 Subject: [PATCH 48/61] Update README.md --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9239e03d7..eae2b135c 100644 --- a/README.md +++ b/README.md @@ -168,8 +168,8 @@ bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-w ### DEV使用 ``` -bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh) -bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh) +bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install.sh) +bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update.sh) bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install_dev.sh) bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh) @@ -180,6 +180,9 @@ wget --no-check-certificate -O uninstall.sh https://raw.githubusercontent.com/mi bash <(curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/quick/debug.sh) +bash <(curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/dev/scripts/install.sh) +bash <(curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/dev/scripts/update.sh) + bash <(curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/dev/scripts/install_dev.sh) bash <(curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/dev/scripts/update_dev.sh) ``` From f14d2fddc79d69ad8dd820d8c4d9b442097777ae Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 20:10:19 +0800 Subject: [PATCH 49/61] Update mw.tpl --- scripts/init.d/mw.tpl | 161 +++++++++++++++++++++++++------------------------- 1 file changed, 81 insertions(+), 80 deletions(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 73b547f4c..0aa5c5fba 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -243,6 +243,87 @@ error_logs() tail -n 100 ${PANEL_DIR}/logs/panel_error.log } +# 00----00----00----00----00----00----00----00----00----00----00----00----00----00 + +function AutoSizeStr(){ + NAME_STR=$1 + NAME_NUM=$2 + + NAME_STR_LEN=`echo "$NAME_STR" | wc -L` + NAME_NUM_LEN=`echo "$NAME_NUM" | wc -L` + + fix_len=35 + remaining_len=`expr $fix_len - $NAME_STR_LEN - $NAME_NUM_LEN` + FIX_SPACE=' ' + for ((ass_i=1;ass_i<=$remaining_len;ass_i++)) + do + FIX_SPACE="$FIX_SPACE " + done + echo -e " ❖ ${1}${FIX_SPACE}${2})" +} + +function ChooseProxyURL(){ + clear + echo -e '+---------------------------------------------------+' + echo -e '| |' + echo -e '| ============================================= |' + echo -e '| |' + echo -e '| 欢迎使用 Linux 一键安装mdserver-web面板源码 |' + echo -e '| |' + echo -e '| ============================================= |' + echo -e '| |' + echo -e '+---------------------------------------------------+' + echo -e '' + echo -e '#####################################################' + echo -e '' + echo -e ' 提供以下国内代理地址可供选择: ' + echo -e '' + echo -e '#####################################################' + echo -e '' + cm_i=0 + for V in ${SOURCE_LIST_KEY[@]}; do + num=`expr $cm_i + 1` + AutoSizeStr "${V}" "$num" + cm_i=`expr $cm_i + 1` + done + echo -e '' + echo -e '#####################################################' + echo -e '' + echo -e " 系统时间 ${BLUE}$(date "+%Y-%m-%d %H:%M:%S")${PLAIN}" + echo -e '' + echo -e '#####################################################' + CHOICE_A=$(echo -e "\n${BOLD}└─ 请选择并输入你想使用的代理地址 [ 1-${SOURCE_LIST_LEN} ]:${PLAIN}") + + read -p "${CHOICE_A}" INPUT + # echo $INPUT + if [ "$INPUT" == "" ];then + INPUT=1 + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n默认选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + fi + + if [ "$INPUT" -lt "0" ];then + INPUT=1 + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n低于边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + sleep 2s + fi + + if [ "$INPUT" -gt "${SOURCE_LIST_LEN}" ];then + INPUT=${SOURCE_LIST_LEN} + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n超出边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + sleep 2s + fi + + INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$INPUT]} + HTTP_PREFIX=${PROXY_URL[$INPUT_KEY]} +} + mw_common_proxy(){ HTTP_PREFIX="https://" @@ -385,86 +466,6 @@ mw_debug(){ gunicorn -b :$port -k eventlet -w 1 app:app } - -function AutoSizeStr(){ - NAME_STR=$1 - NAME_NUM=$2 - - NAME_STR_LEN=`echo "$NAME_STR" | wc -L` - NAME_NUM_LEN=`echo "$NAME_NUM" | wc -L` - - fix_len=35 - remaining_len=`expr $fix_len - $NAME_STR_LEN - $NAME_NUM_LEN` - FIX_SPACE=' ' - for ((ass_i=1;ass_i<=$remaining_len;ass_i++)) - do - FIX_SPACE="$FIX_SPACE " - done - echo -e " ❖ ${1}${FIX_SPACE}${2})" -} - -function ChooseProxyURL(){ - clear - echo -e '+---------------------------------------------------+' - echo -e '| |' - echo -e '| ============================================= |' - echo -e '| |' - echo -e '| 欢迎使用 Linux 一键安装mdserver-web面板源码 |' - echo -e '| |' - echo -e '| ============================================= |' - echo -e '| |' - echo -e '+---------------------------------------------------+' - echo -e '' - echo -e '#####################################################' - echo -e '' - echo -e ' 提供以下国内代理地址可供选择: ' - echo -e '' - echo -e '#####################################################' - echo -e '' - cm_i=0 - for V in ${SOURCE_LIST_KEY[@]}; do - num=`expr $cm_i + 1` - AutoSizeStr "${V}" "$num" - cm_i=`expr $cm_i + 1` - done - echo -e '' - echo -e '#####################################################' - echo -e '' - echo -e " 系统时间 ${BLUE}$(date "+%Y-%m-%d %H:%M:%S")${PLAIN}" - echo -e '' - echo -e '#####################################################' - CHOICE_A=$(echo -e "\n${BOLD}└─ 请选择并输入你想使用的代理地址 [ 1-${SOURCE_LIST_LEN} ]:${PLAIN}") - - read -p "${CHOICE_A}" INPUT - # echo $INPUT - if [ "$INPUT" == "" ];then - INPUT=1 - TMP_INPUT=`expr $INPUT - 1` - INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} - echo -e "\n默认选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" - fi - - if [ "$INPUT" -lt "0" ];then - INPUT=1 - TMP_INPUT=`expr $INPUT - 1` - INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} - echo -e "\n低于边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" - sleep 2s - fi - - if [ "$INPUT" -gt "${SOURCE_LIST_LEN}" ];then - INPUT=${SOURCE_LIST_LEN} - TMP_INPUT=`expr $INPUT - 1` - INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} - echo -e "\n超出边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" - sleep 2s - fi - - INPUT=`expr $INPUT - 1` - INPUT_KEY=${SOURCE_LIST_KEY[$INPUT]} - HTTP_PREFIX=${PROXY_URL[$INPUT_KEY]} -} - mw_connect_mysql(){ # choose mysql login From 66c875584f6b932e12a4392f9dcb710c52693279 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 20:13:35 +0800 Subject: [PATCH 50/61] Update update_dev.sh --- scripts/update_dev.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/update_dev.sh b/scripts/update_dev.sh index 67381afce..3497ce1c7 100755 --- a/scripts/update_dev.sh +++ b/scripts/update_dev.sh @@ -205,7 +205,7 @@ if [ -f /bin/cp ];then CP_CMD=/bin/cp fi -echo "update mdserver-web code start" +echo "update mdserver-web dev code start" curl --insecure -sSLo /tmp/dev.tar.gz ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/dev.tar.gz cd /tmp && tar -zxvf /tmp/dev.tar.gz @@ -213,7 +213,7 @@ $CP_CMD -rf /tmp/mdserver-web-dev/* /www/server/mdserver-web rm -rf /tmp/dev.tar.gz rm -rf /tmp/mdserver-web-dev -echo "update mdserver-web code end" +echo "update mdserver-web dev code end" #pip uninstall public From 9cd46a7f9f273e100f110a03057a9d70abe9c8f2 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 20:22:49 +0800 Subject: [PATCH 51/61] Update update_dev.sh --- scripts/update_dev.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/update_dev.sh b/scripts/update_dev.sh index 3497ce1c7..788a40f26 100755 --- a/scripts/update_dev.sh +++ b/scripts/update_dev.sh @@ -205,6 +205,14 @@ if [ -f /bin/cp ];then CP_CMD=/bin/cp fi +if [ -f /tmp/dev.tar.gz ];then + rm -rf /tmp/dev.tar.gz +fi + +if [ -d /tmp/mdserver-web-dev ];then + rm -rf /tmp/mdserver-web-dev +fi + echo "update mdserver-web dev code start" curl --insecure -sSLo /tmp/dev.tar.gz ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/dev.tar.gz From 4f0f440f2c807653ff2a6e88273f85f80c980675 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 20:26:06 +0800 Subject: [PATCH 52/61] update --- scripts/init.d/mw.tpl | 1 + scripts/install.sh | 1 + scripts/install_dev.sh | 1 + scripts/update.sh | 1 + scripts/update_dev.sh | 1 + 5 files changed, 5 insertions(+) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 0aa5c5fba..f7507c84b 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -338,6 +338,7 @@ mw_common_proxy(){ PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" PROXY_URL["ghproxy_link"]="https://ghproxy.link/" PROXY_URL["gitclone_com"]="https://gitclone.com/" + PROXY_URL["ghfast_top"]="https://ghfast.top/" PROXY_URL["source"]="https://" diff --git a/scripts/install.sh b/scripts/install.sh index 6a2702da8..28275d760 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -40,6 +40,7 @@ if [ "$LOCAL_ADDR" != "common" ];then PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" PROXY_URL["ghproxy_link"]="https://ghproxy.link/" PROXY_URL["gitclone_com"]="https://gitclone.com/" + PROXY_URL["ghfast_top"]="https://ghfast.top/" PROXY_URL["source"]="https://" diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 822a674a6..6344ccd49 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -45,6 +45,7 @@ if [ "$LOCAL_ADDR" != "common" ];then PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" PROXY_URL["ghproxy_link"]="https://ghproxy.link/" PROXY_URL["gitclone_com"]="https://gitclone.com/" + PROXY_URL["ghfast_top"]="https://ghfast.top/" PROXY_URL["source"]="https://" diff --git a/scripts/update.sh b/scripts/update.sh index efec043d1..a5871f0ff 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -41,6 +41,7 @@ if [ "$LOCAL_ADDR" != "common" ];then PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" PROXY_URL["ghproxy_link"]="https://ghproxy.link/" PROXY_URL["gitclone_com"]="https://gitclone.com/" + PROXY_URL["ghfast_top"]="https://ghfast.top/" PROXY_URL["source"]="https://" diff --git a/scripts/update_dev.sh b/scripts/update_dev.sh index 788a40f26..8392e487a 100755 --- a/scripts/update_dev.sh +++ b/scripts/update_dev.sh @@ -54,6 +54,7 @@ if [ "$LOCAL_ADDR" != "common" ];then PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" PROXY_URL["ghproxy_link"]="https://ghproxy.link/" PROXY_URL["gitclone_com"]="https://gitclone.com/" + PROXY_URL["ghfast_top"]="https://ghfast.top/" PROXY_URL["source"]="https://" From be0982177831d0eb5a6b4adbc74ab7e885910a11 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 20:35:33 +0800 Subject: [PATCH 53/61] Update mw.tpl --- scripts/init.d/mw.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index f7507c84b..15d4d7daa 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -350,12 +350,12 @@ mw_common_proxy(){ if [ "$LOCAL_ADDR" != "common" ];then ChooseProxyURL - if [ "$DOMAIN" != "http://" ];then + if [ "$DOMAIN" != "https://" ];then DOMAIN=`echo $HTTP_PREFIX | sed 's|https://||g'` DOMAIN=`echo $DOMAIN | sed 's|/||g'` ping -c 3 $DOMAIN > /dev/null 2>&1 if [ "$?" != "0" ];then - echo "无效代理地址:${DOMAIN}" + echo "无效代理地址${HTTP_PREFIX}" exit fi fi From d8a22ba5ee27085185b46f3686ecdb1407c8789b Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 20:36:17 +0800 Subject: [PATCH 54/61] update --- scripts/install.sh | 2 +- scripts/install_dev.sh | 2 +- scripts/update.sh | 2 +- scripts/update_dev.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 28275d760..d71a1c599 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -132,7 +132,7 @@ function ChooseProxyURL(){ if [ "$LOCAL_ADDR" != "common" ];then ChooseProxyURL - if [ "$DOMAIN" != "http://" ];then + if [ "$DOMAIN" != "https://" ];then DOMAIN=`echo $HTTP_PREFIX | sed 's|https://||g'` DOMAIN=`echo $DOMAIN | sed 's|/||g'` ping -c 3 $DOMAIN > /dev/null 2>&1 diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 6344ccd49..0240ba443 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -137,7 +137,7 @@ function ChooseProxyURL(){ if [ "$LOCAL_ADDR" != "common" ];then ChooseProxyURL - if [ "$DOMAIN" != "http://" ];then + if [ "$DOMAIN" != "https://" ];then DOMAIN=`echo $HTTP_PREFIX | sed 's|https://||g'` DOMAIN=`echo $DOMAIN | sed 's|/||g'` ping -c 3 $DOMAIN > /dev/null 2>&1 diff --git a/scripts/update.sh b/scripts/update.sh index a5871f0ff..4577f2334 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -134,7 +134,7 @@ function ChooseProxyURL(){ if [ "$LOCAL_ADDR" != "common" ];then ChooseProxyURL - if [ "$DOMAIN" != "http://" ];then + if [ "$DOMAIN" != "https://" ];then DOMAIN=`echo $HTTP_PREFIX | sed 's|https://||g'` DOMAIN=`echo $DOMAIN | sed 's|/||g'` ping -c 3 $DOMAIN > /dev/null 2>&1 diff --git a/scripts/update_dev.sh b/scripts/update_dev.sh index 8392e487a..cd83d56e3 100755 --- a/scripts/update_dev.sh +++ b/scripts/update_dev.sh @@ -147,7 +147,7 @@ function ChooseProxyURL(){ if [ "$LOCAL_ADDR" != "common" ];then ChooseProxyURL - if [ "$DOMAIN" != "http://" ];then + if [ "$DOMAIN" != "https://" ];then DOMAIN=`echo $HTTP_PREFIX | sed 's|https://||g'` DOMAIN=`echo $DOMAIN | sed 's|/||g'` ping -c 3 $DOMAIN > /dev/null 2>&1 From b2f9935abba8c17f19d5a9a4f206b58142c9a756 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 20:57:56 +0800 Subject: [PATCH 55/61] Update mw.tpl --- scripts/init.d/mw.tpl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 15d4d7daa..01dde7ed3 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -369,8 +369,8 @@ mw_install(){ fi mw_common_proxy + echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh")" bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh") - # echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh")" } mw_update() @@ -381,8 +381,8 @@ mw_update() fi mw_common_proxy + echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh")" bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh") - # echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh")" } mw_update_dev() @@ -393,8 +393,9 @@ mw_update_dev() fi mw_common_proxy + echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh")" bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh") - # echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh")" + cd ${PANEL_DIR} } @@ -405,8 +406,9 @@ mw_update_venv() rm -rf ${PANEL_DIR}/lib mw_common_proxy + echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh")" bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh") - # echo "bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh")" + cd ${PANEL_DIR} } From a226bc9fbbe4da3688cc2fe0ef401b2022a9b08b Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 21:10:20 +0800 Subject: [PATCH 56/61] update --- scripts/init.d/mw.tpl | 2 +- scripts/install.sh | 2 +- scripts/install_dev.sh | 2 +- scripts/update.sh | 2 +- scripts/update_dev.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 01dde7ed3..74f4b9774 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -336,7 +336,7 @@ mw_common_proxy(){ if [ "$LOCAL_ADDR" != "common" ];then declare -A PROXY_URL PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" - PROXY_URL["ghproxy_link"]="https://ghproxy.link/" + PROXY_URL["github_do"]="https://github.do/" PROXY_URL["gitclone_com"]="https://gitclone.com/" PROXY_URL["ghfast_top"]="https://ghfast.top/" PROXY_URL["source"]="https://" diff --git a/scripts/install.sh b/scripts/install.sh index d71a1c599..16bd3e6fc 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -38,7 +38,7 @@ fi if [ "$LOCAL_ADDR" != "common" ];then declare -A PROXY_URL PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" - PROXY_URL["ghproxy_link"]="https://ghproxy.link/" + PROXY_URL["github_do"]="https://github.do/" PROXY_URL["gitclone_com"]="https://gitclone.com/" PROXY_URL["ghfast_top"]="https://ghfast.top/" PROXY_URL["source"]="https://" diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 0240ba443..59d0c4275 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -43,7 +43,7 @@ fi if [ "$LOCAL_ADDR" != "common" ];then declare -A PROXY_URL PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" - PROXY_URL["ghproxy_link"]="https://ghproxy.link/" + PROXY_URL["github_do"]="https://github.do/" PROXY_URL["gitclone_com"]="https://gitclone.com/" PROXY_URL["ghfast_top"]="https://ghfast.top/" PROXY_URL["source"]="https://" diff --git a/scripts/update.sh b/scripts/update.sh index 4577f2334..a7eb2bad7 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -39,7 +39,7 @@ fi if [ "$LOCAL_ADDR" != "common" ];then declare -A PROXY_URL PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" - PROXY_URL["ghproxy_link"]="https://ghproxy.link/" + PROXY_URL["github_do"]="https://github.do/" PROXY_URL["gitclone_com"]="https://gitclone.com/" PROXY_URL["ghfast_top"]="https://ghfast.top/" PROXY_URL["source"]="https://" diff --git a/scripts/update_dev.sh b/scripts/update_dev.sh index cd83d56e3..73b942013 100755 --- a/scripts/update_dev.sh +++ b/scripts/update_dev.sh @@ -52,7 +52,7 @@ fi if [ "$LOCAL_ADDR" != "common" ];then declare -A PROXY_URL PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" - PROXY_URL["ghproxy_link"]="https://ghproxy.link/" + PROXY_URL["github_do"]="https://github.do/" PROXY_URL["gitclone_com"]="https://gitclone.com/" PROXY_URL["ghfast_top"]="https://ghfast.top/" PROXY_URL["source"]="https://" From 42f845a7e2490770dc7020b011684f07e15f1996 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 21:21:17 +0800 Subject: [PATCH 57/61] Update mw.tpl --- scripts/init.d/mw.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 74f4b9774..e08a6f0f9 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -338,6 +338,7 @@ mw_common_proxy(){ PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" PROXY_URL["github_do"]="https://github.do/" PROXY_URL["gitclone_com"]="https://gitclone.com/" + PROXY_URL["gh_llkk_cc"]="https://gh.llkk.cc/https://" PROXY_URL["ghfast_top"]="https://ghfast.top/" PROXY_URL["source"]="https://" From 89e665b369d5ae2a0a0b61c8938009b56f3edd5f Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 21:22:43 +0800 Subject: [PATCH 58/61] Update mw.tpl --- scripts/init.d/mw.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index e08a6f0f9..ddc7eff87 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -337,8 +337,8 @@ mw_common_proxy(){ declare -A PROXY_URL PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" PROXY_URL["github_do"]="https://github.do/" - PROXY_URL["gitclone_com"]="https://gitclone.com/" PROXY_URL["gh_llkk_cc"]="https://gh.llkk.cc/https://" + PROXY_URL["gh_felicity_ac_cn"]="https://gh.felicity.ac.cn/https://" PROXY_URL["ghfast_top"]="https://ghfast.top/" PROXY_URL["source"]="https://" From df442f7fff822ae25847f901474b2ba40786d77c Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 21:24:45 +0800 Subject: [PATCH 59/61] update --- scripts/install.sh | 9 +-- scripts/install_dev.sh | 9 +-- scripts/update.sh | 173 +++++++++++++++++++++++++------------------------ 3 files changed, 97 insertions(+), 94 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 16bd3e6fc..d0c154c7a 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -38,10 +38,11 @@ fi if [ "$LOCAL_ADDR" != "common" ];then declare -A PROXY_URL PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" - PROXY_URL["github_do"]="https://github.do/" - PROXY_URL["gitclone_com"]="https://gitclone.com/" - PROXY_URL["ghfast_top"]="https://ghfast.top/" - PROXY_URL["source"]="https://" + PROXY_URL["github_do"]="https://github.do/" + PROXY_URL["gh_llkk_cc"]="https://gh.llkk.cc/https://" + PROXY_URL["gh_felicity_ac_cn"]="https://gh.felicity.ac.cn/https://" + PROXY_URL["ghfast_top"]="https://ghfast.top/" + PROXY_URL["source"]="https://" SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 59d0c4275..780c38030 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -43,10 +43,11 @@ fi if [ "$LOCAL_ADDR" != "common" ];then declare -A PROXY_URL PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" - PROXY_URL["github_do"]="https://github.do/" - PROXY_URL["gitclone_com"]="https://gitclone.com/" - PROXY_URL["ghfast_top"]="https://ghfast.top/" - PROXY_URL["source"]="https://" + PROXY_URL["github_do"]="https://github.do/" + PROXY_URL["gh_llkk_cc"]="https://gh.llkk.cc/https://" + PROXY_URL["gh_felicity_ac_cn"]="https://gh.felicity.ac.cn/https://" + PROXY_URL["ghfast_top"]="https://ghfast.top/" + PROXY_URL["source"]="https://" SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) diff --git a/scripts/update.sh b/scripts/update.sh index a7eb2bad7..8009fd642 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -7,10 +7,10 @@ is64bit=`getconf LONG_BIT` startTime=`date +%s` if [ -f /www/server/mdserver-web/tools.py ];then - echo -e "存在旧版代码,不能安装!,已知风险的情况下" - echo -e "rm -rf /www/server/mdserver-web" - echo -e "可安装!" - exit 0 + echo -e "存在旧版代码,不能安装!,已知风险的情况下" + echo -e "rm -rf /www/server/mdserver-web" + echo -e "可安装!" + exit 0 fi @@ -23,7 +23,7 @@ if [ "$EUID" -ne 0 ] fi if [ ${_os} != "Darwin" ] && [ ! -d /www/server/mdserver-web/logs ]; then - mkdir -p /www/server/mdserver-web/logs + mkdir -p /www/server/mdserver-web/logs fi LOG_FILE=/var/log/mw-update.log @@ -33,43 +33,44 @@ HTTP_PREFIX="https://" LOCAL_ADDR=common cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then - LOCAL_ADDR=cn + LOCAL_ADDR=cn fi if [ "$LOCAL_ADDR" != "common" ];then - declare -A PROXY_URL - PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" - PROXY_URL["github_do"]="https://github.do/" - PROXY_URL["gitclone_com"]="https://gitclone.com/" - PROXY_URL["ghfast_top"]="https://ghfast.top/" - PROXY_URL["source"]="https://" + declare -A PROXY_URL + PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" + PROXY_URL["github_do"]="https://github.do/" + PROXY_URL["gh_llkk_cc"]="https://gh.llkk.cc/https://" + PROXY_URL["gh_felicity_ac_cn"]="https://gh.felicity.ac.cn/https://" + PROXY_URL["ghfast_top"]="https://ghfast.top/" + PROXY_URL["source"]="https://" - SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) - SOURCE_LIST_KEY=(${SOURCE_LIST_KEY_SORT_TMP//'\n'/}) - SOURCE_LIST_LEN=${#PROXY_URL[*]} + SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) + SOURCE_LIST_KEY=(${SOURCE_LIST_KEY_SORT_TMP//'\n'/}) + SOURCE_LIST_LEN=${#PROXY_URL[*]} fi function AutoSizeStr(){ - NAME_STR=$1 - NAME_NUM=$2 + NAME_STR=$1 + NAME_NUM=$2 - NAME_STR_LEN=`echo "$NAME_STR" | wc -L` - NAME_NUM_LEN=`echo "$NAME_NUM" | wc -L` + NAME_STR_LEN=`echo "$NAME_STR" | wc -L` + NAME_NUM_LEN=`echo "$NAME_NUM" | wc -L` - fix_len=35 - remaining_len=`expr $fix_len - $NAME_STR_LEN - $NAME_NUM_LEN` - FIX_SPACE=' ' - for ((ass_i=1;ass_i<=$remaining_len;ass_i++)) - do - FIX_SPACE="$FIX_SPACE " - done - echo -e " ❖ ${1}${FIX_SPACE}${2})" + fix_len=35 + remaining_len=`expr $fix_len - $NAME_STR_LEN - $NAME_NUM_LEN` + FIX_SPACE=' ' + for ((ass_i=1;ass_i<=$remaining_len;ass_i++)) + do + FIX_SPACE="$FIX_SPACE " + done + echo -e " ❖ ${1}${FIX_SPACE}${2})" } function ChooseProxyURL(){ - clear + clear echo -e '+---------------------------------------------------+' echo -e '| |' echo -e '| ============================================= |' @@ -89,9 +90,9 @@ function ChooseProxyURL(){ cm_i=0 for V in ${SOURCE_LIST_KEY[@]}; do num=`expr $cm_i + 1` - AutoSizeStr "${V}" "$num" - cm_i=`expr $cm_i + 1` - done + AutoSizeStr "${V}" "$num" + cm_i=`expr $cm_i + 1` + done echo -e '' echo -e '#####################################################' echo -e '' @@ -110,20 +111,20 @@ function ChooseProxyURL(){ fi if [ "$INPUT" -lt "0" ];then - INPUT=1 - TMP_INPUT=`expr $INPUT - 1` - INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} - echo -e "\n低于边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" - sleep 2s - fi + INPUT=1 + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n低于边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + sleep 2s + fi - if [ "$INPUT" -gt "${SOURCE_LIST_LEN}" ];then - INPUT=${SOURCE_LIST_LEN} - TMP_INPUT=`expr $INPUT - 1` - INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} - echo -e "\n超出边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" - sleep 2s - fi + if [ "$INPUT" -gt "${SOURCE_LIST_LEN}" ];then + INPUT=${SOURCE_LIST_LEN} + TMP_INPUT=`expr $INPUT - 1` + INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]} + echo -e "\n超出边界错误!选择[${BLUE}${INPUT_KEY}${PLAIN}]安装!" + sleep 2s + fi INPUT=`expr $INPUT - 1` INPUT_KEY=${SOURCE_LIST_KEY[$INPUT]} @@ -132,68 +133,68 @@ function ChooseProxyURL(){ if [ "$LOCAL_ADDR" != "common" ];then - ChooseProxyURL + ChooseProxyURL - if [ "$DOMAIN" != "https://" ];then - DOMAIN=`echo $HTTP_PREFIX | sed 's|https://||g'` - DOMAIN=`echo $DOMAIN | sed 's|/||g'` - ping -c 3 $DOMAIN > /dev/null 2>&1 - if [ "$?" != "0" ];then - echo "无效代理地址:${DOMAIN}" - exit - fi - fi + if [ "$DOMAIN" != "https://" ];then + DOMAIN=`echo $HTTP_PREFIX | sed 's|https://||g'` + DOMAIN=`echo $DOMAIN | sed 's|/||g'` + ping -c 3 $DOMAIN > /dev/null 2>&1 + if [ "$?" != "0" ];then + echo "无效代理地址:${DOMAIN}" + exit + fi + fi fi if [ ${_os} == "Darwin" ]; then - OSNAME='macos' + OSNAME='macos' elif grep -Eqi "openSUSE" /etc/*-release; then - OSNAME='opensuse' - zypper refresh + OSNAME='opensuse' + zypper refresh elif grep -Eqi "EulerOS" /etc/*-release || grep -Eqi "openEuler" /etc/*-release; then - OSNAME='euler' + OSNAME='euler' elif grep -Eqi "FreeBSD" /etc/*-release; then - OSNAME='freebsd' + OSNAME='freebsd' elif grep -Eqi "CentOS" /etc/issue || grep -Eqi "CentOS" /etc/*-release; then - OSNAME='rhel' - yum install -y wget zip unzip + OSNAME='rhel' + yum install -y wget zip unzip elif grep -Eqi "Fedora" /etc/issue || grep -Eqi "Fedora" /etc/*-release; then - OSNAME='rhel' - yum install -y wget zip unzip + OSNAME='rhel' + yum install -y wget zip unzip elif grep -Eqi "Rocky" /etc/issue || grep -Eqi "Rocky" /etc/*-release; then - OSNAME='rhel' - yum install -y wget zip unzip + OSNAME='rhel' + yum install -y wget zip unzip elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eqi "AlmaLinux" /etc/*-release; then - OSNAME='rhel' - yum install -y wget zip unzip + OSNAME='rhel' + yum install -y wget zip unzip elif grep -Eqi "Anolis" /etc/issue || grep -Eqi "Anolis" /etc/*-release; then - OSNAME='rhel' - yum install -y wget curl zip unzip tar crontabs + OSNAME='rhel' + yum install -y wget curl zip unzip tar crontabs elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eqi "Amazon Linux" /etc/*-release; then - OSNAME='amazon' - yum install -y wget zip unzip + OSNAME='amazon' + yum install -y wget zip unzip elif grep -Eqi "Debian" /etc/issue || grep -Eqi "Debian" /etc/*-release; then - OSNAME='debian' - apt install -y wget zip unzip + OSNAME='debian' + apt install -y wget zip unzip elif grep -Eqi "Ubuntu" /etc/issue || grep -Eqi "Ubuntu" /etc/*-release; then - OSNAME='ubuntu' - apt install -y wget zip unzip + OSNAME='ubuntu' + apt install -y wget zip unzip elif grep -Eqi "Raspbian" /etc/issue || grep -Eqi "Raspbian" /etc/*-release; then - OSNAME='raspbian' + OSNAME='raspbian' elif grep -Eqi "Alpine" /etc/issue || grep -Eqi "Alpine" /etc/*-release; then - OSNAME='alpine' - apk update - apk add devscripts -force-broken-world - apk add wget zip unzip tar -force-broken-world + OSNAME='alpine' + apk update + apk add devscripts -force-broken-world + apk add wget zip unzip tar -force-broken-world else - OSNAME='unknow' + OSNAME='unknow' fi echo "LOCAL:${LOCAL_ADDR}" CP_CMD=/usr/bin/cp if [ -f /bin/cp ];then - CP_CMD=/bin/cp + CP_CMD=/bin/cp fi echo "update mdserver-web code start" @@ -215,13 +216,13 @@ bash /etc/rc.d/init.d/mw restart bash /etc/rc.d/init.d/mw default if [ -f /usr/bin/mw ];then - rm -rf /usr/bin/mw + rm -rf /usr/bin/mw fi if [ ! -e /usr/bin/mw ]; then - if [ ! -f /usr/bin/mw ];then - ln -s /etc/rc.d/init.d/mw /usr/bin/mw - fi + if [ ! -f /usr/bin/mw ];then + ln -s /etc/rc.d/init.d/mw /usr/bin/mw + fi fi endTime=`date +%s` From 5575710d7eeab67373a2c3fe17c35a22cf0d1b78 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 21:25:31 +0800 Subject: [PATCH 60/61] Update update_dev.sh --- scripts/update_dev.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/update_dev.sh b/scripts/update_dev.sh index 73b942013..63e92a00b 100755 --- a/scripts/update_dev.sh +++ b/scripts/update_dev.sh @@ -52,10 +52,11 @@ fi if [ "$LOCAL_ADDR" != "common" ];then declare -A PROXY_URL PROXY_URL["gh_proxy_com"]="https://gh-proxy.com/" - PROXY_URL["github_do"]="https://github.do/" - PROXY_URL["gitclone_com"]="https://gitclone.com/" - PROXY_URL["ghfast_top"]="https://ghfast.top/" - PROXY_URL["source"]="https://" + PROXY_URL["github_do"]="https://github.do/" + PROXY_URL["gh_llkk_cc"]="https://gh.llkk.cc/https://" + PROXY_URL["gh_felicity_ac_cn"]="https://gh.felicity.ac.cn/https://" + PROXY_URL["ghfast_top"]="https://ghfast.top/" + PROXY_URL["source"]="https://" SOURCE_LIST_KEY_SORT_TMP=$(echo ${!PROXY_URL[@]} | tr ' ' '\n' | sort -n) From 85bedbf56bf255e6dd82468c6bbed250d87af8d1 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 18 Aug 2025 21:48:27 +0800 Subject: [PATCH 61/61] update --- scripts/init.d/mw.tpl | 1 + scripts/install.sh | 1 + scripts/install_dev.sh | 1 + scripts/update.sh | 1 + scripts/update_dev.sh | 1 + 5 files changed, 5 insertions(+) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index ddc7eff87..cfffdbe4d 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -340,6 +340,7 @@ mw_common_proxy(){ PROXY_URL["gh_llkk_cc"]="https://gh.llkk.cc/https://" PROXY_URL["gh_felicity_ac_cn"]="https://gh.felicity.ac.cn/https://" PROXY_URL["ghfast_top"]="https://ghfast.top/" + PROXY_URL["ghproxy_net"]="https://ghproxy.net/" PROXY_URL["source"]="https://" diff --git a/scripts/install.sh b/scripts/install.sh index d0c154c7a..5ec8eab2c 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -42,6 +42,7 @@ if [ "$LOCAL_ADDR" != "common" ];then PROXY_URL["gh_llkk_cc"]="https://gh.llkk.cc/https://" PROXY_URL["gh_felicity_ac_cn"]="https://gh.felicity.ac.cn/https://" PROXY_URL["ghfast_top"]="https://ghfast.top/" + PROXY_URL["ghproxy_net"]="https://ghproxy.net/" PROXY_URL["source"]="https://" diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 780c38030..e548f6339 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -47,6 +47,7 @@ if [ "$LOCAL_ADDR" != "common" ];then PROXY_URL["gh_llkk_cc"]="https://gh.llkk.cc/https://" PROXY_URL["gh_felicity_ac_cn"]="https://gh.felicity.ac.cn/https://" PROXY_URL["ghfast_top"]="https://ghfast.top/" + PROXY_URL["ghproxy_net"]="https://ghproxy.net/" PROXY_URL["source"]="https://" diff --git a/scripts/update.sh b/scripts/update.sh index 8009fd642..ba26e4d97 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -43,6 +43,7 @@ if [ "$LOCAL_ADDR" != "common" ];then PROXY_URL["gh_llkk_cc"]="https://gh.llkk.cc/https://" PROXY_URL["gh_felicity_ac_cn"]="https://gh.felicity.ac.cn/https://" PROXY_URL["ghfast_top"]="https://ghfast.top/" + PROXY_URL["ghproxy_net"]="https://ghproxy.net/" PROXY_URL["source"]="https://" diff --git a/scripts/update_dev.sh b/scripts/update_dev.sh index 63e92a00b..6ef4d5bb4 100755 --- a/scripts/update_dev.sh +++ b/scripts/update_dev.sh @@ -56,6 +56,7 @@ if [ "$LOCAL_ADDR" != "common" ];then PROXY_URL["gh_llkk_cc"]="https://gh.llkk.cc/https://" PROXY_URL["gh_felicity_ac_cn"]="https://gh.felicity.ac.cn/https://" PROXY_URL["ghfast_top"]="https://ghfast.top/" + PROXY_URL["ghproxy_net"]="https://ghproxy.net/" PROXY_URL["source"]="https://"