mirror of
https://github.com/flucont/btcloud.git
synced 2025-10-16 07:40:28 +00:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0ca1c9d0e3 | ||
![]() |
c1681a9731 | ||
![]() |
911a567fde | ||
![]() |
b27349a416 |
229
app/command/CleanViteJs.php
Normal file
229
app/command/CleanViteJs.php
Normal file
@@ -0,0 +1,229 @@
|
|||||||
|
<?php
|
||||||
|
declare (strict_types = 1);
|
||||||
|
|
||||||
|
namespace app\command;
|
||||||
|
|
||||||
|
use think\console\Command;
|
||||||
|
use think\console\Input;
|
||||||
|
use think\console\input\Argument;
|
||||||
|
use think\console\input\Option;
|
||||||
|
use think\console\Output;
|
||||||
|
use think\facade\Db;
|
||||||
|
use think\facade\Config;
|
||||||
|
use app\lib\Plugins;
|
||||||
|
|
||||||
|
class CleanViteJs extends Command
|
||||||
|
{
|
||||||
|
protected function configure()
|
||||||
|
{
|
||||||
|
$this->setName('cleanvitejs')
|
||||||
|
->addArgument('dir', Argument::REQUIRED, '/BTPanel/static/vite/js/路径')
|
||||||
|
->setDescription('处理宝塔面板vite/js文件');
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function execute(Input $input, Output $output)
|
||||||
|
{
|
||||||
|
$dir = trim($input->getArgument('dir'));
|
||||||
|
if(!file_exists($dir)){
|
||||||
|
$output->writeln('目录不存在');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//$this->handlefile($dir.'/DockerImages.js');
|
||||||
|
$this->checkdir($dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getExtendCode($content, $part, $n = 1, $startChar = '{', $endChar = '}'){
|
||||||
|
if(!$part) return false;
|
||||||
|
$length = strlen($content);
|
||||||
|
$start = strpos($content, $part);
|
||||||
|
if($start===false)return false;
|
||||||
|
$end = $start+strlen($part);
|
||||||
|
$start--;
|
||||||
|
$c = 0;
|
||||||
|
for($i=$start;$i>=0;$i--){
|
||||||
|
if(substr($content,$i,1) == $startChar) $c++;
|
||||||
|
if(substr($content,$i,1) == $endChar) $c--;
|
||||||
|
if($c == $n){
|
||||||
|
$start = $i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$c = 0;
|
||||||
|
for($i=$end;$i<=$length;$i++){
|
||||||
|
if(substr($content,$i,1) == $endChar) $c++;
|
||||||
|
if(substr($content,$i,1) == $startChar) $c--;
|
||||||
|
if($c == $n){
|
||||||
|
$end = $i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return substr($content, $start, $end - $start + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getExtendFunction($content, $part, $startChar = '(', $endChar = ')'){
|
||||||
|
$code = $this->getExtendCode($content, $part, 1, $startChar, $endChar);
|
||||||
|
if(!$code) return false;
|
||||||
|
$start = strpos($content, $code) - 1;
|
||||||
|
$end = $start + strlen($code);
|
||||||
|
for($i=$start;$i>=0;$i--){
|
||||||
|
$char = substr($content,$i,1);
|
||||||
|
if(!ctype_alpha($char)){
|
||||||
|
$start = $i+1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(substr($content,$start-1,1) == ',') $start--;
|
||||||
|
return substr($content, $start, $end - $start + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function checkdir($basedir){
|
||||||
|
if($dh=opendir($basedir)){
|
||||||
|
while (($file=readdir($dh)) !== false){
|
||||||
|
if($file != '.' && $file != '..'){
|
||||||
|
if(!is_dir($basedir.'/'.$file) && substr($file,-3)=='.js'){
|
||||||
|
$this->handlefile($basedir.'/'.$file);
|
||||||
|
}else if(!is_dir($basedir.'/'.$file) && substr($file,-4)=='.map'){
|
||||||
|
unlink($basedir.'/'.$file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($dh);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function handlefile($filepath){
|
||||||
|
$file = file_get_contents($filepath);
|
||||||
|
if(!$file)return;
|
||||||
|
|
||||||
|
$flag = false;
|
||||||
|
|
||||||
|
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\(\)\{\w+\(\)\}\),3e3\)!', '', $file);
|
||||||
|
$file = preg_replace('!recommendShow:\w+,!', 'recommendShow:!1,', $file);
|
||||||
|
$code = $this->getExtendCode($file, '"需求反馈"', 2);
|
||||||
|
if($code){
|
||||||
|
$file = str_replace($code, '{}', $file);
|
||||||
|
}
|
||||||
|
$flag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strpos($file, '"WechatOfficial"')!==false){ //main
|
||||||
|
$code = $this->getExtendCode($file, '"WechatOfficial"', 5);
|
||||||
|
$code = $this->getExtendFunction($file, $code);
|
||||||
|
$start = strpos($file, $code) - 1;
|
||||||
|
for($i=$start;$i>=0;$i--){
|
||||||
|
if(substr($file,$i,1) == ','){
|
||||||
|
$start = $i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$code = $this->getExtendCode($file, '"/other/customer-service.png"', 2);
|
||||||
|
$code = $this->getExtendCode($file, $code, 2, '[', ']');
|
||||||
|
$end = strpos($file, $code)+strlen($code);
|
||||||
|
$code = substr($file, $start, $end - $start + 1);
|
||||||
|
$file = str_replace($code, '', $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, '[', ']');
|
||||||
|
$code = $this->getExtendFunction($file, $code);
|
||||||
|
$file = str_replace($code, '', $file);
|
||||||
|
$file = preg_replace('!\w+\.sum===\w+\.addend1\+\w+\.addend2!', '!0', $file);
|
||||||
|
$file = preg_replace('!\w+\.sum\!==\w+\.addend1\+\w+\.addend2!', '!1', $file);
|
||||||
|
$file = preg_replace('!,disableDeleteButton:\w+,countdown:\w+,!', ',disableDeleteButton:!1,countdown:!1,', $file);
|
||||||
|
if(preg_match('/startCountdown:(\w+),/', $file, $matchs)){
|
||||||
|
$file = str_replace([';'.$matchs[1].'()', $matchs[1].'(),'], '', $file);
|
||||||
|
}
|
||||||
|
$flag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*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 = str_replace('"currentCertInfo":"busSslList"', '"currentCertInfo":"currentCertInfo"', $file);
|
||||||
|
$file = preg_replace('!\{(\w+)\.value="busSslList",\w+\(\)\}!', '{$1.value="letsEncryptList"}', $file);
|
||||||
|
$flag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strpos($file, '如果您希望添加其它Docker应用')!==false){
|
||||||
|
$code = $this->getExtendCode($file, '如果您希望添加其它Docker应用', 1, '[', ']');
|
||||||
|
$code = $this->getExtendFunction($file, $code);
|
||||||
|
$file = str_replace($code, '', $file);
|
||||||
|
$flag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strpos($file, '"recom-view"')!==false){ //soft
|
||||||
|
$code = getExtendFunction($file, '"recom-view"');
|
||||||
|
$file = str_replace($code, 'void(0)', $file);
|
||||||
|
$flag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strpos($file, '"打开插件文件目录"')!==false){ //soft.table
|
||||||
|
$code = getExtendFunction($file, '"(续费)"');
|
||||||
|
$file = str_replace($code, '""', $file);
|
||||||
|
$code = getExtendFunction($file, '"(续费)"');
|
||||||
|
$file = str_replace($code, '""', $file);
|
||||||
|
$flag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
for($i=0;$i<5;$i++){
|
||||||
|
$code = $this->getExtendCode($file, 'content:"需求反馈"', 2);
|
||||||
|
if($code){
|
||||||
|
$code = $this->getExtendFunction($file, $code);
|
||||||
|
$start = strpos($file, $code);
|
||||||
|
if(substr($file,$start-1,1) == ':'){
|
||||||
|
$file = str_replace($code, '{}', $file);
|
||||||
|
}else{
|
||||||
|
$file = str_replace($code, '', $file);
|
||||||
|
}
|
||||||
|
$flag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$code = $this->getExtendFunction($file, '("需求反馈")');
|
||||||
|
if($code){
|
||||||
|
$file = str_replace($code, '', $file);
|
||||||
|
$flag = true;
|
||||||
|
}
|
||||||
|
$code = $this->getExtendFunction($file, '(" 需求反馈 ")');
|
||||||
|
if($code){
|
||||||
|
$file = str_replace($code, '', $file);
|
||||||
|
$flag = true;
|
||||||
|
}
|
||||||
|
if(strpos('暂无搜索结果,<span class="text-primary cursor-pointer NpsDialog">提交需求反馈</span>', $file)!==false){
|
||||||
|
$file = str_replace('暂无搜索结果,<span class="text-primary cursor-pointer NpsDialog">提交需求反馈</span>', '暂无搜索结果', $file);
|
||||||
|
$flag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$flag) return;
|
||||||
|
if(file_put_contents($filepath, $file)){
|
||||||
|
echo '文件:'.$filepath.' 处理成功'."\n";
|
||||||
|
}else{
|
||||||
|
echo '文件:'.$filepath.' 处理失败,可能无写入权限'."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -8,13 +8,13 @@ class Index extends BaseController
|
|||||||
{
|
{
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
return 'Server is ok';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function download()
|
public function download()
|
||||||
{
|
{
|
||||||
if(config_get('download_page') == '0' && !request()->islogin){
|
if(config_get('download_page') == '0' && !request()->islogin){
|
||||||
return redirect('/admin/login');
|
return 'need login';
|
||||||
}
|
}
|
||||||
View::assign('siteurl', request()->root(true));
|
View::assign('siteurl', request()->root(true));
|
||||||
return view();
|
return view();
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
Linux_Version="8.0.5"
|
Linux_Version="8.2.0"
|
||||||
Windows_Version="7.9.0"
|
Windows_Version="8.0.0"
|
||||||
Btm_Version="2.2.9"
|
Btm_Version="2.3.0"
|
||||||
|
|
||||||
FILES=(
|
FILES=(
|
||||||
public/install/src/panel6.zip
|
public/install/src/panel6.zip
|
||||||
|
@@ -23,7 +23,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="./">Cloud</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">
|
||||||
|
@@ -8,5 +8,6 @@ return [
|
|||||||
'updateall' => 'app\command\UpdateAll',
|
'updateall' => 'app\command\UpdateAll',
|
||||||
'decrypt' => 'app\command\DecryptFile',
|
'decrypt' => 'app\command\DecryptFile',
|
||||||
'clean' => 'app\command\Clean',
|
'clean' => 'app\command\Clean',
|
||||||
|
'cleanvitejs' => 'app\command\CleanViteJs',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
@@ -134,8 +134,8 @@ Add_lib_Install(){
|
|||||||
Get_Versions
|
Get_Versions
|
||||||
if [ "${os_type}" == "el" ] && [ "${os_version}" == "7" ];then
|
if [ "${os_type}" == "el" ] && [ "${os_version}" == "7" ];then
|
||||||
cd /www/server/panel/class
|
cd /www/server/panel/class
|
||||||
btpython -c "import panelPlugin; plugin = panelPlugin.panelPlugin(); plugin.check_install_lib('1')"
|
#btpython -c "import panelPlugin; plugin = panelPlugin.panelPlugin(); plugin.check_install_lib('1')"
|
||||||
echo "True" > /tmp/panelTask.pl
|
#echo "True" > /tmp/panelTask.pl
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
Get_Pack_Manager(){
|
Get_Pack_Manager(){
|
||||||
@@ -425,6 +425,17 @@ Get_Versions(){
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ -f "/etc/os-release" ];then
|
||||||
|
. /etc/os-release
|
||||||
|
OS_V=${VERSION_ID%%.*}
|
||||||
|
if [ "${ID}" == "opencloudos" ] && [[ "${OS_V}" =~ ^(9)$ ]];then
|
||||||
|
os_type="opencloudos"
|
||||||
|
os_version="9"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f $redhat_version_file ];then
|
if [ -f $redhat_version_file ];then
|
||||||
os_type='el'
|
os_type='el'
|
||||||
is_aliyunos=$(cat $redhat_version_file|grep Aliyun)
|
is_aliyunos=$(cat $redhat_version_file|grep Aliyun)
|
||||||
@@ -709,8 +720,8 @@ Install_Bt(){
|
|||||||
mv -f ${setup_path}/server/panel/data/port.pl ${setup_path}/server/panel/old_data/port.pl
|
mv -f ${setup_path}/server/panel/data/port.pl ${setup_path}/server/panel/old_data/port.pl
|
||||||
mv -f ${setup_path}/server/panel/data/admin_path.pl ${setup_path}/server/panel/old_data/admin_path.pl
|
mv -f ${setup_path}/server/panel/data/admin_path.pl ${setup_path}/server/panel/old_data/admin_path.pl
|
||||||
|
|
||||||
if [ -f "${setup_path}/server/panel/data/db/default.db" ];then
|
if [ -d "${setup_path}/server/panel/data/db" ];then
|
||||||
mv -f ${setup_path}/server/panel/data/db/ ${setup_path}/server/panel/old_data/
|
\cp -r ${setup_path}/server/panel/data/db ${setup_path}/server/panel/old_data/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
@@ -732,8 +743,8 @@ Install_Bt(){
|
|||||||
mv -f ${setup_path}/server/panel/old_data/port.pl ${setup_path}/server/panel/data/port.pl
|
mv -f ${setup_path}/server/panel/old_data/port.pl ${setup_path}/server/panel/data/port.pl
|
||||||
mv -f ${setup_path}/server/panel/old_data/admin_path.pl ${setup_path}/server/panel/data/admin_path.pl
|
mv -f ${setup_path}/server/panel/old_data/admin_path.pl ${setup_path}/server/panel/data/admin_path.pl
|
||||||
|
|
||||||
if [ -f "${setup_path}/server/panel/old_data/db/default.db" ];then
|
if [ -d "${setup_path}/server/panel/old_data/db" ];then
|
||||||
mv -f ${setup_path}/server/panel/old_data/db/ ${setup_path}/server/panel/data/db
|
\cp -r ${setup_path}/server/panel/old_data/db ${setup_path}/server/panel/data/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d "/${setup_path}/server/panel/old_data" ];then
|
if [ -d "/${setup_path}/server/panel/old_data" ];then
|
||||||
@@ -819,6 +830,7 @@ Set_Bt_Panel(){
|
|||||||
btpip uninstall enum34 -y
|
btpip uninstall enum34 -y
|
||||||
btpip install geoip2==4.7.0
|
btpip install geoip2==4.7.0
|
||||||
btpip install brotli
|
btpip install brotli
|
||||||
|
btpip install PyMySQL
|
||||||
fi
|
fi
|
||||||
auth_path=$(cat ${admin_auth})
|
auth_path=$(cat ${admin_auth})
|
||||||
cd ${setup_path}/server/panel/
|
cd ${setup_path}/server/panel/
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -47,7 +47,7 @@ download_Url=$NODE_URL
|
|||||||
setup_path=/www
|
setup_path=/www
|
||||||
version=$(curl -Ss --connect-timeout 5 -m 2 $Btapi_Url/api/panel/get_version)
|
version=$(curl -Ss --connect-timeout 5 -m 2 $Btapi_Url/api/panel/get_version)
|
||||||
if [ "$version" = '' ];then
|
if [ "$version" = '' ];then
|
||||||
version='8.0.5'
|
version='8.2.0'
|
||||||
fi
|
fi
|
||||||
armCheck=$(uname -m|grep arm)
|
armCheck=$(uname -m|grep arm)
|
||||||
if [ "${armCheck}" ];then
|
if [ "${armCheck}" ];then
|
||||||
@@ -79,13 +79,18 @@ rm -f /www/server/panel/*.pyc
|
|||||||
rm -f /www/server/panel/class/*.pyc
|
rm -f /www/server/panel/class/*.pyc
|
||||||
#pip install flask_sqlalchemy
|
#pip install flask_sqlalchemy
|
||||||
#pip install itsdangerous==0.24
|
#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)
|
request_v=$(btpip list 2>/dev/null|grep "requests "|awk '{print $2}'|cut -d '.' -f 2)
|
||||||
if [ "$request_v" = "" ] || [ "${request_v}" -gt "28" ];then
|
if [ "$request_v" = "" ] || [ "${request_v}" -gt "28" ];then
|
||||||
$mypip install requests==2.27.1
|
$mypip install requests==2.27.1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
NATSORT_C=$(echo $pip_list|grep natsort)
|
||||||
|
if [ -z "${NATSORT_C}" ];then
|
||||||
|
btpip install natsort
|
||||||
|
fi
|
||||||
|
|
||||||
openssl_v=$(echo "$pip_list"|grep pyOpenSSL)
|
openssl_v=$(echo "$pip_list"|grep pyOpenSSL)
|
||||||
if [ "$openssl_v" = "" ];then
|
if [ "$openssl_v" = "" ];then
|
||||||
$mypip install pyOpenSSL
|
$mypip install pyOpenSSL
|
||||||
@@ -110,9 +115,35 @@ if [ -z "$BROTLI_C" ]; then
|
|||||||
btpip install brotli
|
btpip install brotli
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
PYMYSQL_C=$(btpip list 2> /dev/null |grep PyMySQL)
|
||||||
|
if [ -z "$PYMYSQL_C" ]; then
|
||||||
|
btpip install PyMySQL
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
PY_CRPYT=$(btpip list 2> /dev/null |grep cryptography|awk '{print $2}'|cut -f 1 -d '.')
|
||||||
|
if [ "${PY_CRPYT}" -le "10" ];then
|
||||||
|
btpip install pyOpenSSL==24.1.0
|
||||||
|
btpip install cryptography==42.0.5
|
||||||
|
fi
|
||||||
|
|
||||||
|
PYMYSQL_SSL_CHECK=$(btpython -c "import pymysql" 2>&1|grep "AttributeError: module 'cryptography.hazmat.bindings._rust.openssl'")
|
||||||
|
if [ "${PYMYSQL_SSL_CHECK}" ];then
|
||||||
|
btpip uninstall pyopenssl cryptography -y
|
||||||
|
btpip install pyopenssl cryptography
|
||||||
|
fi
|
||||||
|
|
||||||
btpip uninstall enum34 -y
|
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)
|
pymysql=$(echo "$pip_list"|grep pycryptodome)
|
||||||
if [ "$pymysql" = "" ];then
|
if [ "$pymysql" = "" ];then
|
||||||
@@ -122,6 +153,11 @@ fi
|
|||||||
echo "修复面板依赖完成!"
|
echo "修复面板依赖完成!"
|
||||||
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.')
|
#psutil=$(echo "$pip_list"|grep psutil|awk '{print $2}'|grep '5.7.')
|
||||||
#if [ "$psutil" = "" ];then
|
#if [ "$psutil" = "" ];then
|
||||||
# $mypip install -U psutil
|
# $mypip install -U psutil
|
||||||
|
Binary file not shown.
@@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
- 全局搜索替换 https://download.bt.cn/install/update6.sh => http://www.example.com/install/update6.sh
|
- 全局搜索替换 https://download.bt.cn/install/update6.sh => http://www.example.com/install/update6.sh
|
||||||
|
|
||||||
|
- 搜索并删除提交异常报告的代码 bt_error/index.php
|
||||||
|
|
||||||
- class/ajax.py 文件 \# 是否执行升级程序 下面的 public.get_url() 改成 public.GetConfigValue('home')
|
- class/ajax.py 文件 \# 是否执行升级程序 下面的 public.get_url() 改成 public.GetConfigValue('home')
|
||||||
|
|
||||||
class/jobs.py 文件 \#尝试升级到独立环境 下面的 public.get_url() 改成 public.GetConfigValue('home')
|
class/jobs.py 文件 \#尝试升级到独立环境 下面的 public.get_url() 改成 public.GetConfigValue('home')
|
||||||
@@ -42,6 +44,8 @@
|
|||||||
|
|
||||||
在 def check_domain_cloud(domain): 这一行下面加上 return
|
在 def check_domain_cloud(domain): 这一行下面加上 return
|
||||||
|
|
||||||
|
在 def err_collect 这一行下面加上 return
|
||||||
|
|
||||||
在 def get_improvement(): 这一行下面加上 return False
|
在 def get_improvement(): 这一行下面加上 return False
|
||||||
|
|
||||||
在free_login_area方法内get_free_ips_area替换成get_ips_area
|
在free_login_area方法内get_free_ips_area替换成get_ips_area
|
||||||
@@ -61,17 +65,26 @@
|
|||||||
temp_file = temp_file.replace('https://download.bt.cn/install/public.sh', 'http://www.example.com/install/public.sh')
|
temp_file = temp_file.replace('https://download.bt.cn/install/public.sh', 'http://www.example.com/install/public.sh')
|
||||||
```
|
```
|
||||||
|
|
||||||
|
def check_status(self, softInfo): 方法最后一行加上
|
||||||
|
|
||||||
|
```python
|
||||||
|
if 'endtime' in softInfo:
|
||||||
|
softInfo['endtime'] = time.time() + 86400 * 3650
|
||||||
|
```
|
||||||
|
|
||||||
- class/plugin_deployment.py 文件,SetupPackage方法内替换 public.GetConfigValue('home') => 'https://www.bt.cn'
|
- class/plugin_deployment.py 文件,SetupPackage方法内替换 public.GetConfigValue('home') => 'https://www.bt.cn'
|
||||||
|
|
||||||
- class/config.py 文件,get_nps方法内data['nps'] = False改成True,get_nps_new方法下面加上 return public.returnMsg(False, "获取问卷失败")
|
- class/config.py 文件,get_nps方法内data['nps'] = False改成True,get_nps_new方法下面加上 return public.returnMsg(False, "获取问卷失败")
|
||||||
|
|
||||||
|
def err_collection(self, get): 这一行下面加上 return public.returnMsg(True, "OK")
|
||||||
|
|
||||||
- script/flush_plugin.py 文件,删除clear_hosts()一行
|
- script/flush_plugin.py 文件,删除clear_hosts()一行
|
||||||
|
|
||||||
- script/reload_check.py 文件,在第2行插入sys.exit()
|
- script/reload_check.py 文件,在第2行插入sys.exit()
|
||||||
|
|
||||||
- script/local_fix.sh 文件,${D_NODE_URL}替换成www.example.com
|
- script/local_fix.sh 文件,${D_NODE_URL}替换成www.example.com
|
||||||
|
|
||||||
- tools.py 文件,u_input == 16下面的public.get_url()替换成'http://www.example.com'
|
- tools.py 文件,u_input == 16下面的public.get_url()替换成public.GetConfigValue('home')
|
||||||
|
|
||||||
- install/install_soft.sh 在. 执行之前加入以下代码
|
- install/install_soft.sh 在. 执行之前加入以下代码
|
||||||
|
|
||||||
@@ -120,10 +133,10 @@
|
|||||||
|
|
||||||
- [可选]关闭自动生成访问日志:在 BTPanel/\_\_init\_\_.py 删除public.write_request_log这一行
|
- [可选]关闭自动生成访问日志:在 BTPanel/\_\_init\_\_.py 删除public.write_request_log这一行
|
||||||
|
|
||||||
- [可选]删除小图标广告:在BTPanel/static/js/site.js,删除“WAF防火墙”对应的span标签
|
|
||||||
|
|
||||||
- [可选]上传文件默认选中覆盖,在BTPanel/static/js/upload-drog.js,id="all_operation"加checked属性
|
- [可选]上传文件默认选中覆盖,在BTPanel/static/js/upload-drog.js,id="all_operation"加checked属性
|
||||||
|
|
||||||
|
- [可选]新版vite页面去除需求反馈、各种广告、计算题等,执行 php think cleanvitejs <面板BTPanel/static/vite/js路径>
|
||||||
|
|
||||||
|
|
||||||
解压安装包[panel6.zip](http://download.bt.cn/install/src/panel6.zip),将更新包改好的文件覆盖到里面,然后重新打包,即可更新安装包。(
|
解压安装包[panel6.zip](http://download.bt.cn/install/src/panel6.zip),将更新包改好的文件覆盖到里面,然后重新打包,即可更新安装包。(
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user