diff --git a/app/script/convert.sh b/app/script/convert.sh
index 7ecc5c3..0014351 100644
--- a/app/script/convert.sh
+++ b/app/script/convert.sh
@@ -3,7 +3,7 @@
Linux_Version="11.0.0"
Windows_Version="8.2.2"
Aapanel_Version="7.0.21"
-Btm_Version="2.3.0"
+Btm_Version="2.3.1"
FILES=(
public/install/src/panel6.zip
diff --git a/app/view/admin/layout.html b/app/view/admin/layout.html
index a361c12..0fade2b 100644
--- a/app/view/admin/layout.html
+++ b/app/view/admin/layout.html
@@ -27,7 +27,7 @@
- 宝塔第三方云端管理中心
+ 宝塔第三方云端管理中心
diff --git a/public/install/install_btmonitor.sh b/public/install/install_btmonitor.sh
index 05c9eb0..af197f1 100644
--- a/public/install/install_btmonitor.sh
+++ b/public/install/install_btmonitor.sh
@@ -411,9 +411,9 @@ EOF
chmod +x $monitor_path/tools.py
wget -O /etc/init.d/btm ${download_Url}/init/btmonitor.init -t 5 -T 10
tmp_size=$(du -b "/etc/init.d/btm"|awk '{print $1}')
- if [ ${tmp_size} == 0 ]; then
+ if [ ${tmp_size} == 0 ]; then
\cp -r $monitor_path/init.sh /etc/init.d/btm
- fi
+ fi
if [ ! -f "/etc/init.d/btm" ];then
\cp -r $monitor_path/init.sh /etc/init.d/btm
fi
@@ -450,6 +450,7 @@ Start_Monitor(){
for ((i=1; i<=5; i++));do
if [ -z "$password" ]; then
sleep 7
+ rm -f /tmp/bt_monitor.lock
user_pass=`$monitor_path/tools.py create_admin`
password=`echo $user_pass |awk -F " " '{print $5}'`
else
@@ -692,7 +693,7 @@ Get_Pack_Manager(){
}
Install_RPM_Pack(){
- yumPacks="wget curl unzip gcc gcc-c++ make libcurl-devel openssl-devel xz-devel python-backports-lzma xz crontabs zlib zlib-devel sqlite-devel libffi-devel bzip2-devel lsof net-tools"
+ yumPacks="wget curl unzip gcc gcc-c++ make libcurl-devel openssl-devel xz-devel python-backports-lzma xz crontabs zlib zlib-devel sqlite-devel libffi-devel bzip2-devel lsof net-tools p7zip-full"
yum install -y ${yumPacks}
for yumPack in ${yumPacks}
@@ -706,7 +707,7 @@ Install_RPM_Pack(){
}
Install_Deb_Pack(){
- debPacks="wget curl unzip gcc g++ make cron libcurl4-openssl-dev libssl-dev liblzma-dev xz-utils libffi-dev libbz2-dev libsqlite3-dev libreadline-dev libgdbm-dev python3-bsddb3 tk-dev ncurses-dev uuid-dev zlib1g zlib1g-dev lsof net-tools";
+ debPacks="wget curl unzip gcc g++ make cron libcurl4-openssl-dev libssl-dev liblzma-dev xz-utils libffi-dev libbz2-dev libsqlite3-dev libreadline-dev libgdbm-dev python3-bsddb3 tk-dev ncurses-dev uuid-dev zlib1g zlib1g-dev lsof net-tools p7zip-full sqlite3";
apt-get update -y
apt-get install -y $debPacks --force-yes
@@ -724,64 +725,77 @@ Check_Sys_Write(){
if [ ! -d "/etc/init.d" ];then
mkdir -p /etc/init.d
fi
- if [ -f /usr/bin/which ];then
- Get_Pack_Manager
- if [ "$PM" == "yum" ]; then
- read_dir="/usr/lib/systemd/system/ /etc/init.d/ /var/spool/cron/"
- else
- read_dir="/usr/lib/systemd/system/ /etc/init.d/ /var/spool/cron/crontabs/"
- fi
-
- for dir in ${read_dir[@]}
- do
- if [[ -d "$dir" ]]; then
- touch $dir/btm_install_test_111.pl
- state=$(echo $?)
- if [[ "$state" != "0" ]];then
- echo -e "\033[31m错误:检测到系统关键目录不可写! $read_dir \033[0m"
- echo "1、如果安装了[宝塔系统加固],请先临时关闭"
- echo "2、如果安装了云锁,请临时关闭[系统加固]功能"
- echo "3、如果安装了安全狗,请临时关闭[系统防护]功能"
- echo "4、如果使用了其它安全软件,请先卸载 "
- echo -e "5、如果使用了禁止写入命令,请执行命令取消禁止写入:\n chattr -iaR $read_dir "
- echo ""
- echo -e "\033[31m解决以上问题后,请尝试重新安装! \033[0m"
- echo -e "如果无法解决请截图以上报错信息发帖至论坛www.bt.cn/bbs求助"
- exit 1
- else
- rm -f $dir/btm_install_test_111.pl
+
+ Get_Pack_Manager
+ if [ "$PM" == "yum" ]; then
+ read_dir="/usr/lib/systemd/system/ /etc/init.d/ /var/spool/cron/"
+ else
+ read_dir="/usr/lib/systemd/system/ /etc/init.d/ /var/spool/cron/crontabs/"
+ fi
+
+ touch /tmp/btm_install_test_111.pl
+ for dir in ${read_dir[@]}
+ do
+ if [[ -d "$dir" ]]; then
+ #touch $dir/btm_install_test_111.pl
+ if [[ ! -f "/tmp/btm_install_test_111.pl" ]]; then
+ echo "建立测试 /tmp/btm_install_test_111.pl 文件失败"
+ state=0
+ else
+ \cp /tmp/btm_install_test_111.pl $dir/btm_install_test_111.pl
+ fi
+ state=$(echo $?)
+ if [[ "$state" != "0" ]];then
+ echo -e "\033[31m错误:检测到系统关键目录不可写! $read_dir \033[0m"
+ echo "1、如果安装了[宝塔系统加固],请先临时关闭"
+ echo "2、如果安装了云锁,请临时关闭[系统加固、文件防护]功能"
+ echo "3、如果安装了安全狗,请临时关闭[系统防护]功能"
+ echo "4、如果使用了其它安全软件,请先卸载 "
+ echo -e "5、如果使用了禁止写入命令,请执行命令取消禁止写入:\n chattr -iaR $read_dir "
+
+ if [ $(whoami) != "root" ];then
+ echo -e "6、检测到非root用户安装,请尝试以下解决方案:\n 1.请切换到root用户安装 \n 2.尝试执行以下安装命令:\n sudo bash $0 $@"
fi
+
+ echo ""
+ echo -e "\033[31m解决以上问题后,请尝试重新安装! \033[0m"
+ echo -e "如果无法解决请截图以上报错信息发帖至论坛www.bt.cn/bbs求助"
+ exit 1
+ else
+ rm -f $dir/btm_install_test_111.pl
fi
- done
- fi
+ fi
+ done
}
Check_Sys_Packs(){
echo "正在检查系统中是否存在必备的依赖包"
Packs="wget curl unzip gcc make"
- for pack in ${Packs[@]}
- do
- check_pack=$(which $pack)
- #echo $check_pack
- if [[ "$check_pack" == "" ]]; then
- echo -e "\033[31mERROR: $pack 命令不存在,尝试以下解决方法:\033[0m"
- if [ "$PM" == "yum" ]; then
- echo 1、使用命令重新安装依赖包:yum reinstall -y ${Packs}
- else
- echo 1、使用命令重新安装依赖包:apt-get reinstall -y ${Packs}
+ if [ -f /usr/bin/which ];then
+ for pack in ${Packs[@]}
+ do
+ check_pack=$(which $pack)
+ #echo $check_pack
+ if [[ "$check_pack" == "" ]]; then
+ echo -e "\033[31mERROR: $pack 命令不存在,尝试以下解决方法:\033[0m"
+ if [ "$PM" == "yum" ]; then
+ echo 1、使用命令重新安装依赖包:yum reinstall -y ${Packs}
+ else
+ echo 1、使用命令重新安装依赖包:apt-get reinstall -y ${Packs}
+ fi
+ echo -e "2、检查系统源是否可用?尝试更换可用的源参考教程:\n https://www.bt.cn/bbs/thread-58005-1-1.html "
+ echo ""
+ echo -e "\033[31m解决以上问题后,请尝试重新安装! \033[0m"
+ echo -e "如果无法解决请截图以上报错信息发帖至论坛www.bt.cn/bbs求助"
+ exit 1
fi
- echo -e "2、检查系统源是否可用?尝试更换可用的源参考教程:\n https://www.bt.cn/bbs/thread-58005-1-1.html "
- echo ""
- echo -e "\033[31m解决以上问题后,请尝试重新安装! \033[0m"
- echo -e "如果无法解决请截图以上报错信息发帖至论坛www.bt.cn/bbs求助"
- exit 1
- fi
- done
+ done
+ fi
}
Install_Main(){
startTime=`date +%s`
- Check_Sys_Write
+ Check_Sys_Write "$@"
System_Check
Get_Pack_Manager
get_node_url
@@ -870,7 +884,7 @@ done
if [ "$go" == 'n' ];then
exit;
fi
- Install_Main
+ Install_Main "$@"
#curl -o /dev/null -fsSL --connect-time 10 "https://api.bt.cn/bt_monitor/setup_count?cloud_type=1&token=$md5_pl&src_code=$1"
#curl -o /dev/null -fsSL --connect-time 10 "https://api.bt.cn/bt_monitor/setup_count?cloud_type=1&token=$md5_pl&src_code=$1&status=1"
@@ -890,3 +904,4 @@ echo -e "=================================================================="
endTime=`date +%s`
((outTime=($endTime-$startTime)/60))
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
+rm -f install_btmonitor.sh
\ No newline at end of file
diff --git a/public/install/src/bt-monitor-2.3.0.zip b/public/install/src/bt-monitor-2.3.1.zip
similarity index 98%
rename from public/install/src/bt-monitor-2.3.0.zip
rename to public/install/src/bt-monitor-2.3.1.zip
index a553c19..e19a34c 100644
Binary files a/public/install/src/bt-monitor-2.3.0.zip and b/public/install/src/bt-monitor-2.3.1.zip differ
diff --git a/public/install/src/panel6.zip b/public/install/src/panel6.zip
index ecee726..85de655 100644
Binary files a/public/install/src/panel6.zip and b/public/install/src/panel6.zip differ
diff --git a/public/install/src/panel_7_en.zip b/public/install/src/panel_7_en.zip
index 6b2ee19..09e4efc 100644
Binary files a/public/install/src/panel_7_en.zip and b/public/install/src/panel_7_en.zip differ
diff --git a/public/install/update/LinuxPanel-11.0.0.zip b/public/install/update/LinuxPanel-11.0.0.zip
index 45e8f54..7c4f47b 100644
Binary files a/public/install/update/LinuxPanel-11.0.0.zip and b/public/install/update/LinuxPanel-11.0.0.zip differ
diff --git a/public/install/update/LinuxPanel_EN-7.0.21.zip b/public/install/update/LinuxPanel_EN-7.0.21.zip
index 8ab746c..e8a8399 100644
Binary files a/public/install/update/LinuxPanel_EN-7.0.21.zip and b/public/install/update/LinuxPanel_EN-7.0.21.zip differ
diff --git a/wiki/aapanel.md b/wiki/aapanel.md
index d316e68..494598e 100644
--- a/wiki/aapanel.md
+++ b/wiki/aapanel.md
@@ -14,7 +14,7 @@
php think decrypt classdir <面板class_v2文件夹路径>
-- 全局搜索替换 https://wafapi2.aapanel.com => http://www.example.com(需排除task.py、ipsModel.py、js文件)
+- 全局搜索替换 https://wafapi2.aapanel.com => http://www.example.com(需排除task.py、ipsModel.py、js文件),https://wafapi.aapanel.com => http://www.example.com
- 全局搜索替换 https://node.aapanel.com/install/update_7.x_en.sh => http://www.example.com/install/update_7.x_en.sh
@@ -22,13 +22,19 @@
- 搜索并删除提交异常报告的代码 bt_error/index.php
-- class/ajax.py 文件 \#是否执行升级程序 下面的 public.get_url() 改成 public.OfficialApiBase()
+- class/ajax.py、class_v2/ajax_v2.py 文件:
- class/ajax.py 文件 __official_url = 'https://www.aapanel.com' 改成 http://www.example.com
+ \#是否执行升级程序 下面的 public.get_url() 改成 public.OfficialApiBase()
- class/jobs.py 文件 \#尝试升级到独立环境 下面的 public.get_url() 改成 public.OfficialApiBase()
+ __official_url = 'https://www.aapanel.com' 改成 http://www.example.com
- class/system.py 文件 RepPanel和UpdatePro方法内的 public.get_url() 改成 public.OfficialApiBase()
+ class/jobs.py、class_v2/jobs_v2.py 文件:
+
+ \#尝试升级到独立环境 下面的 public.get_url() 改成 public.OfficialApiBase()
+
+ class/system.py、class_v2/system_v2.py 文件:
+
+ RepPanel和UpdatePro方法内的 public.get_url() 改成 public.OfficialApiBase()
- class/public/common.py
@@ -52,7 +58,7 @@
在 def write_request_log(reques=None): 这一行下面加上 return
-- class/panelPlugin.py 文件,set_pyenv方法内,temp_file = public.readFile(filename)这行代码下面加上
+- class/panelPlugin.py、class_v2/panel_plugin_v2.py 文件,set_pyenv方法内,temp_file = public.readFile(filename)这行代码下面加上
```python
temp_file = temp_file.replace('http://download.bt.cn/install/public.sh', 'http://www.example.com/install/public.sh')
diff --git a/wiki/btmonitor.md b/wiki/btmonitor.md
index 12147e8..22fb57c 100644
--- a/wiki/btmonitor.md
+++ b/wiki/btmonitor.md
@@ -1,53 +1,45 @@
-# 宝塔云监控安装包修改记录
-
-查询最新版本号:https://api.bt.cn/bt_monitor/latest_version
-
-安装包下载链接:http://download.bt.cn/install/src/bt-monitor-版本号.zip
-
-- 删除core/include/c_loader/PluginLoader.so,sqlite_server/PluginLoader.so,将btmonitor/PluginLoader.py复制到这个文件夹
-
-- 批量解密源码:执行 php think decrypt all <源码根目录>
-
- 极少数文件解密失败是正常现象可无视
-
-- 全局搜索替换 https://api.bt.cn => http://www.example.com(需排除/bt_monitor/latest_agent_version、/bt_monitor/ip_info)
-
-- 全局搜索替换 https://www.bt.cn/api/ => http://www.example.com/api/
-
-- core/include/public.py 在
-
- ```python
- def GetConfigValue(key):
- ```
-
- 这一行下面加上
-
- ```python
- if key == 'home': return 'http://www.example.com'
- ```
-
- def write_request_log(reques = None): 这一行下面加上 return
-
-- core/include/basic_monitor.py
-
- 在 def report_module_logs(self, force=False): 这一行下面加上 return
-
-- modules/configModule/main.py
-
- https://download.bt.cn => http://www.example.com
-
-- update/update_btmonitor.sh 修改Install_Monitor方法内的download_Url变量
-
-- init.sh https://download.bt.cn => http://www.example.com
-
-- BT-MONITOR 在
-
- ```python
- def CreateSSL():
- ```
-
- 这一行下面加上
-
- ```python
- return CreateSSL_offline()
- ```
+# 宝塔云监控安装包修改记录
+
+查询最新版本号:https://api.bt.cn/bt_monitor/latest_version
+
+安装包下载链接:http://download.bt.cn/install/src/bt-monitor-版本号.zip
+
+- 删除core/include/c_loader/PluginLoader.so,sqlite_server/PluginLoader.so,将btmonitor/PluginLoader.py复制到这个文件夹
+
+- 批量解密源码:执行 php think decrypt all <源码根目录>
+
+ 极少数文件解密失败是正常现象可无视
+
+- 全局搜索替换 https://api.bt.cn => http://www.example.com(需排除/bt_monitor/latest_agent_version、/bt_monitor/ip_info)
+
+- 全局搜索替换 https://www.bt.cn/api/ => http://www.example.com/api/
+
+- core/include/public.py 在
+
+ ```python
+ def GetConfigValue(key):
+ ```
+
+ 这一行下面加上
+
+ ```python
+ if key == 'home': return 'http://www.example.com'
+ ```
+
+ def write_request_log(reques = None): 这一行下面加上 return
+
+- core/include/basic_monitor.py
+
+ 在 def report_module_logs(self, force=False): 这一行下面加上 return
+
+ 在 def report_daily_active(self, force=False): 这一行下面加上 return
+
+- modules/configModule/main.py
+
+ https://download.bt.cn => http://www.example.com
+
+- update/update_btmonitor.sh 修改Install_Monitor方法内的download_Url变量
+
+- init.sh https://download.bt.cn => http://www.example.com
+
+- 减少压缩包体积:删除 static/js/ 目录下的map文件
diff --git a/wiki/files/btmonitor/PluginLoader.py b/wiki/files/btmonitor/PluginLoader.py
index 2b1840e..04fd1ab 100644
--- a/wiki/files/btmonitor/PluginLoader.py
+++ b/wiki/files/btmonitor/PluginLoader.py
@@ -14,7 +14,7 @@ def module_run(module_name, def_name, def_args):
if not os.path.exists(filename):
filename = "{}/plugin/{}/main.py".format(panel_path,module_name)
if not os.path.exists(filename):
- filename = "{}/plugin/{}Module/{}Plugin.py".format(panel_path,module_name,module_name)
+ filename = "{}/plugin/{}/{}Plugin.py".format(panel_path,module_name,module_name)
if not os.path.exists(filename):
return public.returnMsg(False,'指定模块或插件不存在')