mirror of
https://github.com/flucont/btcloud.git
synced 2025-10-16 07:40:28 +00:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a929080b3f | ||
![]() |
ba7e07f18a | ||
![]() |
25292b8e34 | ||
![]() |
d80c0e9e44 | ||
![]() |
247e486181 | ||
![]() |
d856d3bc1c | ||
![]() |
e304e9acc2 |
@@ -73,6 +73,7 @@ class CleanViteJs extends Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(substr($content,$start-1,1) == ',') $start--;
|
if(substr($content,$start-1,1) == ',') $start--;
|
||||||
|
else if(substr($content,$end+1,1) == ',') $end++;
|
||||||
return substr($content, $start, $end - $start + 1);
|
return substr($content, $start, $end - $start + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,6 +91,14 @@ class CleanViteJs extends Command
|
|||||||
closedir($dh);
|
closedir($dh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function str_replace_once($needle, $replace, $haystack) {
|
||||||
|
$pos = strpos($haystack, $needle);
|
||||||
|
if ($pos === false) {
|
||||||
|
return $haystack;
|
||||||
|
}
|
||||||
|
return substr_replace($haystack, $replace, $pos, strlen($needle));
|
||||||
|
}
|
||||||
|
|
||||||
private function handlefile($filepath){
|
private function handlefile($filepath){
|
||||||
$file = file_get_contents($filepath);
|
$file = file_get_contents($filepath);
|
||||||
@@ -129,13 +138,10 @@ class CleanViteJs extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(strpos($file, '"calc"') !== false && strpos($file, '"checkConfirm"') !== false){ //main2
|
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('!,isCalc:\w+,isInput:\w+,!', ',isCalc:!1,isInput:!1,', $file);
|
||||||
$file = preg_replace('!\w+\(\(\(\)=>"calc"===\w+\.type\|\|"checkConfirm"===\w+\.type\)\)!', '!1', $file);
|
$file = preg_replace('!"calc"===\w+\.type!', '!1', $file);
|
||||||
$file = preg_replace('!\w+\(\(\(\)=>"input"===\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"input"===\w+\.type\}\)\)!', '!1', $file);
|
||||||
$file = preg_replace('!\w+\(\(function\(\)\{return"check"===\w+\.type\|\|"checkConfirm"===\w+\.type\}\)\)!', '!1', $file);
|
|
||||||
$flag = true;
|
$flag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,13 +158,13 @@ class CleanViteJs extends Command
|
|||||||
$flag = true;
|
$flag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if(strpos($file, '"bt-waf-gray"')!==false){ //site.popup
|
if(strpos($file, 'svgtofont-left-waf')!==false){ //site.table
|
||||||
$code = $this->getExtendCode($file, '"bt-waf-gray"', 2);
|
$code = $this->getExtendCode($file, 'svgtofont-left-waf');
|
||||||
$code = $this->getExtendCode($file, $code, 1, '[', ']');
|
$code = $this->getExtendCode($file, $code, 1, '[', ']');
|
||||||
$code = $this->getExtendFunction($file, $code);
|
$code = $this->getExtendFunction($file, $code);
|
||||||
$file = str_replace($code, '""', $file);
|
$file = str_replace($code, '""', $file);
|
||||||
$flag = true;
|
$flag = true;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
if(strpos($file, '"商用SSL证书"')!==false){ //site-ssl
|
if(strpos($file, '"商用SSL证书"')!==false){ //site-ssl
|
||||||
$code = $this->getExtendFunction($file, '"商用SSL证书"', '{', '}');
|
$code = $this->getExtendFunction($file, '"商用SSL证书"', '{', '}');
|
||||||
@@ -167,6 +173,7 @@ class CleanViteJs extends Command
|
|||||||
$file = str_replace($code, '', $file);
|
$file = str_replace($code, '', $file);
|
||||||
$file = str_replace('"currentCertInfo":"busSslList"', '"currentCertInfo":"currentCertInfo"', $file);
|
$file = str_replace('"currentCertInfo":"busSslList"', '"currentCertInfo":"currentCertInfo"', $file);
|
||||||
$file = preg_replace('!\{(\w+)\.value="busSslList",\w+\(\)\}!', '{$1.value="letsEncryptList"}', $file);
|
$file = preg_replace('!\{(\w+)\.value="busSslList",\w+\(\)\}!', '{$1.value="letsEncryptList"}', $file);
|
||||||
|
$file = preg_replace('!defaultActive:(\w+)\("sslCertificate"\)!', 'defaultActive:$1("EncryptCertificate")', $file);
|
||||||
$flag = true;
|
$flag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,9 +212,9 @@ class CleanViteJs extends Command
|
|||||||
$code = $this->getExtendFunction($file, $code);
|
$code = $this->getExtendFunction($file, $code);
|
||||||
$start = strpos($file, $code);
|
$start = strpos($file, $code);
|
||||||
if(substr($file,$start-1,1) == ':'){
|
if(substr($file,$start-1,1) == ':'){
|
||||||
$file = str_replace($code, '{}', $file);
|
$file = $this->str_replace_once($code, '{}', $file);
|
||||||
}else{
|
}else{
|
||||||
$file = str_replace($code, '', $file);
|
$file = $this->str_replace_once($code, '', $file);
|
||||||
}
|
}
|
||||||
$flag = true;
|
$flag = true;
|
||||||
}
|
}
|
||||||
|
@@ -139,6 +139,18 @@ class Api extends BaseController
|
|||||||
return $version;
|
return $version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function get_panel_version(){
|
||||||
|
$version = config_get('new_version');
|
||||||
|
$file = app()->getRootPath().'public/install/update/LinuxPanel-'.$version.'.zip';
|
||||||
|
$hash = hash_file('sha256', $file);
|
||||||
|
$data = [
|
||||||
|
'version' => $version,
|
||||||
|
'hash' => $hash,
|
||||||
|
'update_time' => filemtime($file),
|
||||||
|
];
|
||||||
|
return json($data);
|
||||||
|
}
|
||||||
|
|
||||||
//安装统计
|
//安装统计
|
||||||
public function setup_count(){
|
public function setup_count(){
|
||||||
return 'ok';
|
return 'ok';
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
Linux_Version="9.1.0"
|
Linux_Version="9.2.0"
|
||||||
Windows_Version="8.1.0"
|
Windows_Version="8.2.0"
|
||||||
Btm_Version="2.3.0"
|
Btm_Version="2.3.0"
|
||||||
|
|
||||||
FILES=(
|
FILES=(
|
||||||
|
@@ -217,7 +217,7 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script src="{$cdnpublic}jquery/2.1.4/jquery.min.js"></script>
|
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/2.1.4/jquery.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
$('form').on('submit', function (e) {
|
$('form').on('submit', function (e) {
|
||||||
|
@@ -12,9 +12,9 @@ INSERT INTO `cloud_config` (`key`, `value`) VALUES
|
|||||||
('bt_key', ''),
|
('bt_key', ''),
|
||||||
('whitelist', '0'),
|
('whitelist', '0'),
|
||||||
('download_page', '1'),
|
('download_page', '1'),
|
||||||
('new_version', '9.1.0'),
|
('new_version', '9.2.0'),
|
||||||
('update_msg', '暂无更新日志'),
|
('update_msg', '暂无更新日志'),
|
||||||
('update_date', '2024-07-15'),
|
('update_date', '2024-09-13'),
|
||||||
('new_version_win', '8.1.0'),
|
('new_version_win', '8.1.0'),
|
||||||
('update_msg_win', '暂无更新日志'),
|
('update_msg_win', '暂无更新日志'),
|
||||||
('update_date_win', '2024-07-17'),
|
('update_date_win', '2024-07-17'),
|
||||||
@@ -48,7 +48,7 @@ CREATE TABLE `cloud_white` (
|
|||||||
DROP TABLE IF EXISTS `cloud_record`;
|
DROP TABLE IF EXISTS `cloud_record`;
|
||||||
CREATE TABLE `cloud_record` (
|
CREATE TABLE `cloud_record` (
|
||||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`ip` varchar(200) NOT NULL,
|
`ip` varchar(20) NOT NULL,
|
||||||
`addtime` datetime NOT NULL,
|
`addtime` datetime NOT NULL,
|
||||||
`usetime` datetime NOT NULL,
|
`usetime` datetime NOT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
|
@@ -23,6 +23,44 @@ if [ "${is64bit}" != '64' ];then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Ready_Check(){
|
||||||
|
WWW_DISK_SPACE=$(df |grep /www|awk '{print $4}')
|
||||||
|
ROOT_DISK_SPACE=$(df |grep /$|awk '{print $4}')
|
||||||
|
|
||||||
|
if [ "${ROOT_DISK_SPACE}" -le 412000 ];then
|
||||||
|
df -h
|
||||||
|
echo -e "系统盘剩余空间不足400M 无法继续安装宝塔面板!"
|
||||||
|
echo -e "请尝试清理磁盘空间后再重新进行安装"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ "${WWW_DISK_SPACE}" ] && [ "${WWW_DISK_SPACE}" -le 412000 ] ;then
|
||||||
|
echo -e "/www盘剩余空间不足400M 无法继续安装宝塔面板!"
|
||||||
|
echo -e "请尝试清理磁盘空间后再重新进行安装"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ROOT_DISK_INODE=$(df -i|grep /$|awk '{print $2}')
|
||||||
|
if [ "${ROOT_DISK_INODE}" != "0" ];then
|
||||||
|
ROOT_DISK_INODE_FREE=$(df -i|grep /$|awk '{print $4}')
|
||||||
|
if [ "${ROOT_DISK_INODE_FREE}" -le 1000 ];then
|
||||||
|
echo -e "系统盘剩余inodes空间不足1000,无法继续安装!"
|
||||||
|
echo -e "请尝试清理磁盘空间后再重新进行安装"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
WWW_DISK_INODE==$(df -i|grep /www|awk '{print $2}')
|
||||||
|
if [ "${WWW_DISK_INODE}" ] && [ "${WWW_DISK_INODE}" != "0" ] ;then
|
||||||
|
WWW_DISK_INODE_FREE=$(df -i|grep /www|awk '{print $4}')
|
||||||
|
if [ "${WWW_DISK_INODE_FREE}" ] && [ "${WWW_DISK_INODE_FREE}" -le 1000 ] ;then
|
||||||
|
echo -e "/www盘剩余inodes空间不足1000, 无法继续安装!"
|
||||||
|
echo -e "请尝试清理磁盘空间后再重新进行安装"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Centos6Check=$(cat /etc/redhat-release | grep ' 6.' | grep -iE 'centos|Red Hat')
|
Centos6Check=$(cat /etc/redhat-release | grep ' 6.' | grep -iE 'centos|Red Hat')
|
||||||
if [ "${Centos6Check}" ];then
|
if [ "${Centos6Check}" ];then
|
||||||
echo "Centos6不支持安装宝塔面板,请更换Centos7/8安装宝塔面板"
|
echo "Centos6不支持安装宝塔面板,请更换Centos7/8安装宝塔面板"
|
||||||
@@ -235,6 +273,12 @@ Set_Centos7_Repo(){
|
|||||||
tar -xvzf el7repo.tar.gz -C /etc/yum.repos.d/
|
tar -xvzf el7repo.tar.gz -C /etc/yum.repos.d/
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
yum install unzip -y
|
||||||
|
if [ "$?" != "0" ] ;then
|
||||||
|
sed -i "s/vault.epel.cloud/mirrors.cloud.tencent.com/g" /etc/yum.repos.d/*.repo
|
||||||
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
# Set_Centos7_Repo(){
|
# Set_Centos7_Repo(){
|
||||||
# if [ -z "${download_Url}" ];then
|
# if [ -z "${download_Url}" ];then
|
||||||
@@ -280,6 +324,10 @@ Set_Centos8_Repo(){
|
|||||||
rm -f /etc/yum.repos.d/*.repo
|
rm -f /etc/yum.repos.d/*.repo
|
||||||
tar -xvzf el8repo.tar.gz -C /etc/yum.repos.d/
|
tar -xvzf el8repo.tar.gz -C /etc/yum.repos.d/
|
||||||
fi
|
fi
|
||||||
|
yum install unzip -y
|
||||||
|
if [ "$?" != "0" ] ;then
|
||||||
|
sed -i "s/vault.epel.cloud/mirrors.cloud.tencent.com/g" /etc/yum.repos.d/*.repo
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
get_node_url(){
|
get_node_url(){
|
||||||
if [ ! -f /bin/curl ];then
|
if [ ! -f /bin/curl ];then
|
||||||
@@ -1090,6 +1138,7 @@ Setup_Count(){
|
|||||||
echo /www > /var/bt_setupPath.conf
|
echo /www > /var/bt_setupPath.conf
|
||||||
}
|
}
|
||||||
Install_Main(){
|
Install_Main(){
|
||||||
|
Ready_Check
|
||||||
#Set_Ssl
|
#Set_Ssl
|
||||||
startTime=`date +%s`
|
startTime=`date +%s`
|
||||||
Lock_Clear
|
Lock_Clear
|
||||||
|
Binary file not shown.
Binary file not shown.
@@ -18,17 +18,18 @@ if [ ! -f "/www/server/panel/pyenv/bin/python3" ];then
|
|||||||
echo "请截图发帖至论坛www.bt.cn/bbs求助"
|
echo "请截图发帖至论坛www.bt.cn/bbs求助"
|
||||||
exit 0;
|
exit 0;
|
||||||
fi
|
fi
|
||||||
Centos6Check=$(cat /etc/redhat-release | grep ' 6.' | grep -iE 'centos|Red Hat')
|
|
||||||
if [ "${Centos6Check}" ];then
|
|
||||||
echo "Centos6不支持升级宝塔面板,建议备份数据重装更换Centos7/8安装宝塔面板"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
if [ -f "/etc/redhat-release" ];then
|
||||||
Centos8Check=$(cat /etc/redhat-release | grep ' 8.' | grep -iE 'centos|Red Hat')
|
Centos6Check=$(cat /etc/redhat-release | grep ' 6.' | grep -iE 'centos|Red Hat')
|
||||||
if [ "${Centos8Check}" ];then
|
if [ "${Centos6Check}" ];then
|
||||||
if [ ! -f "/usr/bin/python" ] && [ -f "/usr/bin/python3" ] && [ ! -d "/www/server/panel/pyenv" ]; then
|
echo "Centos6不支持升级宝塔面板,建议备份数据重装更换Centos7/8安装宝塔面板"
|
||||||
ln -sf /usr/bin/python3 /usr/bin/python
|
exit 1
|
||||||
|
fi
|
||||||
|
Centos8Check=$(cat /etc/redhat-release | grep ' 8.' | grep -iE 'centos|Red Hat')
|
||||||
|
if [ "${Centos8Check}" ];then
|
||||||
|
if [ ! -f "/usr/bin/python" ] && [ -f "/usr/bin/python3" ] && [ ! -d "/www/server/panel/pyenv" ]; then
|
||||||
|
ln -sf /usr/bin/python3 /usr/bin/python
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -48,10 +49,61 @@ fi
|
|||||||
|
|
||||||
download_Url=$D_NODE_URL
|
download_Url=$D_NODE_URL
|
||||||
|
|
||||||
|
|
||||||
|
Set_Centos7_Repo(){
|
||||||
|
if [ -f "/etc/yum.repos.d/docker-ce.repo" ];then
|
||||||
|
mv /etc/yum.repos.d/docker-ce.repo /etc/yum.repos.d/docker-ce.repo_backup
|
||||||
|
fi
|
||||||
|
MIRROR_CHECK=$(cat /etc/yum.repos.d/CentOS-Base.repo |grep "[^#]mirror.centos.org")
|
||||||
|
if [ "${MIRROR_CHECK}" ] && [ "${is64bit}" == "64" ];then
|
||||||
|
\cp -rpa /etc/yum.repos.d/ /etc/yumBak
|
||||||
|
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*.repo
|
||||||
|
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.epel.cloud|g' /etc/yum.repos.d/CentOS-*.repo
|
||||||
|
fi
|
||||||
|
|
||||||
|
TSU_MIRROR_CHECK=$(cat /etc/yum.repos.d/CentOS-Base.repo |grep "tuna.tsinghua.edu.cn")
|
||||||
|
if [ "${TSU_MIRROR_CHECK}" ];then
|
||||||
|
\cp -rpa /etc/yum.repos.d/ /etc/yumBak
|
||||||
|
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*.repo
|
||||||
|
sed -i 's|#baseurl=https://mirrors.tuna.tsinghua.edu.cn|baseurl=http://vault.epel.cloud|g' /etc/yum.repos.d/CentOS-*.repo
|
||||||
|
sed -i 's|#baseurl=http://mirrors.tuna.tsinghua.edu.cn|baseurl=http://vault.epel.cloud|g' /etc/yum.repos.d/CentOS-*.repo
|
||||||
|
fi
|
||||||
|
|
||||||
|
ALI_CLOUD_CHECK=$(grep Alibaba /etc/motd)
|
||||||
|
Tencent_Cloud=$(cat /etc/hostname |grep -E VM-[0-9]+-[0-9]+)
|
||||||
|
if [ "${ALI_CLOUD_CHECK}" ] || [ "${Tencent_Cloud}" ];then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
yum install tree -y
|
||||||
|
if [ "$?" != "0" ] ;then
|
||||||
|
TAR_CHECK=$(which tree)
|
||||||
|
if [ "$?" == "0" ] ;then
|
||||||
|
\cp -rpa /etc/yum.repos.d/ /etc/yumBak
|
||||||
|
if [ -z "${download_Url}" ];then
|
||||||
|
download_Url="http://download.bt.cn"
|
||||||
|
fi
|
||||||
|
curl -Ss --connect-timeout 5 -m 60 -O ${download_Url}/src/el7repo.tar.gz
|
||||||
|
rm -f /etc/yum.repos.d/*.repo
|
||||||
|
tar -xvzf el7repo.tar.gz -C /etc/yum.repos.d/
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
yum install tree -y
|
||||||
|
if [ "$?" != "0" ] ;then
|
||||||
|
sed -i "s/vault.epel.cloud/mirrors.cloud.tencent.com/g" /etc/yum.repos.d/*.repo
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
if [ -f "/etc/redhat-release" ];then
|
||||||
|
Centos7Check=$(cat /etc/redhat-release | grep ' 7.' | grep -iE 'centos|Red Hat')
|
||||||
|
if [ "${Centos7Check}" ];then
|
||||||
|
Set_Centos7_Repo
|
||||||
|
fi
|
||||||
|
fi
|
||||||
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 [ -z "$VERSION_CHECK" ];then
|
if [ -z "$VERSION_CHECK" ];then
|
||||||
version='9.1.0'
|
version='9.2.0'
|
||||||
fi
|
fi
|
||||||
armCheck=$(uname -m|grep arm)
|
armCheck=$(uname -m|grep arm)
|
||||||
if [ "${armCheck}" ];then
|
if [ "${armCheck}" ];then
|
||||||
@@ -144,10 +196,10 @@ if [ -z "${GEOIP_C}" ];then
|
|||||||
btpip install geoip2==4.7.0
|
btpip install geoip2==4.7.0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PANDAS_C=$(echo $pip_list|grep pandas)
|
# PANDAS_C=$(echo $pip_list|grep pandas)
|
||||||
if [ -z "${PANDAS_C}" ];then
|
# if [ -z "${PANDAS_C}" ];then
|
||||||
btpip install pandas
|
# btpip install pandas
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
pymysql=$(echo "$pip_list"|grep pycryptodome)
|
pymysql=$(echo "$pip_list"|grep pycryptodome)
|
||||||
if [ "$pymysql" = "" ];then
|
if [ "$pymysql" = "" ];then
|
||||||
|
Binary file not shown.
Binary file not shown.
@@ -39,6 +39,7 @@ Route::group('api', function () {
|
|||||||
Route::get('/getUpdateLogs', 'api/get_update_logs');
|
Route::get('/getUpdateLogs', 'api/get_update_logs');
|
||||||
Route::get('/panel/get_version', 'api/get_version');
|
Route::get('/panel/get_version', 'api/get_version');
|
||||||
Route::get('/wpanel/get_version', 'api/get_version_win');
|
Route::get('/wpanel/get_version', 'api/get_version_win');
|
||||||
|
Route::get('/panel/get_panel_version', 'api/get_panel_version');
|
||||||
Route::get('/SetupCount', 'api/setup_count');
|
Route::get('/SetupCount', 'api/setup_count');
|
||||||
Route::any('/panel/updateLinux', 'api/check_update');
|
Route::any('/panel/updateLinux', 'api/check_update');
|
||||||
Route::any('/wpanel/updateWindows', 'api/check_update_win');
|
Route::any('/wpanel/updateWindows', 'api/check_update_win');
|
||||||
@@ -123,6 +124,9 @@ Route::group('api', function () {
|
|||||||
Route::post('/Auth/SetSocre', 'api/get_ssl_list');
|
Route::post('/Auth/SetSocre', 'api/get_ssl_list');
|
||||||
Route::post('/Auth/SubmitScore', 'api/get_ssl_list');
|
Route::post('/Auth/SubmitScore', 'api/get_ssl_list');
|
||||||
|
|
||||||
|
Route::post('/Cert_cloud_deploy/get_cert_list', 'api/return_success');
|
||||||
|
Route::post('/Cert_cloud_deploy/del_cert', 'api/return_success');
|
||||||
|
|
||||||
Route::miss('api/return_error');
|
Route::miss('api/return_error');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -40,50 +40,43 @@ def plugin_run(plugin_name,def_name,args):
|
|||||||
# 添加插件目录到系统路径
|
# 添加插件目录到系统路径
|
||||||
public.sys_path_append(plugin_path)
|
public.sys_path_append(plugin_path)
|
||||||
|
|
||||||
try:
|
if not is_php:
|
||||||
if not is_php:
|
# 引用插件入口文件
|
||||||
# 引用插件入口文件
|
_name = "{}_main".format(plugin_name)
|
||||||
_name = "{}_main".format(plugin_name)
|
plugin_main = __import__(_name)
|
||||||
plugin_main = __import__(_name)
|
|
||||||
|
|
||||||
# 检查类名是否符合规范
|
# 检查类名是否符合规范
|
||||||
if not hasattr(plugin_main,_name):
|
if not hasattr(plugin_main,_name):
|
||||||
return public.returnMsg(False,'指定插件入口文件不符合规范')
|
return public.returnMsg(False,'指定插件入口文件不符合规范')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if sys.version_info[0] == 2:
|
if sys.version_info[0] == 2:
|
||||||
reload(plugin_main)
|
reload(plugin_main)
|
||||||
else:
|
else:
|
||||||
from imp import reload
|
from imp import reload
|
||||||
reload(plugin_main)
|
reload(plugin_main)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# 实例化插件类
|
# 实例化插件类
|
||||||
plugin_obj = getattr(plugin_main,_name)()
|
plugin_obj = getattr(plugin_main,_name)()
|
||||||
|
|
||||||
# 检查方法是否存在
|
# 检查方法是否存在
|
||||||
if not hasattr(plugin_obj,def_name):
|
if not hasattr(plugin_obj,def_name):
|
||||||
return public.returnMsg(False,'在[%s]插件中找不到[%s]方法' % (plugin_name,def_name))
|
return public.returnMsg(False,'在[%s]插件中找不到[%s]方法' % (plugin_name,def_name))
|
||||||
|
|
||||||
if 'plugin_get_object' in args and args.plugin_get_object == 1:
|
if args is not None and 'plugin_get_object' in args and args.plugin_get_object == 1:
|
||||||
return getattr(plugin_obj, def_name)
|
return getattr(plugin_obj, def_name)
|
||||||
|
|
||||||
# 执行方法
|
# 执行方法
|
||||||
return getattr(plugin_obj,def_name)(args)
|
return getattr(plugin_obj,def_name)(args)
|
||||||
else:
|
else:
|
||||||
if 'plugin_get_object' in args and args.plugin_get_object == 1:
|
if args is not None and 'plugin_get_object' in args and args.plugin_get_object == 1:
|
||||||
return None
|
return None
|
||||||
import panelPHP
|
import panelPHP
|
||||||
args.s = def_name
|
args.s = def_name
|
||||||
args.name = plugin_name
|
args.name = plugin_name
|
||||||
return panelPHP.panelPHP(plugin_name).exec_php_script(args)
|
return panelPHP.panelPHP(plugin_name).exec_php_script(args)
|
||||||
|
|
||||||
except SyntaxError as ex:
|
|
||||||
return public.returnMsg(False,'指定插件不兼容当前操作系统')
|
|
||||||
except Exception as ex:
|
|
||||||
public.print_error()
|
|
||||||
return public.returnMsg(False,'指定插件不存在')
|
|
||||||
|
|
||||||
|
|
||||||
def get_module_list():
|
def get_module_list():
|
||||||
@@ -114,26 +107,21 @@ def module_run(module_name,def_name,args):
|
|||||||
panel_path = public.get_panel_path()
|
panel_path = public.get_panel_path()
|
||||||
|
|
||||||
module_file = None
|
module_file = None
|
||||||
if model_index:
|
if 'model_index' in args:
|
||||||
# 新模块目录
|
# 新模块目录
|
||||||
if model_index in ['mod']:
|
if model_index in ['mod']:
|
||||||
_name = "{}Mod".format(module_name)
|
|
||||||
module_file = os.path.join(panel_path,'mod','project',module_name + 'Mod.py')
|
module_file = os.path.join(panel_path,'mod','project',module_name + 'Mod.py')
|
||||||
elif model_index:
|
elif model_index:
|
||||||
# 旧模块目录
|
# 旧模块目录
|
||||||
_name = "{}Model".format(module_name)
|
|
||||||
module_file = os.path.join(class_path,model_index+"Model",module_name + 'Model.py')
|
module_file = os.path.join(class_path,model_index+"Model",module_name + 'Model.py')
|
||||||
else:
|
else:
|
||||||
_name = "{}Model".format(module_name)
|
|
||||||
module_file = os.path.join(class_path,"projectModel",module_name + 'Model.py')
|
module_file = os.path.join(class_path,"projectModel",module_name + 'Model.py')
|
||||||
else:
|
else:
|
||||||
# 如果没指定模块名称,则遍历所有模块目录
|
# 如果没指定模块名称,则遍历所有模块目录
|
||||||
module_list = get_module_list()
|
module_list = get_module_list()
|
||||||
for name in module_list:
|
for name in module_list:
|
||||||
module_file = os.path.join(class_path,name,module_name + 'Model.py')
|
module_file = os.path.join(class_path,name,module_name + 'Model.py')
|
||||||
if os.path.exists(module_file):
|
if os.path.exists(module_file): break
|
||||||
_name = "{}Model".format(module_name)
|
|
||||||
break
|
|
||||||
|
|
||||||
# 判断模块入口文件是否存在
|
# 判断模块入口文件是否存在
|
||||||
if not os.path.exists(module_file):
|
if not os.path.exists(module_file):
|
||||||
@@ -143,32 +131,22 @@ def module_run(module_name,def_name,args):
|
|||||||
if not public.path_safe_check(module_file):
|
if not public.path_safe_check(module_file):
|
||||||
return public.returnMsg(False,'模块路径不合法')
|
return public.returnMsg(False,'模块路径不合法')
|
||||||
|
|
||||||
public.sys_path_append(os.path.dirname(module_file))
|
def_object = public.get_script_object(module_file)
|
||||||
|
if not def_object: return public.returnMsg(False,'模块[%s]不存在' % module_name)
|
||||||
|
|
||||||
|
# 模块实例化并返回方法对象
|
||||||
try:
|
try:
|
||||||
# 引用模块入口文件
|
run_object = getattr(def_object.main(),def_name,None)
|
||||||
module_main = __import__(_name)
|
except:
|
||||||
|
return public.returnMsg(False,'模块[%s]入口实例化失败' % module_name)
|
||||||
|
if not run_object: return public.returnMsg(False,'在[%s]模块中找不到[%s]方法' % (module_name,def_name))
|
||||||
|
|
||||||
# 检查模块是否符合规范
|
if 'module_get_object' in args and args.module_get_object == 1:
|
||||||
if not hasattr(module_main,'main'):
|
return run_object
|
||||||
return public.returnMsg(False,'指定模块入口文件不符合规范')
|
|
||||||
|
# 执行方法
|
||||||
# 实例化模块类
|
result = run_object(args)
|
||||||
module_obj = getattr(module_main,'main')()
|
return result
|
||||||
|
|
||||||
# 检查方法是否存在
|
|
||||||
if not hasattr(module_obj,def_name):
|
|
||||||
return public.returnMsg(False,'在[%s]模块中找不到[%s]方法' % (module_name,def_name))
|
|
||||||
|
|
||||||
if 'module_get_object' in args and args.module_get_object == 1:
|
|
||||||
return getattr(module_obj,def_name)
|
|
||||||
|
|
||||||
# 执行方法
|
|
||||||
return getattr(module_obj,def_name)(args)
|
|
||||||
except SyntaxError as ex:
|
|
||||||
return public.returnMsg(False,'指定模块不兼容当前操作系统')
|
|
||||||
except Exception as ex:
|
|
||||||
public.print_error()
|
|
||||||
return public.returnMsg(False,'指定模块不存在')
|
|
||||||
|
|
||||||
|
|
||||||
def get_plugin_list(upgrade_force = False):
|
def get_plugin_list(upgrade_force = False):
|
||||||
|
@@ -20,6 +20,10 @@
|
|||||||
|
|
||||||
- 全局搜索替换 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
|
||||||
|
|
||||||
|
http://download.bt.cn/install/update6.sh => http://www.example.com/install/update6.sh
|
||||||
|
|
||||||
|
http://download.bt.cn/install/update/ => http://www.example.com/install/update/
|
||||||
|
|
||||||
- 搜索并删除提交异常报告的代码 bt_error/index.php
|
- 搜索并删除提交异常报告的代码 bt_error/index.php
|
||||||
|
|
||||||
- class/ajax.py 文件 \# 是否执行升级程序 下面的 public.get_url() 改成 public.GetConfigValue('home')
|
- class/ajax.py 文件 \# 是否执行升级程序 下面的 public.get_url() 改成 public.GetConfigValue('home')
|
||||||
@@ -72,7 +76,7 @@
|
|||||||
|
|
||||||
plugin_bin.pl 改成 plugin_list.json
|
plugin_bin.pl 改成 plugin_list.json
|
||||||
|
|
||||||
- class/plugin_deployment.py 文件,SetupPackage方法内替换 public.GetConfigValue('home') => 'https://www.bt.cn'
|
- class/plugin_deployment.py 文件,__setup_php_environment方法和GetJarPath方法内替换 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, "获取问卷失败")
|
||||||
|
|
||||||
@@ -119,6 +123,8 @@
|
|||||||
<script src="/static/bt.js"></script>
|
<script src="/static/bt.js"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
在 BTPanel/templates/default/software.html 的 \<script\>window.vite_public_request_token 前面加入
|
||||||
|
|
||||||
- [可选]去除创建网站自动创建的垃圾文件:在class/panelSite.py,分别删除
|
- [可选]去除创建网站自动创建的垃圾文件:在class/panelSite.py,分别删除
|
||||||
|
|
||||||
htaccess = self.sitePath + '/.htaccess'
|
htaccess = self.sitePath + '/.htaccess'
|
||||||
|
@@ -50,6 +50,8 @@ Windows版宝塔由于加密文件太多,无法全部解密,因此无法做
|
|||||||
|
|
||||||
删除 p = threading.Thread(target=update_software_list) 以及下面2行
|
删除 p = threading.Thread(target=update_software_list) 以及下面2行
|
||||||
|
|
||||||
|
- tools.py,删除#尝试删除本地hosts文件中的宝塔域名解析
|
||||||
|
|
||||||
- 去除面板日志上报:script/site_task.py 文件
|
- 去除面板日志上报:script/site_task.py 文件
|
||||||
|
|
||||||
- 删除最下面 logs_analysis() 这1行
|
- 删除最下面 logs_analysis() 这1行
|
||||||
|
Reference in New Issue
Block a user