diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl
index aa1307f5c..9bb5b69b8 100755
--- a/scripts/init.d/mw.tpl
+++ b/scripts/init.d/mw.tpl
@@ -375,8 +375,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/AndyXeCM/PowerLinux/main/scripts/install.sh")"
+ bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/AndyXeCM/PowerLinux/main/scripts/install.sh")
}
mw_update()
@@ -387,8 +387,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/AndyXeCM/PowerLinux/main/scripts/update.sh")"
+ bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/AndyXeCM/PowerLinux/main/scripts/update.sh")
}
mw_update_dev()
@@ -399,8 +399,8 @@ 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/AndyXeCM/PowerLinux/main/scripts/update_dev.sh")"
+ bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/AndyXeCM/PowerLinux/main/scripts/update_dev.sh")
cd ${PANEL_DIR}
}
@@ -412,8 +412,8 @@ 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/AndyXeCM/PowerLinux/main/scripts/update_dev.sh")"
+ bash <(curl -fsSL "${HTTP_PREFIX}raw.githubusercontent.com/AndyXeCM/PowerLinux/main/scripts/update_dev.sh")
cd ${PANEL_DIR}
}
diff --git a/scripts/install.sh b/scripts/install.sh
index 0561aff95..40ac13d75 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -15,7 +15,7 @@ ERROR='[\033[31mERROR\033[0m]'
WORKING='[\033[34m*\033[0m]'
REPO_OWNER="AndyXeCM"
REPO_NAME="PowerLinux"
-REPO_BRANCH="master"
+REPO_BRANCH="main"
# LANG=en_US.UTF-8
@@ -152,7 +152,7 @@ if [ "$LOCAL_ADDR" != "common" ];then
fi
if [ -f /etc/motd ];then
- echo "welcome to mdserver-web panel" > /etc/motd
+ echo "welcome to PowerLinux panel" > /etc/motd
fi
startTime=`date +%s`
diff --git a/scripts/install/macos.sh b/scripts/install/macos.sh
index 42a5c3983..51158206c 100755
--- a/scripts/install/macos.sh
+++ b/scripts/install/macos.sh
@@ -5,6 +5,9 @@ LANG=en_US.UTF-8
USER=$(who | sed -n "2,1p" |awk '{print $1}')
DEV="/Users/${USER}/Desktop/mwdev"
+REPO_OWNER="AndyXeCM"
+REPO_NAME="PowerLinux"
+REPO_BRANCH="main"
mkdir -p $DEV
@@ -31,11 +34,12 @@ brew install pcre2 libxpm libelf
brew install automake icu4c libmemcached
if [ ! -d $DEV/server/mdserver-web ]; then
- wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master
+ wget -O /tmp/master.zip https://codeload.github.com/${REPO_OWNER}/${REPO_NAME}/zip/${REPO_BRANCH}
+ TARBALL_DIR=$(unzip -Z1 /tmp/master.zip | head -1 | cut -d/ -f1)
cd /tmp && unzip /tmp/master.zip
- mv /tmp/mdserver-web-master $DEV/server/mdserver-web
+ mv /tmp/${TARBALL_DIR} $DEV/server/mdserver-web
rm -f /tmp/master.zip
- rm -rf /tmp/mdserver-web-master
+ rm -rf /tmp/${TARBALL_DIR}
fi
if [ ! -d $DEV/server/lib ]; then
@@ -57,4 +61,4 @@ cd $DEV/server/mdserver-web && ./cli.sh stop
sleep 5
cd $DEV/server/mdserver-web && ./scripts/init.d/mw default
-cd $DEV/server/mdserver-web && ./cli.sh debug
\ No newline at end of file
+cd $DEV/server/mdserver-web && ./cli.sh debug
diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh
index 97e16a742..e15bdd082 100755
--- a/scripts/install_dev.sh
+++ b/scripts/install_dev.sh
@@ -16,6 +16,9 @@ WORKING='[\033[34m*\033[0m]'
# LANG=en_US.UTF-8
is64bit=`getconf LONG_BIT`
+REPO_OWNER="AndyXeCM"
+REPO_NAME="PowerLinux"
+REPO_BRANCH="main"
if [ -f /www/server/mdserver-web/tools.py ];then
@@ -25,8 +28,8 @@ if [ -f /www/server/mdserver-web/tools.py ];then
exit 0
fi
-echo -e "您正在安装的是\033[31mmdserver-web测试版\033[0m,非开发测试用途请使用正式版 install.sh !"
-echo -e "You are installing\033[31m mdserver-web dev version\033[0m, normally use install.sh for production.\n"
+echo -e "您正在安装的是\033[31mPowerLinux测试版\033[0m,非开发测试用途请使用正式版 install.sh !"
+echo -e "You are installing\033[31m PowerLinux dev version\033[0m, normally use install.sh for production.\n"
sleep 1
LOG_FILE=/var/log/mw-install.log
@@ -153,7 +156,7 @@ if [ "$LOCAL_ADDR" != "common" ];then
fi
if [ -f /etc/motd ];then
- echo "welcome to mdserver-web panel" > /etc/motd
+ echo "welcome to PowerLinux panel" > /etc/motd
fi
startTime=`date +%s`
@@ -234,12 +237,13 @@ 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.tar.gz"
- curl --insecure -sSLo /tmp/dev.tar.gz ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/dev.tar.gz
+ echo "downloading ${HTTP_PREFIX}github.com/${REPO_OWNER}/${REPO_NAME}/archive/refs/heads/${REPO_BRANCH}.tar.gz"
+ curl --insecure -sSLo /tmp/dev.tar.gz ${HTTP_PREFIX}github.com/${REPO_OWNER}/${REPO_NAME}/archive/refs/heads/${REPO_BRANCH}.tar.gz
+ TARBALL_DIR=$(tar -tf /tmp/dev.tar.gz | head -1 | cut -d/ -f1)
cd /tmp && tar -zxvf /tmp/dev.tar.gz
- mv -f /tmp/mdserver-web-dev /www/server/mdserver-web
+ mv -f /tmp/${TARBALL_DIR} /www/server/mdserver-web
rm -rf /tmp/dev.tar.gz
- rm -rf /tmp/mdserver-web-dev
+ rm -rf /tmp/${TARBALL_DIR}
fi
# install acme.sh
@@ -258,7 +262,7 @@ fi
echo "use system version: ${OSNAME}"
if [ "${OSNAME}" == "macos" ];then
- curl --insecure -fsSL ${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/refs/heads/dev/scripts/install/macos.sh | bash
+ curl --insecure -fsSL ${HTTP_PREFIX}raw.githubusercontent.com/${REPO_OWNER}/${REPO_NAME}/main/scripts/install/macos.sh | bash
else
cd /www/server/mdserver-web && bash scripts/install/${OSNAME}.sh
fi
@@ -300,4 +304,4 @@ echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
} 1> >(tee $LOG_FILE) 2>&1
echo -e "\nInstall completed. If error occurs, please contact us with the log file mw-install.log ."
-echo "安装完毕,如果出现错误,请带上同目录下的安装日志 mw-install.log 联系我们反馈."
\ No newline at end of file
+echo "安装完毕,如果出现错误,请带上同目录下的安装日志 mw-install.log 联系我们反馈."
diff --git a/scripts/update.sh b/scripts/update.sh
index 501b935d4..d254c03db 100755
--- a/scripts/update.sh
+++ b/scripts/update.sh
@@ -5,7 +5,7 @@ export PATH
is64bit=`getconf LONG_BIT`
REPO_OWNER="AndyXeCM"
REPO_NAME="PowerLinux"
-REPO_BRANCH="master"
+REPO_BRANCH="main"
startTime=`date +%s`
diff --git a/scripts/update_dev.sh b/scripts/update_dev.sh
index 7fc281e8f..606d4de12 100755
--- a/scripts/update_dev.sh
+++ b/scripts/update_dev.sh
@@ -16,6 +16,9 @@ WORKING='[\033[34m*\033[0m]'
# LANG=en_US.UTF-8
is64bit=`getconf LONG_BIT`
+REPO_OWNER="AndyXeCM"
+REPO_NAME="PowerLinux"
+REPO_BRANCH="main"
startTime=`date +%s`
@@ -214,19 +217,16 @@ 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"
+echo "update PowerLinux dev code start"
-curl --insecure -sSLo /tmp/dev.tar.gz ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/dev.tar.gz
+curl --insecure -sSLo /tmp/dev.tar.gz ${HTTP_PREFIX}github.com/${REPO_OWNER}/${REPO_NAME}/archive/refs/heads/${REPO_BRANCH}.tar.gz
+TARBALL_DIR=$(tar -tf /tmp/dev.tar.gz | head -1 | cut -d/ -f1)
cd /tmp && tar -zxvf /tmp/dev.tar.gz
-$CP_CMD -rf /tmp/mdserver-web-dev/* /www/server/mdserver-web
+$CP_CMD -rf /tmp/${TARBALL_DIR}/* /www/server/mdserver-web
rm -rf /tmp/dev.tar.gz
-rm -rf /tmp/mdserver-web-dev
+rm -rf /tmp/${TARBALL_DIR}
-echo "update mdserver-web dev code end"
+echo "update PowerLinux dev code end"
#pip uninstall public
@@ -250,4 +250,4 @@ endTime=`date +%s`
((outTime=($endTime-$startTime)/60))
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
-} 1> >(tee $LOG_FILE) 2>&1
\ No newline at end of file
+} 1> >(tee $LOG_FILE) 2>&1
diff --git a/web/utils/system/update.py b/web/utils/system/update.py
index 54a78c35f..24be75850 100644
--- a/web/utils/system/update.py
+++ b/web/utils/system/update.py
@@ -15,15 +15,97 @@
import math
import psutil
import json
+import html
import core.mw as mw
+PANEL_REPO_OWNER = 'AndyXeCM'
+PANEL_REPO_NAME = 'PowerLinux'
+PANEL_RELEASE_API = 'https://api.github.com/repos/%s/%s/releases/latest' % (PANEL_REPO_OWNER, PANEL_REPO_NAME)
+PANEL_RELEASE_PAGE = 'https://github.com/%s/%s/releases/latest' % (PANEL_REPO_OWNER, PANEL_REPO_NAME)
+
+
+def _normalize_version_name(version):
+ version = str(version or '').strip()
+ if version.startswith('v') and len(version) > 1 and version[1].isdigit():
+ version = version[1:]
+ return version
+
+
+def _strip_html_tags(content):
+ content = re.sub(r'(?i)
', '\n', content)
+ content = re.sub(r'(?i)