Compare commits

...

7 Commits
2.3.5 ... 2.4.2

Author SHA1 Message Date
flucout
fa9188b94d update 2024-07-06 13:25:55 +08:00
flucout
2ddb4ff64c update 2024-06-16 21:00:50 +08:00
flucout
963b675026 fix 2024-06-07 14:20:19 +08:00
flucout
5642ea3038 update 2024-06-07 14:09:15 +08:00
flucout
2aff0d9e6d update 2024-06-01 15:11:14 +08:00
flucout
0ca1c9d0e3 update 2024-06-01 15:07:31 +08:00
flucout
c1681a9731 update 2024-05-07 23:43:04 +08:00
12 changed files with 160 additions and 116 deletions

View File

@@ -99,8 +99,8 @@ class CleanViteJs extends Command
if(strpos($file, 'window.location.protocol.indexOf("https")>=0')!==false){ //index
$file = str_replace('(window.location.protocol.indexOf("https")>=0)', '1', $file);
$file = preg_replace('!setTimeout\(\(\(\)=>\w+\(\)\),3e3\)!', '', $file);
$file = preg_replace('!setTimeout\(\(function\(\)\{return \w+\(\)\}\),3e3\)!', '', $file);
$file = preg_replace('!setTimeout\(\(\(\)=>\{\w+\(\)\}\),3e3\)!', '', $file);
$file = preg_replace('!setTimeout\(\(function\(\)\{\w+\(\)\}\),3e3\)!', '', $file);
$file = preg_replace('!recommendShow:\w+,!', 'recommendShow:!1,', $file);
$code = $this->getExtendCode($file, '"需求反馈"', 2);
if($code){
@@ -124,16 +124,20 @@ class CleanViteJs extends Command
$end = strpos($file, $code)+strlen($code);
$code = substr($file, $start, $end - $start + 1);
$file = str_replace($code, '', $file);
$file = preg_replace('!,isCalc:\w+,isInput:\w+,isCheck:\w+,!', ',isCalc:!1,isInput:!1,isCheck:!1,', $file);
$file = preg_replace('!computed\(\(\(\)=>"calc"===\w+\.type\|\|"checkConfirm"===\w+\.type\)\)!', '!1', $file);
$file = preg_replace('!computed\(\(\(\)=>"input"===\w+\.type\)\)!', '!1', $file);
$file = preg_replace('!computed\(\(\(\)=>"check"===\w+\.type\|\|"checkConfirm"===\w+\.type\)\)!', '!1', $file);
$file = preg_replace('!computed\(\(function\(\)\{return"calc"===\w+\.type\|\|"checkConfirm"===\w+\.type\}\)\)!', '!1', $file);
$file = preg_replace('!computed\(\(function\(\)\{return"input"===\w+\.type\}\)\)!', '!1', $file);
$file = preg_replace('!computed\(\(function\(\)\{return"check"===\w+\.type\|\|"checkConfirm"===\w+\.type\}\)\)!', '!1', $file);
$file = str_replace('startNegotiate(),', '', $file);
$flag = true;
}
if(strpos($file, '"calc"') !== false && strpos($file, '"checkConfirm"') !== false){ //main2
$file = preg_replace('!,isCalc:\w+,isInput:\w+,isCheck:\w+,!', ',isCalc:!1,isInput:!1,isCheck:!1,', $file);
$file = preg_replace('!\w+\(\(\(\)=>"calc"===\w+\.type\|\|"checkConfirm"===\w+\.type\)\)!', '!1', $file);
$file = preg_replace('!\w+\(\(\(\)=>"input"===\w+\.type\)\)!', '!1', $file);
$file = preg_replace('!\w+\(\(\(\)=>"check"===\w+\.type\|\|"checkConfirm"===\w+\.type\)\)!', '!1', $file);
$file = preg_replace('!\w+\(\(function\(\)\{return"calc"===\w+\.type\|\|"checkConfirm"===\w+\.type\}\)\)!', '!1', $file);
$file = preg_replace('!\w+\(\(function\(\)\{return"input"===\w+\.type\}\)\)!', '!1', $file);
$file = preg_replace('!\w+\(\(function\(\)\{return"check"===\w+\.type\|\|"checkConfirm"===\w+\.type\}\)\)!', '!1', $file);
$flag = true;
}
if(strpos($file, '请冷静几秒钟,确认以下要删除的数据')!==false && strpos($file, '"计算结果:"')!==false){ //site
$code = $this->getExtendCode($file, '"计算结果:"', 2, '[', ']');
@@ -148,21 +152,21 @@ class CleanViteJs extends Command
$flag = true;
}
if(strpos($file, '"bt-waf-gray"')!==false){ //site.popup
/*if(strpos($file, '"bt-waf-gray"')!==false){ //site.popup
$code = $this->getExtendCode($file, '"bt-waf-gray"', 2);
$code = $this->getExtendCode($file, $code, 1, '[', ']');
$code = $this->getExtendFunction($file, $code);
$file = str_replace($code, '""', $file);
$flag = true;
}
}*/
if(strpos($file, '"商用SSL证书"')!==false){ //site-ssl
$code = $this->getExtendFunction($file, '"商用SSL证书"', '{', '}');
$file = str_replace($code, '', $file);
$code = $this->getExtendFunction($file, '"测试证书"', '{', '}');
$file = str_replace($code, '', $file);
$file = preg_replace('!\w+\.value="currentCertInfo":\w+\.value="busSslList"!', 'i.value="currentCertInfo":i.value="currentCertInfo"', $file);
$file = preg_replace('!\{\w+\.value="busSslList",\w+\(\)\}!', '{i.value="letsEncryptList"}', $file);
$file = str_replace('"currentCertInfo":"busSslList"', '"currentCertInfo":"currentCertInfo"', $file);
$file = preg_replace('!\{(\w+)\.value="busSslList",\w+\(\)\}!', '{$1.value="letsEncryptList"}', $file);
$flag = true;
}
@@ -172,6 +176,28 @@ class CleanViteJs extends Command
$file = str_replace($code, '', $file);
$flag = true;
}
if(strpos($file, '"recom-view"')!==false){ //soft
$code = $this->getExtendFunction($file, '"recom-view"');
$file = str_replace($code, 'void(0)', $file);
$flag = true;
}
if(strpos($file, '"打开插件文件目录"')!==false){ //soft.table
$code = $this->getExtendFunction($file, '"(续费)"');
$file = str_replace($code, '""', $file);
$code = $this->getExtendFunction($file, '"(续费)"');
$file = str_replace($code, '""', $file);
$flag = true;
}
if(strpos($file, '检测到同名文件')!==false){ //file.
$code = $this->getExtendCode($file, '计算结果:', 3, '[', ']');
$code = $this->getExtendFunction($file, $code);
$file = str_replace($code, '', $file);
$file = preg_replace('!\w+\.sum===\w+\.addend1\+\w+\.addend2!', '!0', $file);
$flag = true;
}
for($i=0;$i<5;$i++){
$code = $this->getExtendCode($file, 'content:"需求反馈"', 2);

View File

@@ -8,13 +8,13 @@ class Index extends BaseController
{
public function index()
{
return 'Server is ok';
return '';
}
public function download()
{
if(config_get('download_page') == '0' && !request()->islogin){
return redirect('/admin/login');
return 'need login';
}
View::assign('siteurl', request()->root(true));
return view();

View File

@@ -1,8 +1,8 @@
#!/bin/bash
Linux_Version="8.1.0"
Windows_Version="7.9.0"
Btm_Version="2.2.9"
Linux_Version="8.2.0"
Windows_Version="8.0.0"
Btm_Version="2.3.0"
FILES=(
public/install/src/panel6.zip

View File

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

View File

@@ -134,8 +134,8 @@ Add_lib_Install(){
Get_Versions
if [ "${os_type}" == "el" ] && [ "${os_version}" == "7" ];then
cd /www/server/panel/class
btpython -c "import panelPlugin; plugin = panelPlugin.panelPlugin(); plugin.check_install_lib('1')"
echo "True" > /tmp/panelTask.pl
#btpython -c "import panelPlugin; plugin = panelPlugin.panelPlugin(); plugin.check_install_lib('1')"
#echo "True" > /tmp/panelTask.pl
fi
}
Get_Pack_Manager(){

Binary file not shown.

View File

@@ -47,7 +47,7 @@ download_Url=$NODE_URL
setup_path=/www
version=$(curl -Ss --connect-timeout 5 -m 2 $Btapi_Url/api/panel/get_version)
if [ "$version" = '' ];then
version='8.0.5'
version='8.2.0'
fi
armCheck=$(uname -m|grep arm)
if [ "${armCheck}" ];then
@@ -79,13 +79,18 @@ rm -f /www/server/panel/*.pyc
rm -f /www/server/panel/class/*.pyc
#pip install flask_sqlalchemy
#pip install itsdangerous==0.24
btpip install natsort
pip_list=$($mypip list)
pip_list=$($mypip list 2>&1)
request_v=$(btpip list 2>/dev/null|grep "requests "|awk '{print $2}'|cut -d '.' -f 2)
if [ "$request_v" = "" ] || [ "${request_v}" -gt "28" ];then
$mypip install requests==2.27.1
fi
NATSORT_C=$(echo $pip_list|grep natsort)
if [ -z "${NATSORT_C}" ];then
btpip install natsort
fi
openssl_v=$(echo "$pip_list"|grep pyOpenSSL)
if [ "$openssl_v" = "" ];then
$mypip install pyOpenSSL
@@ -129,8 +134,16 @@ if [ "${PYMYSQL_SSL_CHECK}" ];then
fi
btpip uninstall enum34 -y
btpip install geoip2==4.7.0
btpip install pandas
GEOIP_C=$(echo $pip_list|grep geoip2)
if [ -z "${GEOIP_C}" ];then
btpip install geoip2==4.7.0
fi
PANDAS_C=$(echo $pip_list|grep pandas)
if [ -z "${PANDAS_C}" ];then
btpip install pandas
fi
pymysql=$(echo "$pip_list"|grep pycryptodome)
if [ "$pymysql" = "" ];then
@@ -140,6 +153,11 @@ fi
echo "修复面板依赖完成!"
echo "==========================================="
RE_UPDATE=$(cat /www/server/panel/data/db/update)
if [ "$RE_UPDATE" -ge "4" ];then
echo "2" > /www/server/panel/data/db/update
fi
#psutil=$(echo "$pip_list"|grep psutil|awk '{print $2}'|grep '5.7.')
#if [ "$psutil" = "" ];then
# $mypip install -U psutil

View File

@@ -14,7 +14,7 @@
- 全局搜索替换 https://api.bt.cn => http://www.example.com
- 全局搜索替换 https://www.bt.cn/api/ => http://www.example.com/api/需排除clearModel.py、scanningModel.py、ipsModel.py
- 全局搜索替换 https://www.bt.cn/api/ => http://www.example.com/api/需排除clearModel.py、scanningModel.py、ipsModel.py、js文件
- 全局搜索替换 http://www.bt.cn/api/ => http://www.example.com/api/需排除js文件
@@ -54,9 +54,7 @@
在login_send_body方法内free_login_area(login_ip=server_ip_area的server_ip_area改成login_ip
- class/panelPlugin.py 文件,download_icon方法内替换 public.GetConfigValue('home') => 'https://www.bt.cn'
删除public.total_keyword(get.query)这一行
- class/panelPlugin.py 文件,删除public.total_keyword(get.query)这一行
__set_pyenv方法内temp_file = public.readFile(filename)这行代码下面加上
@@ -72,12 +70,16 @@
softInfo['endtime'] = time.time() + 86400 * 3650
```
plugin_bin.pl 改成 plugin_list.json
- class/plugin_deployment.py 文件SetupPackage方法内替换 public.GetConfigValue('home') => 'https://www.bt.cn'
- class/config.py 文件get_nps方法内data['nps'] = False改成Trueget_nps_new方法下面加上 return public.returnMsg(False, "获取问卷失败")
def err_collection(self, get): 这一行下面加上 return public.returnMsg(True, "OK")
- class/push/site_push.py 文件,'https://www.bt.cn' => 'http://www.example.com'
- script/flush_plugin.py 文件删除clear_hosts()一行
- script/reload_check.py 文件在第2行插入sys.exit()
@@ -97,7 +99,9 @@
- 去除无用的定时任务task.py 文件 删除以下几行
"check_panel_msg": check_panel_msg,
"check_panel_msg": self.check_panel_msg,
"update_software_list": self.update_software_list,
PluginLoader.daemon_panel()
@@ -105,10 +109,6 @@
- 去除WebRTC连接BTPanel/static/js/public.js 删除stun.start();这一行
- 去除首页广告BTPanel/static/js/index.js 文件删除两处index.recommend_paid_version()
- 去除首页自动检测更新避免频繁请求云端BTPanel/static/js/index.js 文件注释掉bt.system.check_update这一段代码外的setTimeout
- 去除内页广告BTPanel/templates/default/layout.html 删除两处getPaymentStatus();
- 删除问卷调查BTPanel/templates/default/layout.html 删除if(window.localStorage.getItem('panelNPS') == null)以及下面的行
@@ -133,9 +133,7 @@
- [可选]关闭自动生成访问日志:在 BTPanel/\_\_init\_\_.py 删除public.write_request_log这一行
- [可选]上传文件默认选中覆盖,在BTPanel/static/js/upload-drog.jsid="all_operation"加checked属性
- [可选]新版vite页面去除需求反馈、各种广告、计算题等执行 php think decrypt cleanvitejs <面板BTPanel/static/vite/js路径>
- [可选]新版vite页面去除需求反馈、各种广告、计算题等执行 php think cleanvitejs <面板BTPanel/static/vite/js路径>
解压安装包[panel6.zip](http://download.bt.cn/install/src/panel6.zip),将更新包改好的文件覆盖到里面,然后重新打包,即可更新安装包。(

View File

@@ -1,78 +1,80 @@
# Windows面板官方更新包修改记录
查询最新版本号https://www.bt.cn/api/wpanel/get_version?is_version=1
官方更新包下载链接http://download.bt.cn/win/panel/panel_版本号.zip
假设搭建的宝塔第三方云端网址是 http://www.example.com
Windows版宝塔由于加密文件太多无法全部解密因此无法做到全开源。
- 删除PluginLoader.pyd将win/PluginLoader.py复制到class文件夹
- 全局搜索替换 https://api.bt.cn => http://www.example.com
- 全局搜索替换 https://www.bt.cn/api/ => http://www.example.com/api/需排除ipsModel.py
- 全局搜索替换 http://www.bt.cn/api/ => http://www.example.com/api/
- 全局搜索替换 https://download.bt.cn/win/panel/data/setup.py => http://www.example.com/win/panel/data/setup.py
- class/panel_update.py 文件 public.get_url() => 'http://www.example.com'
- class/public.py 在
```python
def GetConfigValue(key):
```
这一行下面加上
```python
if key == 'home': return 'http://www.example.com'
```
在 def is_bind(): 这一行下面加上 return True
在 def check_domain_cloud(domain): 这一行下面加上 return
在 get_update_file() 方法里面 get_url() => GetConfigValue('home')
- class/plugin_deployment.py 文件 get_icon 和 SetupPackage 方法内,替换 public.GetConfigValue('home') => 'https://www.bt.cn'
- 去除无用的定时任务task.py 文件
删除 p = threading.Thread(target=check_files_panel) 以及下面2行
删除 p = threading.Thread(target=check_panel_msg) 以及下面2行
删除 p = threading.Thread(target=update_software_list) 以及下面2行
- 去除面板日志上报script/site_task.py 文件
- 删除最下面 logs_analysis() 这1行
- 去除首页广告BTPanel/static/js/index.js 文件删除最下面index.recommend_paid_version()这一行以及index.consultancy_services()这一行
- 去除首页自动检测更新避免频繁请求云端BTPanel/static/js/index.js 文件注释掉bt.system.check_update这一段代码外的setTimeout
- 去除内页广告BTPanel/templates/default/layout.html 删除getPaymentStatus();这一行
- [可选]去除各种计算题复制win/bt.js到 BTPanel/static/ ,在 BTPanel/templates/default/layout.html 的尾部加入
```javascript
<script src="/static/bt.js"></script>
```
- [可选]去除创建网站自动创建的垃圾文件class/panelSite.py 文件
删除 htaccess = self.sitePath + '/.htaccess' 以及下面2行
删除 index = self.sitePath + '/index.html' 以及下面6行
删除 doc404 = self.sitePath + '/404.html' 以及下面6行
删除 if not os.path.exists(self.sitePath + '/.htaccess') 这一行
- [可选]关闭自动生成访问日志:在 BTPanel/\_\_init\_\_.py 删除public.write_request_log()这一行
# Windows面板官方更新包修改记录
查询最新版本号https://www.bt.cn/api/wpanel/get_version?is_version=1
官方更新包下载链接http://download.bt.cn/win/panel/panel_版本号.zip
假设搭建的宝塔第三方云端网址是 http://www.example.com
Windows版宝塔由于加密文件太多无法全部解密因此无法做到全开源。
- 删除PluginLoader.pyd将win/PluginLoader.py复制到class文件夹
- 批量解密模块文件:执行 php think decrypt classdir <面板class文件夹路径>
- 全局搜索替换 https://api.bt.cn => http://www.example.com
- 全局搜索替换 https://www.bt.cn/api/ => http://www.example.com/api/需排除ipsModel.py
- 全局搜索替换 https://download.bt.cn/win/panel/data/setup.py => http://www.example.com/win/panel/data/setup.py
- class/panel_update.py 文件 public.get_url() => 'http://www.example.com'
- class/public.py 在
```python
def GetConfigValue(key):
```
这一行下面加上
```python
if key == 'home': return 'http://www.example.com'
```
在 def is_bind(): 这一行下面加上 return True
在 def check_domain_cloud(domain): 这一行下面加上 return
在 get_update_file() 方法里面 get_url() => GetConfigValue('home')
- class/plugin_deployment.py 文件 get_icon 和 SetupPackage 方法内,替换 public.GetConfigValue('home') => 'https://www.bt.cn'
- 去除无用的定时任务task.py 文件
删除 p = threading.Thread(target=check_files_panel) 以及下面2行
删除 p = threading.Thread(target=check_panel_msg) 以及下面2行
删除 p = threading.Thread(target=update_software_list) 以及下面2行
- 去除面板日志上报script/site_task.py 文件
- 删除最下面 logs_analysis() 这1行
- 去除首页广告BTPanel/static/js/index.js 文件删除最下面index.recommend_paid_version()这一行以及index.consultancy_services()这一行
- 去除首页自动检测更新避免频繁请求云端BTPanel/static/js/index.js 文件注释掉bt.system.check_update这一段代码外的setTimeout
- 去除内页广告BTPanel/templates/default/layout.html 删除getPaymentStatus();这一行
- [可选]去除各种计算题复制win/bt.js到 BTPanel/static/ ,在 BTPanel/templates/default/layout.html 的尾部加入
```javascript
<script src="/static/bt.js"></script>
```
- [可选]去除创建网站自动创建的垃圾文件class/panelSite.py 文件
删除 htaccess = self.sitePath + '/.htaccess' 以及下面2行
删除 index = self.sitePath + '/index.html' 以及下面6行
删除 doc404 = self.sitePath + '/404.html' 以及下面6行
删除 if not os.path.exists(self.sitePath + '/.htaccess') 这一行
- [可选]关闭自动生成访问日志:在 BTPanel/\_\_init\_\_.py 删除public.write_request_log()这一行
- [可选]上传文件默认选中覆盖在BTPanel/static/js/upload-drog.jsid="all_operation"加checked属性