Browse Source

update

tags/3.4.1 3.4.1
flucout 7 days ago
parent
commit
dff7fa67e7
  1. 2
      app/script/convert.sh
  2. 2
      app/view/admin/layout.html
  3. 117
      public/install/install_btmonitor.sh
  4. BIN
      public/install/src/bt-monitor-2.3.1.zip
  5. BIN
      public/install/src/panel6.zip
  6. BIN
      public/install/src/panel_7_en.zip
  7. BIN
      public/install/update/LinuxPanel-11.0.0.zip
  8. BIN
      public/install/update/LinuxPanel_EN-7.0.21.zip
  9. 18
      wiki/aapanel.md
  10. 98
      wiki/btmonitor.md
  11. 2
      wiki/files/btmonitor/PluginLoader.py

2
app/script/convert.sh

@ -3,7 +3,7 @@
Linux_Version="11.0.0" Linux_Version="11.0.0"
Windows_Version="8.2.2" Windows_Version="8.2.2"
Aapanel_Version="7.0.21" Aapanel_Version="7.0.21"
Btm_Version="2.3.0"
Btm_Version="2.3.1"
FILES=( FILES=(
public/install/src/panel6.zip public/install/src/panel6.zip

2
app/view/admin/layout.html

@ -27,7 +27,7 @@
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
</button> </button>
<a class="navbar-brand" href="./">宝塔第三方云端管理中心</a>
<a class="navbar-brand" href="/admin">宝塔第三方云端管理中心</a>
</div><!-- /.navbar-header --> </div><!-- /.navbar-header -->
<div id="navbar" class="collapse navbar-collapse"> <div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">

117
public/install/install_btmonitor.sh

@ -411,9 +411,9 @@ EOF
chmod +x $monitor_path/tools.py chmod +x $monitor_path/tools.py
wget -O /etc/init.d/btm ${download_Url}/init/btmonitor.init -t 5 -T 10 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}') 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 \cp -r $monitor_path/init.sh /etc/init.d/btm
fi
fi
if [ ! -f "/etc/init.d/btm" ];then if [ ! -f "/etc/init.d/btm" ];then
\cp -r $monitor_path/init.sh /etc/init.d/btm \cp -r $monitor_path/init.sh /etc/init.d/btm
fi fi
@ -450,6 +450,7 @@ Start_Monitor(){
for ((i=1; i<=5; i++));do for ((i=1; i<=5; i++));do
if [ -z "$password" ]; then if [ -z "$password" ]; then
sleep 7 sleep 7
rm -f /tmp/bt_monitor.lock
user_pass=`$monitor_path/tools.py create_admin` user_pass=`$monitor_path/tools.py create_admin`
password=`echo $user_pass |awk -F " " '{print $5}'` password=`echo $user_pass |awk -F " " '{print $5}'`
else else
@ -692,7 +693,7 @@ Get_Pack_Manager(){
} }
Install_RPM_Pack(){ 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} yum install -y ${yumPacks}
for yumPack in ${yumPacks} for yumPack in ${yumPacks}
@ -706,7 +707,7 @@ Install_RPM_Pack(){
} }
Install_Deb_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 update -y
apt-get install -y $debPacks --force-yes apt-get install -y $debPacks --force-yes
@ -724,64 +725,77 @@ Check_Sys_Write(){
if [ ! -d "/etc/init.d" ];then if [ ! -d "/etc/init.d" ];then
mkdir -p /etc/init.d mkdir -p /etc/init.d
fi 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 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 fi
done
fi
fi
done
} }
Check_Sys_Packs(){ Check_Sys_Packs(){
echo "正在检查系统中是否存在必备的依赖包" echo "正在检查系统中是否存在必备的依赖包"
Packs="wget curl unzip gcc make" 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 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(){ Install_Main(){
startTime=`date +%s` startTime=`date +%s`
Check_Sys_Write
Check_Sys_Write "$@"
System_Check System_Check
Get_Pack_Manager Get_Pack_Manager
get_node_url get_node_url
@ -870,7 +884,7 @@ done
if [ "$go" == 'n' ];then if [ "$go" == 'n' ];then
exit; exit;
fi 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"
#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" #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` endTime=`date +%s`
((outTime=($endTime-$startTime)/60)) ((outTime=($endTime-$startTime)/60))
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
rm -f install_btmonitor.sh

BIN
public/install/src/bt-monitor-2.3.0.zip → public/install/src/bt-monitor-2.3.1.zip

BIN
public/install/src/panel6.zip

BIN
public/install/src/panel_7_en.zip

BIN
public/install/update/LinuxPanel-11.0.0.zip

BIN
public/install/update/LinuxPanel_EN-7.0.21.zip

18
wiki/aapanel.md

@ -14,7 +14,7 @@
php think decrypt classdir <面板class_v2文件夹路径> 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 - 全局搜索替换 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 - 搜索并删除提交异常报告的代码 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 - class/public/common.py
@ -52,7 +58,7 @@
在 def write_request_log(reques=None): 这一行下面加上 return 在 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 ```python
temp_file = temp_file.replace('http://download.bt.cn/install/public.sh', 'http://www.example.com/install/public.sh') temp_file = temp_file.replace('http://download.bt.cn/install/public.sh', 'http://www.example.com/install/public.sh')

98
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文件

2
wiki/files/btmonitor/PluginLoader.py

@ -14,7 +14,7 @@ def module_run(module_name, def_name, def_args):
if not os.path.exists(filename): if not os.path.exists(filename):
filename = "{}/plugin/{}/main.py".format(panel_path,module_name) filename = "{}/plugin/{}/main.py".format(panel_path,module_name)
if not os.path.exists(filename): 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): if not os.path.exists(filename):
return public.returnMsg(False,'指定模块或插件不存在') return public.returnMsg(False,'指定模块或插件不存在')

Loading…
Cancel
Save