Compare commits

...

20 Commits
2.2 ... 2.4.1

Author SHA1 Message Date
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
flucout
911a567fde update 2024-04-30 22:56:41 +08:00
flucout
b27349a416 update 2024-04-13 15:55:42 +08:00
flucout
def82c88cb Merge branch 'main' of ssh://ssh.github.com:443/flucont/btcloud 2024-03-17 21:00:26 +08:00
flucout
04028103c1 update 2024-03-17 20:59:45 +08:00
Flucont
d18cd84e29 Merge pull request #171 from XCwosjw/patch-1
update
2024-02-24 13:10:25 +08:00
XCwosjw
268f76f9ba 修复在IPV6下的异常报错
修复在IPV6下因ip长度问题而导致的的异常报错
2024-02-23 10:14:56 +08:00
flucout
7d32833431 update 2024-02-12 21:05:46 +08:00
flucout
6c6ad40836 update 2024-01-30 21:40:39 +08:00
flucout
11961b8f0b update 2024-01-20 21:42:10 +08:00
flucout
71db6b0a3e update 2024-01-17 18:13:08 +08:00
flucout
79fddbb943 update 2023-12-30 10:20:44 +08:00
flucout
f81cd68e80 update 2023-12-18 16:11:14 +08:00
flucout
4c76ec2056 update 2023-12-07 14:45:15 +08:00
flucout
ef99d79f1a update 2023-12-06 21:28:51 +08:00
39 changed files with 2584 additions and 2048 deletions

237
app/command/CleanViteJs.php Normal file
View File

@@ -0,0 +1,237 @@
<?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 = $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);
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";
}
}
}

View File

@@ -184,4 +184,44 @@ function errorlog($msg){
$handle = fopen(app()->getRootPath()."record.txt", 'a');
fwrite($handle, date('Y-m-d H:i:s')."\t".$msg."\r\n");
fclose($handle);
}
function licenseEncrypt($data, $key){
$iv = substr($key, 0, 16);
return openssl_encrypt($data, 'AES-256-CBC', $key, 0, $iv);
}
function licenseDecrypt($data, $key){
$iv = substr($key, 0, 16);
return openssl_decrypt($data, 'AES-256-CBC', $key, 0, $iv);
}
function generateKeyPairs(){
$pkey_dir = app()->getRootPath().'data/config/';
$public_key_path = $pkey_dir.'public_key.pem';
$private_key_path = $pkey_dir.'private_key.pem';
if(file_exists($public_key_path) && file_exists($private_key_path)){
return [file_get_contents($public_key_path), file_get_contents($private_key_path)];
}
$pkey_config = ['private_key_bits'=>4096];
$pkey_res = openssl_pkey_new($pkey_config);
$private_key = '';
openssl_pkey_export($pkey_res, $private_key, null, $pkey_config);
$pkey_details = openssl_pkey_get_details($pkey_res);
if(!$pkey_details) return false;
$public_key = $pkey_details['key'];
file_put_contents($public_key_path, $public_key);
file_put_contents($private_key_path, $private_key);
return [$public_key, $private_key];
}
function pemToBase64($pem){
$lines = explode("\n", $pem);
$encoded = '';
foreach ($lines as $line) {
if (trim($line) != '' && strpos($line, '-----BEGIN') === false && strpos($line, '-----END') === false) {
$encoded .= trim($line);
}
}
return $encoded;
}

View File

@@ -213,6 +213,26 @@ class Api extends BaseController
return json($data);
}
//宝塔云WAF最新版本
public function btwaf_latest_version(){
$type = input('?post.type') ? input('post.type') : 0;
if($type == 1){
$data = [
'version' => '1.1',
'description' => '暂无更新日志',
'create_time' => 1705315163,
];
}else{
$data = [
'version' => '3.0',
'description' => '暂无更新日志',
'create_time' => 1705315163,
];
}
$data = bin2hex(json_encode($data));
return json(['status'=>true,'err_no'=>0,'msg'=>'获取成功','data'=>$data]);
}
//获取内测版更新日志
public function get_beta_logs(){
return json(['beta_ps'=>'当前暂无内测版', 'list'=>[]]);
@@ -275,35 +295,67 @@ class Api extends BaseController
//绑定账号
public function get_auth_token(){
if(!$_POST['data']) return json(['status'=>false, 'msg'=>'参数不能为空']);
$reqData = hex2bin($_POST['data']);
if(!input('?post.data')) return json(['status'=>false, 'msg'=>'参数不能为空']);
$reqData = hex2bin(input('post.data'));
parse_str($reqData, $arr);
$serverid = $arr['serverid'];
$userinfo = ['uid'=>1, 'username'=>'Administrator', 'address'=>'127.0.0.1', 'serverid'=>$serverid, 'access_key'=>random(32), 'secret_key'=>random(48), 'ukey'=>md5(time()), 'state'=>1];
$data = bin2hex(urlencode(json_encode($userinfo)));
$userinfo = ['uid'=>1, 'username'=>'Administrator', 'address'=>'127.0.0.1', 'serverid'=>$serverid, 'access_key'=>random(48), 'secret_key'=>random(48), 'ukey'=>md5(time()), 'state'=>1];
$data = bin2hex(json_encode($userinfo));
return json(['status'=>true, 'msg'=>'登录成功!', 'data'=>$data]);
}
//绑定账号新
public function authorization_login(){
if(!$_POST['data']) return json(['status'=>false, 'msg'=>'参数不能为空']);
$reqData = hex2bin($_POST['data']);
if(!input('?post.data')) return json(['status'=>false, 'msg'=>'参数不能为空']);
$reqData = hex2bin(input('post.data'));
parse_str($reqData, $arr);
$serverid = $arr['serverid'];
$userinfo = ['uid'=>1, 'username'=>'Administrator', 'ip'=>'127.0.0.1', 'server_id'=>$serverid, 'access_key'=>random(32), 'secret_key'=>random(48)];
$data = bin2hex(urlencode(json_encode($userinfo)));
return json(['status'=>true, 'msg'=>'登录成功', 'data'=>$data]);
$userinfo = ['uid'=>1, 'username'=>'Administrator', 'ip'=>'127.0.0.1', 'server_id'=>$serverid, 'access_key'=>random(48), 'secret_key'=>random(48)];
$data = bin2hex(json_encode($userinfo));
return json(['status'=>true, 'err_no'=>0, 'msg'=>'账号绑定成功', 'data'=>$data]);
}
//刷新授权信息
public function authorization_info(){
if(!$_POST['data']) return json(['status'=>false, 'msg'=>'参数不能为空']);
$reqData = hex2bin($_POST['data']);
if(!input('?post.data')) return json(['status'=>false, 'msg'=>'参数不能为空']);
$reqData = hex2bin(input('post.data'));
parse_str($reqData, $arr);
$id = isset($arr['id'])&&$arr['id']>0?$arr['id']:1;
$userinfo = ['id'=>$id, 'product'=>$arr['product'], 'status'=>2, 'clients'=>9999, 'durations'=>0, 'end_time'=>strtotime('+10 year')];
$data = bin2hex(urlencode(json_encode($userinfo)));
return json(['status'=>true, 'data'=>$data]);
$data = bin2hex(json_encode($userinfo));
return json(['status'=>true, 'err_no'=>0, 'data'=>$data]);
}
//刷新授权信息
public function update_license(){
if(!input('?post.data')) return json(['status'=>false, 'msg'=>'参数不能为空']);
$reqData = hex2bin(input('post.data'));
parse_str($reqData, $arr);
if(!isset($arr['product']) || !isset($arr['serverid'])) return json(['status'=>false, 'msg'=>'缺少参数']);
$license_data = ['product'=>$arr['product'], 'uid'=>random(32), 'phone'=>'138****8888', 'auth_id'=>random(32), 'server_id'=>substr($arr['serverid'], 0, 32), 'auth'=>['apis'=>[], 'menu'=>[], 'extra'=>['type'=>3,'location'=>-1,'smart_cc'=>-1,'site'=>0]], 'pages'=>[], 'end_time'=>strtotime('+10 year')];
$json = json_encode($license_data);
[$public_key, $private_key] = generateKeyPairs();
$public_key = pemToBase64($public_key);
$key1 = random(32);
$key2 = substr($public_key, 0, 32);
$encrypted1 = licenseEncrypt($json, $key1);
$encrypted2 = licenseEncrypt($key1, $key2);
$sign_data = $encrypted1.'.'.$encrypted2;
openssl_sign($sign_data, $signature, $private_key, OPENSSL_ALGO_SHA256);
$signature = base64_encode($signature);
$license = base64_encode($sign_data.'.'.$signature);
$data = bin2hex(json_encode(['public_key'=>$public_key, 'license'=>$license]));
return json(['status'=>true, 'err_no'=>0, 'msg'=>'授权获取成功', 'data'=>$data]);
}
public function is_obtained_btw_trial(){
$data = ['is_obtained'=>0];
$data = bin2hex(json_encode($data));
return json(['status'=>true, 'err_no'=>0, 'data'=>$data, 'msg'=>'检测成功']);
}
//一键部署列表
@@ -344,6 +396,7 @@ class Api extends BaseController
return json(['page'=>"<div><span class='Pcurrent'>1</span><span class='Pnumber'>1/0</span><span class='Pline'>从1-1000条</span><span class='Pcount'>共计0条数据</span></div>", 'data'=>[]]);
}
//获取所有蜘蛛IP列表
public function btwaf_getspiders(){
try{
$result = Plugins::btwaf_getspiders();
@@ -353,6 +406,14 @@ class Api extends BaseController
}
}
//分类获取蜘蛛IP列表
public function get_spider(){
$type = input('get.spider/d');
if(!$type) return json([]);
$result = Plugins::get_spider($type);
return json($result);
}
//检查黑白名单
private function checklist(){
if(config_get('whitelist') == 1){
@@ -391,4 +452,16 @@ class Api extends BaseController
fclose($handle);
exit;
}
public function logerror(){
$content = date('Y-m-d H:i:s')."\r\n";
$content.=$_SERVER['REQUEST_METHOD'].' '.$_SERVER['REQUEST_URI']."\r\n";
if($_SERVER['REQUEST_METHOD'] == 'POST'){
$content.=file_get_contents('php://input')."\r\n";
}
$handle = fopen(app()->getRootPath()."record.txt", 'a');
fwrite($handle, $content."\r\n");
fclose($handle);
return json(['status'=>false, 'msg'=>'不支持当前操作']);
}
}

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

@@ -151,4 +151,18 @@ class Plugins
return $result;
}
//分类获取蜘蛛IP列表
public static function get_spider($type){
$result = cache('get_spider_'.$type);
if($result){
return $result;
}
$url = 'https://www.bt.cn/api/panel/get_spider?spider='.$type;
$data = get_curl($url);
$result = json_decode($data, true);
if(!$result) return [];
cache('get_spider_'.$type, $result, 3600 * 24);
return $result;
}
}

View File

@@ -1,8 +1,8 @@
#!/bin/bash
Linux_Version="8.0.4"
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

@@ -1,49 +1,49 @@
{extend name="admin/layout" /}
{block name="title"}一键部署列表{/block}
{block name="main"}
<div class="container" style="padding-top:70px;">
<div class="col-sm-12 col-md-10 col-lg-8 center-block" style="float: none;">
<div class="panel panel-primary">
<div class="panel-heading"><h3 class="panel-title">一键部署列表</h3></div>
<div class="panel-body">
<div class="list-group">
<div class="list-group-item list-group-item-warning">Linux面板</div>
<div class="list-group-item" style="line-height:35px">列表文件更新时间:<font color="blue">{$deplist_linux_time}</font><a href="javascript:refresh_deplist('Linux')" class="btn btn-success pull-right"><i class="fa fa-refresh"></i>重新获取</a></div>
</div>
<div class="list-group">
<div class="list-group-item list-group-item-warning">Windows面板</div>
<div class="list-group-item" style="line-height:35px">列表文件更新时间:<font color="blue">{$deplist_win_time}</font><a href="javascript:refresh_deplist('Windows')" class="btn btn-success pull-right"><i class="fa fa-refresh"></i>重新获取</a></div>
</div>
</div>
</div>
<script src="//cdn.staticfile.org/layer/3.5.1/layer.js"></script>
<script>
function refresh_deplist(os){
var confirm = layer.confirm('是否确定从宝塔官方获取最新一键部署列表?', {
btn: ['确定','取消']
}, function(){
layer.close(confirm)
var ii = layer.msg('正在获取一键部署列表,请稍候...', {icon: 16, shade:0.1, time: 0});
$.ajax({
type : 'GET',
url : '/admin/refresh_deplist?os='+os,
dataType : 'json',
success : function(data) {
layer.close(ii)
if(data.code == 0){
layer.alert(data.msg, {icon:1}, function(){window.location.reload()});
}else{
layer.alert(data.msg, {icon:2});
}
},
error:function(data){
layer.close(ii)
layer.msg('服务器错误', {icon:2});
}
});
}, function(){
layer.close(confirm)
});
}
</script>
{extend name="admin/layout" /}
{block name="title"}一键部署列表{/block}
{block name="main"}
<div class="container" style="padding-top:70px;">
<div class="col-sm-12 col-md-10 col-lg-8 center-block" style="float: none;">
<div class="panel panel-primary">
<div class="panel-heading"><h3 class="panel-title">一键部署列表</h3></div>
<div class="panel-body">
<div class="list-group">
<div class="list-group-item list-group-item-warning">Linux面板</div>
<div class="list-group-item" style="line-height:35px">列表文件更新时间:<font color="blue">{$deplist_linux_time}</font><a href="javascript:refresh_deplist('Linux')" class="btn btn-success pull-right"><i class="fa fa-refresh"></i>重新获取</a></div>
</div>
<div class="list-group">
<div class="list-group-item list-group-item-warning">Windows面板</div>
<div class="list-group-item" style="line-height:35px">列表文件更新时间:<font color="blue">{$deplist_win_time}</font><a href="javascript:refresh_deplist('Windows')" class="btn btn-success pull-right"><i class="fa fa-refresh"></i>重新获取</a></div>
</div>
</div>
</div>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/layer/3.5.1/layer.js"></script>
<script>
function refresh_deplist(os){
var confirm = layer.confirm('是否确定从宝塔官方获取最新一键部署列表?', {
btn: ['确定','取消']
}, function(){
layer.close(confirm)
var ii = layer.msg('正在获取一键部署列表,请稍候...', {icon: 16, shade:0.1, time: 0});
$.ajax({
type : 'GET',
url : '/admin/refresh_deplist?os='+os,
dataType : 'json',
success : function(data) {
layer.close(ii)
if(data.code == 0){
layer.alert(data.msg, {icon:1}, function(){window.location.reload()});
}else{
layer.alert(data.msg, {icon:2});
}
},
error:function(data){
layer.close(ii)
layer.msg('服务器错误', {icon:2});
}
});
}, function(){
layer.close(confirm)
});
}
</script>
{/block}

View File

@@ -5,15 +5,15 @@
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>{block name="title"}标题{/block}</title>
<link href="//cdn.staticfile.org/twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet" />
<link href="//cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<link href="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet" />
<link href="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<link href="/static/css/bootstrap-table.css" rel="stylesheet" />
<script src="//cdn.staticfile.org/modernizr/2.8.3/modernizr.min.js"></script>
<script src="//cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>
<script src="//cdn.staticfile.org/twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/modernizr/2.8.3/modernizr.min.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/2.1.4/jquery.min.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdn.staticfile.org/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>

View File

@@ -42,9 +42,9 @@
</table>
</div>
</div>
<script src="//cdn.staticfile.org/layer/3.5.1/layer.js"></script>
<script src="//cdn.staticfile.org/bootstrap-table/1.20.2/bootstrap-table.min.js"></script>
<script src="//cdn.staticfile.org/bootstrap-table/1.20.2/extensions/page-jump-to/bootstrap-table-page-jump-to.min.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/layer/3.5.1/layer.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/bootstrap-table/1.19.1/bootstrap-table.min.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/bootstrap-table/1.19.1/extensions/page-jump-to/bootstrap-table-page-jump-to.min.js"></script>
<script src="/static/js/custom.js"></script>
<script>
function setEnable(id,enable) {

View File

@@ -23,9 +23,9 @@
</table>
</div>
</div>
<script src="//cdn.staticfile.org/layer/3.5.1/layer.js"></script>
<script src="//cdn.staticfile.org/bootstrap-table/1.20.2/bootstrap-table.min.js"></script>
<script src="//cdn.staticfile.org/bootstrap-table/1.20.2/extensions/page-jump-to/bootstrap-table-page-jump-to.min.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/layer/3.5.1/layer.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/bootstrap-table/1.19.1/bootstrap-table.min.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/bootstrap-table/1.19.1/extensions/page-jump-to/bootstrap-table-page-jump-to.min.js"></script>
<script src="/static/js/custom.js"></script>
<script>

View File

@@ -1,100 +1,100 @@
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8"/>
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>管理员登录</title>
<link href="//cdn.staticfile.org/twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet"/>
<script src="//cdn.staticfile.org/modernizr/2.8.3/modernizr.min.js"></script>
<script src="//cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdn.staticfile.org/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<nav class="navbar navbar-fixed-top navbar-default">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">导航按钮</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="./">宝塔第三方云端管理中心</a>
</div><!-- /.navbar-header -->
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li class="active">
<a href="#"><span class="glyphicon glyphicon-user"></span> 登录</a>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container -->
</nav><!-- /.navbar -->
<div class="container" style="padding-top:70px;">
<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 center-block" style="float: none;">
<div class="panel panel-primary">
<div class="panel-heading"><h3 class="panel-title">管理员登录</h3></div>
<div class="panel-body">
<form class="form-horizontal" role="form" onsubmit="return submitlogin()">
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
<input type="text" name="user" value="" class="form-control input-lg" placeholder="用户名" required="required"/>
</div><br/>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
<input type="password" name="pass" class="form-control input-lg" placeholder="密码" required="required"/>
</div><br/>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-adjust"></span></span>
<input type="text" class="form-control input-lg" name="code" placeholder="输入验证码" autocomplete="off" required>
<span class="input-group-addon" style="padding: 0">
<img src="/admin/verifycode" height="45" id="verifycode" onclick="this.src='/admin/verifycode?r='+Math.random();" title="点击更换验证码">
</span>
</div><br/>
<div class="form-group">
<div class="col-xs-12"><input type="submit" value="立即登录" class="btn btn-primary btn-block btn-lg"/></div>
</div>
</form>
</div>
</div>
</div>
</div>
<script src="//cdn.staticfile.org/layer/3.5.1/layer.js"></script>
<script>
function submitlogin(){
var user = $("input[name='user']").val();
var pass = $("input[name='pass']").val();
var code = $("input[name='code']").val();
if(user=='' || pass==''){layer.alert('用户名或密码不能为空!');return false;}
var ii = layer.load(2);
$.ajax({
type : 'POST',
url : '{:request()->url()}',
data: {username:user, password:pass, code:code},
dataType : 'json',
success : function(data) {
layer.close(ii);
if(data.code == 0){
layer.msg('登录成功,正在跳转', {icon: 1,shade: 0.01,time: 15000});
window.location.href='/admin';
}else{
if(data.msg.indexOf('验证码')==-1){
$("#verifycode").attr('src', '/admin/verifycode?r='+Math.random())
}
layer.alert(data.msg, {icon: 2});
}
},
error:function(data){
layer.close(ii);
layer.msg('服务器错误');
}
});
return false;
}
</script>
</body>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8"/>
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>管理员登录</title>
<link href="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet"/>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/modernizr/2.8.3/modernizr.min.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/2.1.4/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<nav class="navbar navbar-fixed-top navbar-default">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">导航按钮</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="./">Cloud</a>
</div><!-- /.navbar-header -->
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li class="active">
<a href="#"><span class="glyphicon glyphicon-user"></span> 登录</a>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container -->
</nav><!-- /.navbar -->
<div class="container" style="padding-top:70px;">
<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 center-block" style="float: none;">
<div class="panel panel-primary">
<div class="panel-heading"><h3 class="panel-title">管理员登录</h3></div>
<div class="panel-body">
<form class="form-horizontal" role="form" onsubmit="return submitlogin()">
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
<input type="text" name="user" value="" class="form-control input-lg" placeholder="用户名" required="required"/>
</div><br/>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
<input type="password" name="pass" class="form-control input-lg" placeholder="密码" required="required"/>
</div><br/>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-adjust"></span></span>
<input type="text" class="form-control input-lg" name="code" placeholder="输入验证码" autocomplete="off" required>
<span class="input-group-addon" style="padding: 0">
<img src="/admin/verifycode" height="45" id="verifycode" onclick="this.src='/admin/verifycode?r='+Math.random();" title="点击更换验证码">
</span>
</div><br/>
<div class="form-group">
<div class="col-xs-12"><input type="submit" value="立即登录" class="btn btn-primary btn-block btn-lg"/></div>
</div>
</form>
</div>
</div>
</div>
</div>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/layer/3.5.1/layer.js"></script>
<script>
function submitlogin(){
var user = $("input[name='user']").val();
var pass = $("input[name='pass']").val();
var code = $("input[name='code']").val();
if(user=='' || pass==''){layer.alert('用户名或密码不能为空!');return false;}
var ii = layer.load(2);
$.ajax({
type : 'POST',
url : '{:request()->url()}',
data: {username:user, password:pass, code:code},
dataType : 'json',
success : function(data) {
layer.close(ii);
if(data.code == 0){
layer.msg('登录成功,正在跳转', {icon: 1,shade: 0.01,time: 15000});
window.location.href='/admin';
}else{
if(data.msg.indexOf('验证码')==-1){
$("#verifycode").attr('src', '/admin/verifycode?r='+Math.random())
}
layer.alert(data.msg, {icon: 2});
}
},
error:function(data){
layer.close(ii);
layer.msg('服务器错误');
}
});
return false;
}
</script>
</body>
</html>

View File

@@ -69,9 +69,9 @@ td{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;max-width:340px;
</table>
</div>
</div>
<script src="//cdn.staticfile.org/layer/3.5.1/layer.js"></script>
<script src="//cdn.staticfile.org/bootstrap-table/1.20.2/bootstrap-table.min.js"></script>
<script src="//cdn.staticfile.org/bootstrap-table/1.20.2/extensions/page-jump-to/bootstrap-table-page-jump-to.min.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/layer/3.5.1/layer.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/bootstrap-table/1.19.1/bootstrap-table.min.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/bootstrap-table/1.19.1/extensions/page-jump-to/bootstrap-table-page-jump-to.min.js"></script>
<script src="/static/js/custom.js"></script>
<script>

View File

@@ -69,9 +69,9 @@ td{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;max-width:340px;
</table>
</div>
</div>
<script src="//cdn.staticfile.org/layer/3.5.1/layer.js"></script>
<script src="//cdn.staticfile.org/bootstrap-table/1.20.2/bootstrap-table.min.js"></script>
<script src="//cdn.staticfile.org/bootstrap-table/1.20.2/extensions/page-jump-to/bootstrap-table-page-jump-to.min.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/layer/3.5.1/layer.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/bootstrap-table/1.19.1/bootstrap-table.min.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/bootstrap-table/1.19.1/extensions/page-jump-to/bootstrap-table-page-jump-to.min.js"></script>
<script src="/static/js/custom.js"></script>
<script>

View File

@@ -23,9 +23,9 @@
</table>
</div>
</div>
<script src="//cdn.staticfile.org/layer/3.5.1/layer.js"></script>
<script src="//cdn.staticfile.org/bootstrap-table/1.20.2/bootstrap-table.min.js"></script>
<script src="//cdn.staticfile.org/bootstrap-table/1.20.2/extensions/page-jump-to/bootstrap-table-page-jump-to.min.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/layer/3.5.1/layer.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/bootstrap-table/1.19.1/bootstrap-table.min.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/bootstrap-table/1.19.1/extensions/page-jump-to/bootstrap-table-page-jump-to.min.js"></script>
<script src="/static/js/custom.js"></script>
<script>

View File

@@ -279,7 +279,7 @@ $("select[name='wbt_type']").change(function(){
</div>
</div>
{/if}
<script src="//cdn.staticfile.org/layer/3.5.1/layer.js"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/layer/3.5.1/layer.js"></script>
<script>
$(document).ready(function(){
var items = $("select[default]");

View File

@@ -1,261 +1,261 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="renderer" content="webkit" />
<meta name="force-rendering" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>宝塔面板安装脚本</title>
<link rel="stylesheet" type="text/css" href="/static/css/sanren.css" />
<link rel="stylesheet" type="text/css" href="/static/css/style.css" />
<link rel="stylesheet" type="text/css" href="/static/css/download.css" />
</head>
<body>
<div class="down-main">
<div class="d1">
<div class="wrap">
<div class="i1t textcenter">
<h1 class="disflex flex_center flex_lrcenter textcenter">宝塔面板安装脚本<img class="ml10" src="/static/images/i1ico_03.png"></h1>
<div class="text20 mt_25 wap_mt15 textcenter cl8">
<p>2分钟装好面板一键管理服务器</p>
<p>集成LAMP/LNMP环境安装网站、FTP、数据库、文件管理、软件安装等功能</p>
</div>
<div class="disflex flex_lrcenter mt_50 install-list">
<div class="install-box linux">
<div class="img">
<img src="/static/images/prd_1_03.png">
</div>
<div class="cont">
<div class="top">
<div class="title">Linux面板 {:config_get('new_version')}</div>
<div class="desc">
支持Centos、Ubuntu、Deepin、Debian、Fedora等Linux系统。
<a class="link" href="https://demo.bt.cn/login" target="_blank" style="margin-left: 5px; font-weight: 700" rel="noreferrer">查看演示</a>
</div>
<div class="mark">
<span>2分钟装好</span>
<span>阿里云推荐</span>
<span>腾讯云推荐</span>
</div>
</div>
<div class="bottom">
<a class="btn" href="javascript:;" id="goInstallLinux">查看安装脚本</a>
</div>
</div>
</div>
<div class="install-box windows">
<div class="img">
<img src="/static/images/prd_2_03.png">
</div>
<div class="cont">
<div class="top">
<div class="title">Windows面板 {:config_get('new_version_win')}</div>
<div class="desc">支持Windows Server 2008 R2/2012/2016/2019/202264位系统</div>
<div class="mark">
<span>操作简单</span>
<span>使用方便</span>
</div>
</div>
<div class="bottom">
<a class="btn" href="javascript:;" id="goInstallWindows">查看安装方法</a>
</div>
</div>
</div>
</div>
{if config_get('new_version_btm')}<div class="disflex flex_lrcenter mt_30 install-list">
<div class="install-box monitor">
<div class="img">
<img src="/static/images/bt_monitor.png" />
</div>
<div class="cont">
<div class="top">
<div class="title">堡塔云监控</div>
<div class="desc">服务监控和异常告警通知</div>
</div>
<div class="bottom">
<a class="btn" href="javascript:;" id="goInstallMonitor">查看安装脚本</a>
</div>
</div>
</div>
</div>{/if}
</div>
</div>
</div>
<div class="d2" id="instal-linux">
<div class="wrap">
<div class="wrap-title linux-title">
<div class="text">Linux面板{:config_get('new_version')}安装脚本</div>
</div>
<div class="desc">
使用 SSH 连接工具,如
<a class="link" href="https://www.putty.org/" target="_blank" rel="noreferrer">PUTTY</a>
连接到您的 Linux 服务器后,
<a class="link" href="https://www.bt.cn/bbs/thread-50002-1-1.html" target="_blank" rel="noreferrer">挂载磁盘</a>
,根据系统执行相应命令开始安装:
</div>
<div class="install-code">
<span class="osname">Centos安装脚本</span>
<div class="code-cont">
<div class="command" title="点击复制Centos安装脚本">yum install -y wget && wget -O install.sh {$siteurl}/install/install_6.0.sh && sh install.sh</div>
<span class="ico-copy" title="点击复制Centos安装脚本" data-clipboard-text="yum install -y wget && wget -O install.sh {$siteurl}/install/install_6.0.sh && sh install.sh">复制</span>
</div>
</div>
<div class="install-code">
<span class="osname">Ubuntu/Debian安装脚本</span>
<div class="code-cont">
<div class="command" title="点击复制Ubuntu/Debian安装脚本">wget -O install.sh {$siteurl}/install/install_6.0.sh && bash install.sh</div>
<span class="ico-copy" title="点击复制Ubuntu/Debian安装脚本" data-clipboard-text="wget -O install.sh {$siteurl}/install/install_6.0.sh && bash install.sh">复制</span>
</div>
</div>
<div class="install-code">
<span class="osname">一键更新脚本</span>
<div class="code-cont">
<div class="command" title="点击复制一键更新脚本">curl {$siteurl}/install/update6.sh|bash</div>
<span class="ico-copy" title="点击复制一键更新脚本" data-clipboard-text="curl {$siteurl}/install/update6.sh|bash">复制</span>
</div>
</div>
<div class="tips" style="color: orangered; font-weight: 700">
<p>注意必须为没装过其它环境如Apache/Nginx/php/MySQL的新系统,推荐使用centos 7.X的系统安装宝塔面板</p>
<p style="text-indent: 3em">推荐使用Chrome、火狐、edge浏览器国产浏览器请使用极速模式访问面板登录地址</p>
<p style="text-indent: 3em">如果使用过官方版或其他第三方云端的版本,使用一键更新脚本即可切换到此云端</p>
</div>
</div>
</div>
<div class="d4" id="instal-windows" style="background-color: #edf6ef;">
<div class="wrap">
<div class="wrap-title">
<div class="text">Windows面板{:config_get('new_version_win')}安装方法</div>
</div>
<div class="desc">
<p>1、使用<a class="link" href="https://download.bt.cn/win/panel/BtSoft.zip" target="_blank" rel="noreferrer">官方安装程序</a>进行安装,安装完先不要进入面板。</p>
<p>2、在命令提示符cmd输入以下一键更新命令然后重启面板。</p>
</div>
<div class="install-code">
<div class="code-cont">
<div class="command" title="点击复制一键更新命令">wget {$siteurl}/win/panel/data/setup.py -O C:/update.py && &quot;C:\Program Files\python\python.exe&quot; C:/update.py update_panel {:config_get('new_version_win')}</div>
<span class="ico-copy" title="点击复制一键更新命令" data-clipboard-text="wget {$siteurl}/win/panel/data/setup.py -O C:/update.py && &quot;C:\Program Files\python\python.exe&quot; C:/update.py update_panel {:config_get('new_version_win')}">复制</span>
</div>
</div>
<div class="tips" style="color: orangered; font-weight: 700">
<p>注意仅支持Windows Server 2008 R2/2012/2016/2019/202264位系统中文简体且未安装其它环境</p>
</div>
</div>
</div>
{if config_get('new_version_btm')}
<div class="d4" id="instal-monitor">
<div class="wrap">
<div class="wrap-title">
<div class="text" style="margin-right: 12px;">堡塔云监控{:config_get('new_version_btm')}安装脚本</div>
</div>
<div class="desc">
使用 SSH 连接工具,如
<a class="link" href="https://www.putty.org/" target="_blank" rel="noreferrer">PUTTY</a>
连接到您的 Linux 服务器后,根据系统执行相应命令开始安装:
</div>
<div class="install-code">
<span class="osname">堡塔云监控安装脚本</span>
<div class="code-cont">
<div class="command" title="点击复制安装脚本">curl -sS {$siteurl}/install/install_btmonitor.sh -o /tmp/install_btmonitor.sh && bash /tmp/install_btmonitor.sh</div>
<span class="ico-copy" title="点击复制安装脚本" data-clipboard-text="curl -sS {$siteurl}/install/install_btmonitor.sh -o /tmp/install_btmonitor.sh && bash /tmp/install_btmonitor.sh">复制</span>
</div>
</div>
<div class="install-code">
<span class="osname">堡塔云监控更新脚本</span>
<div class="code-cont">
<div class="command" title="点击复制更新脚本">curl {$siteurl}/install/update_btmonitor.sh|bash</div>
<span class="ico-copy" title="点击复制更新脚本" data-clipboard-text="curl {$siteurl}/install/update_btmonitor.sh|bash">复制</span>
</div>
</div>
<div class="tips" style="color: orangered; font-weight: 700">
<p>注意推荐使用Chrome、火狐、edge浏览器国产浏览器极速模式</p>
</div>
</div>
</div>{/if}
<div class="animate-bg"></div>
</div>
<div class="foot">
<div class="wrap">
<div class="fb textcenter">
<div class="fb1 textcenter">
<a href="http://www.bt.cn/new/agreement_open.html" target="_blank" rel="noreferrer">《开源许可协议》</a>
<i></i>
<a href="http://www.bt.cn/new/agreement_user.html" target="_blank" rel="noreferrer">《用户协议》</a>
<i></i>
<a href="http://www.bt.cn/new/agreement_privacy.html" target="_blank" rel="noreferrer">《隐私声明》</a>
</div>
<div class="fb2 mt_15">
<p>
Copyright © {:date('Y')} 宝塔面板安装脚本
</p>
</div>
</div>
</div>
</div>
<script src="//cdn.staticfile.org/jquery/3.6.0/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="//cdn.staticfile.org/layer/3.5.1/layer.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="//cdn.staticfile.org/clipboard.js/1.7.1/clipboard.min.js"></script>
<script type="text/javascript" src="/static/js/dx.js"></script>
<script>
$(function () {
var userId = '';
// 复制安装命令
var clipboard = new Clipboard('.ico-copy', {
text: function (element) {
return $(element).prev().text();
},
});
clipboard
.on('success', function (e) {
layer.msg(e.trigger.title + '成功', { icon: 1 });
})
.on('error', function (e) {
layer.msg('复制失败请手动选中文本Ctrl+c复制内容', { icon: 2 });
});
$('.install-code .command').click(function () {
$(this).next('.ico-copy').click();
});
$('#goInstallLinux').click(function () {
scrollTop('#instal-linux');
});
$('#goInstallWindows').click(function () {
scrollTop('#instal-windows');
});
$('#goInstallCloud').click(function () {
scrollTop('#instal-cloud');
});
$('#goInstallMonitor').click(function () {
scrollTop('#instal-monitor');
});
function GetRequest() {
var url = location.search;
//获取url中"?"符后的字串
var theRequest = new Object();
if (url.indexOf('?') != -1) {
var str = url.substr(1);
}
return str;
}
if (GetRequest() == 'bt') {
scrollTop('#instal-linux');
}
// 滚动到指定位置
function scrollTop(el) {
var headHeight = 0;
$('html, body').animate({ scrollTop: $(el).offset().top - headHeight }, { duration: 200, easing: 'swing' });
}
});
</script>
</body>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="renderer" content="webkit" />
<meta name="force-rendering" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>宝塔面板安装脚本</title>
<link rel="stylesheet" type="text/css" href="/static/css/sanren.css" />
<link rel="stylesheet" type="text/css" href="/static/css/style.css" />
<link rel="stylesheet" type="text/css" href="/static/css/download.css" />
</head>
<body>
<div class="down-main">
<div class="d1">
<div class="wrap">
<div class="i1t textcenter">
<h1 class="disflex flex_center flex_lrcenter textcenter">宝塔面板安装脚本<img class="ml10" src="/static/images/i1ico_03.png"></h1>
<div class="text20 mt_25 wap_mt15 textcenter cl8">
<p>2分钟装好面板一键管理服务器</p>
<p>集成LAMP/LNMP环境安装网站、FTP、数据库、文件管理、软件安装等功能</p>
</div>
<div class="disflex flex_lrcenter mt_50 install-list">
<div class="install-box linux">
<div class="img">
<img src="/static/images/prd_1_03.png">
</div>
<div class="cont">
<div class="top">
<div class="title">Linux面板 {:config_get('new_version')}</div>
<div class="desc">
支持Centos、Ubuntu、Deepin、Debian、Fedora等Linux系统。
<a class="link" href="https://demo.bt.cn/login" target="_blank" style="margin-left: 5px; font-weight: 700" rel="noreferrer">查看演示</a>
</div>
<div class="mark">
<span>2分钟装好</span>
<span>阿里云推荐</span>
<span>腾讯云推荐</span>
</div>
</div>
<div class="bottom">
<a class="btn" href="javascript:;" id="goInstallLinux">查看安装脚本</a>
</div>
</div>
</div>
<div class="install-box windows">
<div class="img">
<img src="/static/images/prd_2_03.png">
</div>
<div class="cont">
<div class="top">
<div class="title">Windows面板 {:config_get('new_version_win')}</div>
<div class="desc">支持Windows Server 2008 R2/2012/2016/2019/202264位系统</div>
<div class="mark">
<span>操作简单</span>
<span>使用方便</span>
</div>
</div>
<div class="bottom">
<a class="btn" href="javascript:;" id="goInstallWindows">查看安装方法</a>
</div>
</div>
</div>
</div>
{if config_get('new_version_btm')}<div class="disflex flex_lrcenter mt_30 install-list">
<div class="install-box monitor">
<div class="img">
<img src="/static/images/bt_monitor.png" style="height: 96px;"/>
</div>
<div class="cont">
<div class="top">
<div class="title">安全监控</div>
<div class="desc">机跨平台安全管理和监控</div>
</div>
<div class="bottom">
<a class="btn" href="javascript:;" id="goInstallMonitor">查看安装脚本</a>
</div>
</div>
</div>
</div>{/if}
</div>
</div>
</div>
<div class="d2" id="instal-linux">
<div class="wrap">
<div class="wrap-title linux-title">
<div class="text">Linux面板{:config_get('new_version')}安装脚本</div>
</div>
<div class="desc">
使用 SSH 连接工具,如
<a class="link" href="https://www.putty.org/" target="_blank" rel="noreferrer">PUTTY</a>
连接到您的 Linux 服务器后,
<a class="link" href="https://www.bt.cn/bbs/thread-50002-1-1.html" target="_blank" rel="noreferrer">挂载磁盘</a>
,根据系统执行相应命令开始安装:
</div>
<div class="install-code">
<span class="osname">Centos安装脚本</span>
<div class="code-cont">
<div class="command" title="点击复制Centos安装脚本">yum install -y wget && wget -O install.sh {$siteurl}/install/install_6.0.sh && sh install.sh</div>
<span class="ico-copy" title="点击复制Centos安装脚本" data-clipboard-text="yum install -y wget && wget -O install.sh {$siteurl}/install/install_6.0.sh && sh install.sh">复制</span>
</div>
</div>
<div class="install-code">
<span class="osname">Ubuntu/Debian安装脚本</span>
<div class="code-cont">
<div class="command" title="点击复制Ubuntu/Debian安装脚本">wget -O install.sh {$siteurl}/install/install_6.0.sh && bash install.sh</div>
<span class="ico-copy" title="点击复制Ubuntu/Debian安装脚本" data-clipboard-text="wget -O install.sh {$siteurl}/install/install_6.0.sh && bash install.sh">复制</span>
</div>
</div>
<div class="install-code">
<span class="osname">一键更新脚本</span>
<div class="code-cont">
<div class="command" title="点击复制一键更新脚本">curl {$siteurl}/install/update6.sh|bash</div>
<span class="ico-copy" title="点击复制一键更新脚本" data-clipboard-text="curl {$siteurl}/install/update6.sh|bash">复制</span>
</div>
</div>
<div class="tips" style="color: orangered; font-weight: 700">
<p>注意必须为没装过其它环境如Apache/Nginx/php/MySQL的新系统,推荐使用centos 7.X的系统安装宝塔面板</p>
<p style="text-indent: 3em">推荐使用Chrome、火狐、edge浏览器国产浏览器请使用极速模式访问面板登录地址</p>
<p style="text-indent: 3em">如果使用过官方版或其他第三方云端的版本,使用一键更新脚本即可切换到此云端</p>
</div>
</div>
</div>
<div class="d4" id="instal-windows" style="background-color: #edf6ef;">
<div class="wrap">
<div class="wrap-title">
<div class="text">Windows面板{:config_get('new_version_win')}安装方法</div>
</div>
<div class="desc">
<p>1、使用<a class="link" href="https://download.bt.cn/win/panel/BtSoft.zip" target="_blank" rel="noreferrer">官方安装程序</a>进行安装,安装完先不要进入面板。</p>
<p>2、在命令提示符cmd输入以下一键更新命令然后重启面板。</p>
</div>
<div class="install-code">
<div class="code-cont">
<div class="command" title="点击复制一键更新命令">wget {$siteurl}/win/panel/data/setup.py -O C:/update.py && &quot;C:\Program Files\python\python.exe&quot; C:/update.py update_panel {:config_get('new_version_win')}</div>
<span class="ico-copy" title="点击复制一键更新命令" data-clipboard-text="wget {$siteurl}/win/panel/data/setup.py -O C:/update.py && &quot;C:\Program Files\python\python.exe&quot; C:/update.py update_panel {:config_get('new_version_win')}">复制</span>
</div>
</div>
<div class="tips" style="color: orangered; font-weight: 700">
<p>注意仅支持Windows Server 2008 R2/2012/2016/2019/202264位系统中文简体且未安装其它环境</p>
</div>
</div>
</div>
{if config_get('new_version_btm')}
<div class="d4" id="instal-monitor">
<div class="wrap">
<div class="wrap-title">
<div class="text" style="margin-right: 12px;">安全监控{:config_get('new_version_btm')}安装脚本</div>
</div>
<div class="desc">
使用 SSH 连接工具,如
<a class="link" href="https://www.putty.org/" target="_blank" rel="noreferrer">PUTTY</a>
连接到您的 Linux 服务器后,根据系统执行相应命令开始安装:
</div>
<div class="install-code">
<span class="osname">安全监控安装脚本</span>
<div class="code-cont">
<div class="command" title="点击复制安装脚本">curl -sS {$siteurl}/install/install_btmonitor.sh -o /tmp/install_btmonitor.sh && bash /tmp/install_btmonitor.sh</div>
<span class="ico-copy" title="点击复制安装脚本" data-clipboard-text="curl -sS {$siteurl}/install/install_btmonitor.sh -o /tmp/install_btmonitor.sh && bash /tmp/install_btmonitor.sh">复制</span>
</div>
</div>
<div class="install-code">
<span class="osname">安全监控更新脚本</span>
<div class="code-cont">
<div class="command" title="点击复制更新脚本">curl {$siteurl}/install/update_btmonitor.sh|bash</div>
<span class="ico-copy" title="点击复制更新脚本" data-clipboard-text="curl {$siteurl}/install/update_btmonitor.sh|bash">复制</span>
</div>
</div>
<div class="tips" style="color: orangered; font-weight: 700">
<p>注意:安装完成后推荐使用Chrome、火狐、edge浏览器国产浏览器极速模式访问登录系统</p>
</div>
</div>
</div>{/if}
<div class="animate-bg"></div>
</div>
<div class="foot">
<div class="wrap">
<div class="fb textcenter">
<div class="fb1 textcenter">
<a href="http://www.bt.cn/new/agreement_open.html" target="_blank" rel="noreferrer">《开源许可协议》</a>
<i></i>
<a href="http://www.bt.cn/new/agreement_user.html" target="_blank" rel="noreferrer">《用户协议》</a>
<i></i>
<a href="http://www.bt.cn/new/agreement_privacy.html" target="_blank" rel="noreferrer">《隐私声明》</a>
</div>
<div class="fb2 mt_15">
<p>
Copyright © {:date('Y')} 宝塔面板安装脚本
</p>
</div>
</div>
</div>
</div>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/layer/3.5.1/layer.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/clipboard.js/1.7.1/clipboard.min.js"></script>
<script type="text/javascript" src="/static/js/dx.js"></script>
<script>
$(function () {
var userId = '';
// 复制安装命令
var clipboard = new Clipboard('.ico-copy', {
text: function (element) {
return $(element).prev().text();
},
});
clipboard
.on('success', function (e) {
layer.msg(e.trigger.title + '成功', { icon: 1 });
})
.on('error', function (e) {
layer.msg('复制失败请手动选中文本Ctrl+c复制内容', { icon: 2 });
});
$('.install-code .command').click(function () {
$(this).next('.ico-copy').click();
});
$('#goInstallLinux').click(function () {
scrollTop('#instal-linux');
});
$('#goInstallWindows').click(function () {
scrollTop('#instal-windows');
});
$('#goInstallCloud').click(function () {
scrollTop('#instal-cloud');
});
$('#goInstallMonitor').click(function () {
scrollTop('#instal-monitor');
});
function GetRequest() {
var url = location.search;
//获取url中"?"符后的字串
var theRequest = new Object();
if (url.indexOf('?') != -1) {
var str = url.substr(1);
}
return str;
}
if (GetRequest() == 'bt') {
scrollTop('#instal-linux');
}
// 滚动到指定位置
function scrollTop(el) {
var headHeight = 0;
$('html, body').animate({ scrollTop: $(el).offset().top - headHeight }, { duration: 200, easing: 'swing' });
}
});
</script>
</body>
</html>

View File

@@ -1,268 +1,268 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>宝塔第三方云端 - 安装程序</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<style>
body {
background: #f1f6fd;
margin: 0;
padding: 0;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body, input, button {
font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, 'Microsoft Yahei', Arial, sans-serif;
font-size: 14px;
color: #7E96B3;
}
.container {
max-width: 480px;
margin: 0 auto;
padding: 20px;
text-align: center;
}
a {
color: #4e73df;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
h1 {
margin-top: 0;
margin-bottom: 10px;
}
h2 {
font-size: 28px;
font-weight: normal;
color: #3C5675;
margin-bottom: 0;
margin-top: 0;
}
form {
margin-top: 40px;
}
.form-group {
margin-bottom: 20px;
}
.form-group .form-field:first-child input {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.form-group .form-field:last-child input {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
.form-field input {
background: #fff;
margin: 0 0 2px;
border: 2px solid transparent;
transition: background 0.2s, border-color 0.2s, color 0.2s;
width: 100%;
padding: 15px 15px 15px 180px;
box-sizing: border-box;
}
.form-field input:focus {
border-color: #4e73df;
background: #fff;
color: #444;
outline: none;
}
.form-field label {
float: left;
width: 160px;
text-align: right;
margin-right: -160px;
position: relative;
margin-top: 15px;
font-size: 14px;
pointer-events: none;
opacity: 0.7;
}
button, .btn {
background: #3C5675;
color: #fff;
border: 0;
font-weight: bold;
border-radius: 4px;
cursor: pointer;
padding: 15px 30px;
-webkit-appearance: none;
}
button[disabled] {
opacity: 0.5;
}
.form-buttons {
height: 52px;
line-height: 52px;
}
.form-buttons .btn {
margin-right: 5px;
}
#error, .error, #success, .success, #warmtips, .warmtips {
background: #D83E3E;
color: #fff;
padding: 15px 20px;
border-radius: 4px;
margin-bottom: 20px;
}
#success {
background: #3C5675;
}
#error a, .error a {
color: white;
text-decoration: underline;
}
#warmtips {
background: #fff;
font-size: 14px;
color: #3C5675;
border: 2px solid #4e73df;
text-align: left;
}
</style>
</head>
<body>
<div class="container">
<h1>
<svg t="1660545699809" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4887" width="100px" height="100px">
<path d="M811.4 418.7C765.6 297.9 648.9 212 512.2 212S258.8 297.8 213 418.6C127.3 441.1 64 519.1 64 612c0 110.5 89.5 200 199.9 200h496.2C870.5 812 960 722.5 960 612c0-92.7-63.1-170.7-148.6-193.3z m36.3 281c-23.4 23.4-54.5 36.3-87.6 36.3H263.9c-33.1 0-64.2-12.9-87.6-36.3-23.4-23.4-36.3-54.6-36.3-87.7 0-28 9.1-54.3 26.2-76.3 16.7-21.3 40.2-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4 14.9-19.2 32.6-35.9 52.4-49.9 41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10c54.3 14.5 92.1 63.8 92.1 120 0 33.1-12.9 64.3-36.3 87.7z" p-id="4888" fill="#4e73df"></path>
</svg>
</h1>
<h2>宝塔第三方云端 - 安装程序</h2>
<div>
<form method="post">
<div id="error" style="display:none"></div>
<div id="success" style="display:none"></div>
<div id="warmtips" style="display:none"><p>安装完成后,你还需要进行以下操作:</p><p>1、在后台使用批量替换工具执行命令一键替换压缩包与安装脚本中的域名。</p><p></p>2、在后台配置面板对接同步插件列表与插件包。</p></div>
<div class="form-group">
<div class="form-field">
<label>MySQL 数据库地址</label>
<input type="text" name="mysql_host" value="localhost" required="">
</div>
<div class="form-field">
<label>MySQL 数据库端口</label>
<input type="number" name="mysql_port" value="3306">
</div>
<div class="form-field">
<label>MySQL 用户名</label>
<input type="text" name="mysql_user" value="" required="">
</div>
<div class="form-field">
<label>MySQL 密码</label>
<input type="text" name="mysql_pwd" value="" required="">
</div>
<div class="form-field">
<label>MySQL 数据库名</label>
<input type="text" name="mysql_name" value="" required="">
</div>
<div class="form-field">
<label>MySQL 数据表前缀</label>
<input type="text" name="mysql_prefix" value="cloud_">
</div>
</div>
<div class="form-group">
<div class="form-field">
<label>管理员用户名</label>
<input type="text" name="admin_username" value="admin" required=""/>
</div>
<div class="form-field">
<label>管理员密码</label>
<input type="text" name="admin_password" value="123456" required="">
</div>
</div>
<div class="form-buttons">
<!--@formatter:off-->
<button type="submit" >点击安装</button>
<!--@formatter:on-->
</div>
</form>
</div>
</div>
<script src="//cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>
<script>
$(function () {
$('form').on('submit', function (e) {
e.preventDefault();
var form = this;
var $error = $("#error");
var $success = $("#success");
var $button = $(this).find('button')
.text("安装中...")
.prop('disabled', true);
$.ajax({
url: "",
type: "POST",
dataType: "json",
data: $(this).serialize(),
success: function (ret) {
if (ret.code == 1) {
$error.hide();
$(".form-group", form).remove();
$button.remove();
$("#success").text(ret.msg).show();
$("#warmtips").show();
$buttons = $(".form-buttons", form);
$('<a class="btn" href="/admin" style="background:#4e73df">进入后台</a>').appendTo($buttons);
} else {
$error.show().text(ret.msg);
$button.prop('disabled', false).text("点击安装");
$("html,body").animate({
scrollTop: 0
}, 500);
}
},
error: function (xhr) {
$error.show().text(xhr.responseText);
$button.prop('disabled', false).text("点击安装");
$("html,body").animate({
scrollTop: 0
}, 500);
}
});
return false;
});
});
</script>
</body>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>宝塔第三方云端 - 安装程序</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<style>
body {
background: #f1f6fd;
margin: 0;
padding: 0;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body, input, button {
font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, 'Microsoft Yahei', Arial, sans-serif;
font-size: 14px;
color: #7E96B3;
}
.container {
max-width: 480px;
margin: 0 auto;
padding: 20px;
text-align: center;
}
a {
color: #4e73df;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
h1 {
margin-top: 0;
margin-bottom: 10px;
}
h2 {
font-size: 28px;
font-weight: normal;
color: #3C5675;
margin-bottom: 0;
margin-top: 0;
}
form {
margin-top: 40px;
}
.form-group {
margin-bottom: 20px;
}
.form-group .form-field:first-child input {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.form-group .form-field:last-child input {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
.form-field input {
background: #fff;
margin: 0 0 2px;
border: 2px solid transparent;
transition: background 0.2s, border-color 0.2s, color 0.2s;
width: 100%;
padding: 15px 15px 15px 180px;
box-sizing: border-box;
}
.form-field input:focus {
border-color: #4e73df;
background: #fff;
color: #444;
outline: none;
}
.form-field label {
float: left;
width: 160px;
text-align: right;
margin-right: -160px;
position: relative;
margin-top: 15px;
font-size: 14px;
pointer-events: none;
opacity: 0.7;
}
button, .btn {
background: #3C5675;
color: #fff;
border: 0;
font-weight: bold;
border-radius: 4px;
cursor: pointer;
padding: 15px 30px;
-webkit-appearance: none;
}
button[disabled] {
opacity: 0.5;
}
.form-buttons {
height: 52px;
line-height: 52px;
}
.form-buttons .btn {
margin-right: 5px;
}
#error, .error, #success, .success, #warmtips, .warmtips {
background: #D83E3E;
color: #fff;
padding: 15px 20px;
border-radius: 4px;
margin-bottom: 20px;
}
#success {
background: #3C5675;
}
#error a, .error a {
color: white;
text-decoration: underline;
}
#warmtips {
background: #fff;
font-size: 14px;
color: #3C5675;
border: 2px solid #4e73df;
text-align: left;
}
</style>
</head>
<body>
<div class="container">
<h1>
<svg t="1660545699809" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4887" width="100px" height="100px">
<path d="M811.4 418.7C765.6 297.9 648.9 212 512.2 212S258.8 297.8 213 418.6C127.3 441.1 64 519.1 64 612c0 110.5 89.5 200 199.9 200h496.2C870.5 812 960 722.5 960 612c0-92.7-63.1-170.7-148.6-193.3z m36.3 281c-23.4 23.4-54.5 36.3-87.6 36.3H263.9c-33.1 0-64.2-12.9-87.6-36.3-23.4-23.4-36.3-54.6-36.3-87.7 0-28 9.1-54.3 26.2-76.3 16.7-21.3 40.2-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4 14.9-19.2 32.6-35.9 52.4-49.9 41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10c54.3 14.5 92.1 63.8 92.1 120 0 33.1-12.9 64.3-36.3 87.7z" p-id="4888" fill="#4e73df"></path>
</svg>
</h1>
<h2>宝塔第三方云端 - 安装程序</h2>
<div>
<form method="post">
<div id="error" style="display:none"></div>
<div id="success" style="display:none"></div>
<div id="warmtips" style="display:none"><p>安装完成后,你还需要进行以下操作:</p><p>1、在后台使用批量替换工具执行命令一键替换压缩包与安装脚本中的域名。</p><p></p>2、在后台配置面板对接同步插件列表与插件包。</p></div>
<div class="form-group">
<div class="form-field">
<label>MySQL 数据库地址</label>
<input type="text" name="mysql_host" value="localhost" required="">
</div>
<div class="form-field">
<label>MySQL 数据库端口</label>
<input type="number" name="mysql_port" value="3306">
</div>
<div class="form-field">
<label>MySQL 用户名</label>
<input type="text" name="mysql_user" value="" required="">
</div>
<div class="form-field">
<label>MySQL 密码</label>
<input type="text" name="mysql_pwd" value="" required="">
</div>
<div class="form-field">
<label>MySQL 数据库名</label>
<input type="text" name="mysql_name" value="" required="">
</div>
<div class="form-field">
<label>MySQL 数据表前缀</label>
<input type="text" name="mysql_prefix" value="cloud_">
</div>
</div>
<div class="form-group">
<div class="form-field">
<label>管理员用户名</label>
<input type="text" name="admin_username" value="admin" required=""/>
</div>
<div class="form-field">
<label>管理员密码</label>
<input type="text" name="admin_password" value="123456" required="">
</div>
</div>
<div class="form-buttons">
<!--@formatter:off-->
<button type="submit" >点击安装</button>
<!--@formatter:on-->
</div>
</form>
</div>
</div>
<script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/2.1.4/jquery.min.js"></script>
<script>
$(function () {
$('form').on('submit', function (e) {
e.preventDefault();
var form = this;
var $error = $("#error");
var $success = $("#success");
var $button = $(this).find('button')
.text("安装中...")
.prop('disabled', true);
$.ajax({
url: "",
type: "POST",
dataType: "json",
data: $(this).serialize(),
success: function (ret) {
if (ret.code == 1) {
$error.hide();
$(".form-group", form).remove();
$button.remove();
$("#success").text(ret.msg).show();
$("#warmtips").show();
$buttons = $(".form-buttons", form);
$('<a class="btn" href="/admin" style="background:#4e73df">进入后台</a>').appendTo($buttons);
} else {
$error.show().text(ret.msg);
$button.prop('disabled', false).text("点击安装");
$("html,body").animate({
scrollTop: 0
}, 500);
}
},
error: function (xhr) {
$error.show().text(xhr.responseText);
$button.prop('disabled', false).text("点击安装");
$("html,body").animate({
scrollTop: 0
}, 500);
}
});
return false;
});
});
</script>
</body>
</html>

View File

@@ -8,5 +8,6 @@ return [
'updateall' => 'app\command\UpdateAll',
'decrypt' => 'app\command\DecryptFile',
'clean' => 'app\command\Clean',
'cleanvitejs' => 'app\command\CleanViteJs',
],
];

0
data/config/.gitkeep Normal file
View File

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

0
data/win/config/.gitkeep Normal file
View File

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -12,9 +12,9 @@ INSERT INTO `cloud_config` (`key`, `value`) VALUES
('bt_key', ''),
('whitelist', '0'),
('download_page', '1'),
('new_version', '8.0.4'),
('new_version', '8.0.5'),
('update_msg', '暂无更新日志'),
('update_date', '2023-11-19'),
('update_date', '2024-01-12'),
('new_version_win', '7.9.0'),
('update_msg_win', '暂无更新日志'),
('update_date_win', '2023-07-20'),
@@ -48,7 +48,7 @@ CREATE TABLE `cloud_white` (
DROP TABLE IF EXISTS `cloud_record`;
CREATE TABLE `cloud_record` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ip` varchar(20) NOT NULL,
`ip` varchar(200) NOT NULL,
`addtime` datetime NOT NULL,
`usetime` datetime NOT NULL,
PRIMARY KEY (`id`),

View File

@@ -40,7 +40,7 @@ cd ~
setup_path="/www"
python_bin=$setup_path/server/panel/pyenv/bin/python
cpu_cpunt=$(cat /proc/cpuinfo|grep processor|wc -l)
panelPort=$(expr $RANDOM % 55535 + 10000)
# if [ "$1" ];then
# IDC_CODE=$1
# fi
@@ -59,26 +59,6 @@ GetSysInfo(){
echo -e ${SYS_VERSION}
echo -e Bit:${SYS_BIT} Mem:${MEM_TOTAL}M Core:${CPU_INFO}
echo -e ${SYS_INFO}
if [ -z "${os_version}" ];then
echo -e "============================================"
echo -e "检测到为非常用系统安装,建议更换至Centos-7或Debian-10+或Ubuntu-20+系统安装宝塔面板"
echo -e "详情请查看系统兼容表https://docs.qq.com/sheet/DUm54VUtyTVNlc21H?tab=BB08J2"
echo -e "特殊情况可通过以下联系方式寻求安装协助情况"
fi
is64bit=$(getconf LONG_BIT)
if [ "${is64bit}" == '32' ];then
echo -e "宝塔面板不支持32位系统进行安装请使用64位系统/服务器架构进行安装宝塔"
exit 1
fi
S390X_CHECK=$(uname -a|grep s390x)
if [ "${S390X_CHECK}" ];then
echo -e "宝塔面板不支持s390x架构进行安装请使用64位系统/服务器架构进行安装宝塔"
exit 1
fi
echo -e "============================================"
echo -e "请截图以上报错信息发帖至论坛www.bt.cn/bbs求助"
}
@@ -150,6 +130,14 @@ Set_Ssl(){
esac
fi
}
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
fi
}
Get_Pack_Manager(){
if [ -f "/usr/bin/yum" ] && [ -d "/etc/yum.repos.d" ]; then
PM="yum"
@@ -167,6 +155,8 @@ Auto_Swap()
if [ ! -d /www ];then
mkdir /www
fi
echo "正在设置虚拟内存,请稍等..........";
echo '---------------------------------------------';
swapFile="/www/swap"
dd if=/dev/zero of=$swapFile bs=1M count=1025
mkswap -f $swapFile
@@ -236,7 +226,7 @@ get_node_url(){
echo '---------------------------------------------';
echo "Selected download node...";
nodes=(https://dg2.bt.cn https://download.bt.cn https://ctcc1-node.bt.cn https://cmcc1-node.bt.cn https://ctcc2-node.bt.cn https://hk1-node.bt.cn https://na1-node.bt.cn https://jp1-node.bt.cn);
nodes=(https://dg2.bt.cn https://download.bt.cn https://ctcc1-node.bt.cn https://cmcc1-node.bt.cn https://ctcc2-node.bt.cn https://hk1-node.bt.cn https://na1-node.bt.cn https://jp1-node.bt.cn https://cf1-node.aapanel.com);
if [ "$1" ];then
nodes=($(echo ${nodes[*]}|sed "s#${1}##"))
@@ -255,7 +245,7 @@ get_node_url(){
NODE_STATUS=$(echo ${NODE_CHECK}|awk '{print $2}')
TIME_TOTAL=$(echo ${NODE_CHECK}|awk '{print $3 * 1000 - 500 }'|cut -d '.' -f 1)
if [ "${NODE_STATUS}" == "200" ];then
if [ $TIME_TOTAL -lt 100 ];then
if [ $TIME_TOTAL -lt 300 ];then
if [ $RES -ge 1500 ];then
echo "$RES $node" >> $tmp_file1
fi
@@ -266,8 +256,8 @@ get_node_url(){
fi
i=$(($i+1))
if [ $TIME_TOTAL -lt 100 ];then
if [ $RES -ge 3000 ];then
if [ $TIME_TOTAL -lt 300 ];then
if [ $RES -ge 2390 ];then
break;
fi
fi
@@ -403,7 +393,7 @@ Install_Deb_Pack(){
apt-get install curl -y
fi
debPacks="wget curl libcurl4-openssl-dev gcc make zip unzip tar openssl libssl-dev gcc libxml2 libxml2-dev zlib1g zlib1g-dev libjpeg-dev libpng-dev lsof libpcre3 libpcre3-dev cron net-tools swig build-essential libffi-dev libbz2-dev libncurses-dev libsqlite3-dev libreadline-dev tk-dev libgdbm-dev libdb-dev libdb++-dev libpcap-dev xz-utils git qrencode";
debPacks="wget curl libcurl4-openssl-dev gcc make zip unzip tar openssl libssl-dev gcc libxml2 libxml2-dev zlib1g zlib1g-dev libjpeg-dev libpng-dev lsof libpcre3 libpcre3-dev cron net-tools swig build-essential libffi-dev libbz2-dev libncurses-dev libsqlite3-dev libreadline-dev tk-dev libgdbm-dev libdb-dev libdb++-dev libpcap-dev xz-utils git qrencode sqlite3";
apt-get install -y $debPacks --force-yes
for debPack in ${debPacks}
@@ -435,6 +425,17 @@ Get_Versions(){
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
os_type='el'
is_aliyunos=$(cat $redhat_version_file|grep Aliyun)
@@ -508,7 +509,7 @@ Install_Python_Lib(){
chmod -R 700 $pyenv_path/pyenv/bin
is_package=$($python_bin -m psutil 2>&1|grep package)
if [ "$is_package" = "" ];then
wget -O $pyenv_path/pyenv/pip.txt $download_Url/install/pyenv/pip.txt -T 5
wget -O $pyenv_path/pyenv/pip.txt $download_Url/install/pyenv/pip.txt -T 15
$pyenv_path/pyenv/bin/pip install -U pip
$pyenv_path/pyenv/bin/pip install -U setuptools==65.5.0
$pyenv_path/pyenv/bin/pip install -r $pyenv_path/pyenv/pip.txt
@@ -581,13 +582,15 @@ Install_Python_Lib(){
os_version=""
rm -f /www/server/panel/pymake.pl
fi
echo "==============================================="
echo "正在下载面板运行环境,请稍等..............."
echo "==============================================="
if [ "${os_version}" != "" ];then
pyenv_file="/www/pyenv.tar.gz"
wget -O $pyenv_file $download_Url/install/pyenv/pyenv-${os_type}${os_version}-x${is64bit}.tar.gz -T 10
wget -O $pyenv_file $download_Url/install/pyenv/pyenv-${os_type}${os_version}-x${is64bit}.tar.gz -T 15
if [ "$?" != "0" ];then
get_node_url $download_Url
wget -O $pyenv_file $download_Url/install/pyenv/pyenv-${os_type}${os_version}-x${is64bit}.tar.gz -T 10
wget -O $pyenv_file $download_Url/install/pyenv/pyenv-${os_type}${os_version}-x${is64bit}.tar.gz -T 15
fi
tmp_size=$(du -b $pyenv_file|awk '{print $1}')
if [ $tmp_size -lt 703460 ];then
@@ -618,7 +621,7 @@ Install_Python_Lib(){
cd /www
python_src='/www/python_src.tar.xz'
python_src_path="/www/Python-${py_version}"
wget -O $python_src $download_Url/src/Python-${py_version}.tar.xz -T 5
wget -O $python_src $download_Url/src/Python-${py_version}.tar.xz -T 15
tmp_size=$(du -b $python_src|awk '{print $1}')
if [ $tmp_size -lt 10703460 ];then
rm -f $python_src
@@ -672,11 +675,8 @@ Install_Python_Lib(){
fi
}
Install_Bt(){
panelPort="8888"
if [ -f ${setup_path}/server/panel/data/port.pl ];then
panelPort=$(cat ${setup_path}/server/panel/data/port.pl)
else
panelPort=$(expr $RANDOM % 55535 + 10000)
fi
if [ "${PANEL_PORT}" ];then
panelPort=$PANEL_PORT
@@ -701,9 +701,12 @@ Install_Bt(){
sleep 1
fi
wget -O /etc/init.d/bt ${download_Url}/install/src/bt6.init -T 10
wget -O /www/server/panel/install/public.sh ${Btapi_Url}/install/public.sh -T 10
wget -O panel.zip ${Btapi_Url}/install/src/panel6.zip -T 10
wget -O /etc/init.d/bt ${download_Url}/install/src/bt6.init -T 15
wget -O /www/server/panel/install/public.sh ${Btapi_Url}/install/public.sh -T 15
echo "=============================================="
echo "正在下载面板文件,请稍等..................."
echo "=============================================="
wget -O panel.zip ${Btapi_Url}/install/src/panel6.zip -T 15
if [ -f "${setup_path}/server/panel/data/default.db" ];then
if [ -d "/${setup_path}/server/panel/old_data" ];then
@@ -716,6 +719,11 @@ Install_Bt(){
mv -f ${setup_path}/server/panel/data/system.db ${setup_path}/server/panel/old_data/system.db
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
if [ -d "${setup_path}/server/panel/data/db" ];then
\cp -r ${setup_path}/server/panel/data/db ${setup_path}/server/panel/old_data/
fi
fi
if [ ! -f "/usr/bin/unzip" ]; then
@@ -734,6 +742,11 @@ Install_Bt(){
mv -f ${setup_path}/server/panel/old_data/system.db ${setup_path}/server/panel/data/system.db
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
if [ -d "${setup_path}/server/panel/old_data/db" ];then
\cp -r ${setup_path}/server/panel/old_data/db ${setup_path}/server/panel/data/
fi
if [ -d "/${setup_path}/server/panel/old_data" ];then
rm -rf ${setup_path}/server/panel/old_data
fi
@@ -743,6 +756,11 @@ Install_Bt(){
ls -lh panel.zip
Red_Error "ERROR: Failed to download, please try install again!" "ERROR: 下载宝塔失败,请尝试重新安装!"
fi
SYS_LOG_CHECK=$(grep ^weekly /etc/logrotate.conf)
if [ "${SYS_LOG_CHECK}" ];then
sed -i 's/rotate [0-9]*/rotate 8/g' /etc/logrotate.conf
fi
rm -f panel.zip
rm -f ${setup_path}/server/panel/class/*.pyc
@@ -753,8 +771,8 @@ Install_Bt(){
chmod -R +x ${setup_path}/server/panel/script
ln -sf /etc/init.d/bt /usr/bin/bt
echo "${panelPort}" > ${setup_path}/server/panel/data/port.pl
wget -O /etc/init.d/bt ${download_Url}/install/src/bt7.init -T 10
wget -O /www/server/panel/init.sh ${download_Url}/install/src/bt7.init -T 10
wget -O /etc/init.d/bt ${download_Url}/install/src/bt7.init -T 15
wget -O /www/server/panel/init.sh ${download_Url}/install/src/bt7.init -T 15
wget -O /www/server/panel/data/softList.conf ${download_Url}/install/conf/softList.conf
rm -f /www/server/panel/class/*.so
@@ -800,18 +818,22 @@ Set_Bt_Panel(){
echo "/${auth_path}" > ${admin_auth}
fi
chmod -R 700 $pyenv_path/pyenv/bin
btpip install docxtpl==0.16.7
/www/server/panel/pyenv/bin/pip3 install pymongo
/www/server/panel/pyenv/bin/pip3 install psycopg2-binary
/www/server/panel/pyenv/bin/pip3 install flask -U
/www/server/panel/pyenv/bin/pip3 install flask-sock
btpip install simple-websocket==0.10.0
if [ ! -f "/www/server/panel/pyenv/n.pl" ];then
btpip install docxtpl==0.16.7
/www/server/panel/pyenv/bin/pip3 install pymongo
/www/server/panel/pyenv/bin/pip3 install psycopg2-binary
/www/server/panel/pyenv/bin/pip3 install flask -U
/www/server/panel/pyenv/bin/pip3 install flask-sock
/www/server/panel/pyenv/bin/pip3 install -I gevent
btpip install simple-websocket==0.10.0
btpip install natsort
btpip uninstall enum34 -y
btpip install geoip2==4.7.0
btpip install brotli
btpip install PyMySQL
fi
auth_path=$(cat ${admin_auth})
cd ${setup_path}/server/panel/
if [ "$SET_SSL" == true ]; then
btpip install -I pyOpenSSl 2>/dev/null
btpython /www/server/panel/tools.py ssl
fi
/etc/init.d/bt start
$python_bin -m py_compile tools.py
$python_bin tools.py username
@@ -823,6 +845,21 @@ Set_Bt_Panel(){
echo "${password}" > ${setup_path}/server/panel/default.pl
chmod 600 ${setup_path}/server/panel/default.pl
sleep 3
if [ "$SET_SSL" == true ]; then
if [ ! -f "/www/server/panel/pyenv/n.pl" ];then
btpip install -I pyOpenSSl 2>/dev/null
fi
echo "========================================"
echo "正在开启面板SSL请稍等............ "
echo "========================================"
SSL_STATUS=$(btpython /www/server/panel/tools.py ssl)
if [ "${SSL_STATUS}" == "0" ] ;then
echo -n " -4 " > /www/server/panel/data/v4.pl
btpython /www/server/panel/tools.py ssl
fi
echo "证书开启成功!"
echo "========================================"
fi
/etc/init.d/bt restart
sleep 3
isStart=$(ps aux |grep 'BT-Panel'|grep -v grep|awk '{print $2}')
@@ -841,6 +878,9 @@ Set_Bt_Panel(){
btpython -c 'import tools;tools.set_panel_username("'$PANEL_USER'")'
cd ~
fi
if [ -f "/usr/bin/sqlite3" ] ;then
sqlite3 /www/server/panel/data/db/panel.db "UPDATE config SET status = '1' WHERE id = '1';" > /dev/null 2>&1
fi
}
Set_Firewall(){
sshPort=$(cat /etc/ssh/sshd_config | grep 'Port '|awk '{print $2}')
@@ -973,6 +1013,7 @@ Install_Main(){
Get_Ip_Address
Setup_Count ${IDC_CODE}
Add_lib_Install
}
echo "
@@ -981,7 +1022,7 @@ echo "
+----------------------------------------------------------------------
| Copyright © 2015-2099 BT-SOFT(http://www.bt.cn) All rights reserved.
+----------------------------------------------------------------------
| The WebPanel URL will be http://SERVER_IP:8888 when installed.
| The WebPanel URL will be http://SERVER_IP:${panelPort} when installed.
+----------------------------------------------------------------------
| 为了您的正常使用,请确保使用全新或纯净的系统安装宝塔面板,不支持已部署项目/环境的系统安装
+----------------------------------------------------------------------
@@ -1059,7 +1100,12 @@ echo -e ""
echo -e "=================================================================="
endTime=`date +%s`
((outTime=($endTime-$startTime)/60))
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
if [ "${outTime}" == "0" ];then
((outTime=($endTime-$startTime)))
echo -e "Time consumed:\033[32m $outTime \033[0mseconds!"
else
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
fi

View File

@@ -9,8 +9,13 @@ export PATH
export LANG=en_US.UTF-8
export LANGUAGE=en_US:en
NODE_FILE_CHECK=$(cat /www/server/panel/data/node.json |grep 125.88.182.172)
if [ "${NODE_FILE_CHECK}" ];then
rm -f /www/server/panel/data/node.json
fi
get_node_url(){
nodes=(https://dg2.bt.cn https://download.bt.cn https://ctcc1-node.bt.cn https://cmcc1-node.bt.cn https://ctcc2-node.bt.cn https://hk1-node.bt.cn https://na1-node.bt.cn https://jp1-node.bt.cn);
nodes=(https://dg2.bt.cn https://download.bt.cn https://ctcc1-node.bt.cn https://cmcc1-node.bt.cn https://ctcc2-node.bt.cn https://hk1-node.bt.cn https://na1-node.bt.cn https://jp1-node.bt.cn https://cf1-node.aapanel.com);
if [ "$1" ];then
nodes=($(echo ${nodes[*]}|sed "s#${1}##"))
@@ -40,8 +45,8 @@ get_node_url(){
fi
i=$(($i+1))
if [ $TIME_TOTAL -lt 200 ];then
if [ $RES -ge 3000 ];then
if [ $TIME_TOTAL -lt 300 ];then
if [ $RES -ge 2390 ];then
break;
fi
fi

Binary file not shown.

View File

@@ -18,6 +18,11 @@ if [ ! -f "/www/server/panel/pyenv/bin/python3" ];then
echo "请截图发帖至论坛www.bt.cn/bbs求助"
exit 0;
fi
Centos6Check=$(cat /etc/redhat-release | grep ' 6.' | grep -iE 'centos|Red Hat')
if [ "${Centos6Check}" ];then
echo "Centos6不支持升级宝塔面板建议备份数据重装更换Centos7/8安装宝塔面板"
exit 1
fi
public_file=/www/server/panel/install/public.sh
if [ ! -f $public_file ];then
@@ -42,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.1'
version='8.2.0'
fi
armCheck=$(uname -m|grep arm)
if [ "${armCheck}" ];then
@@ -58,6 +63,7 @@ if [ $dsize -lt 10240 ];then
echo "获取更新包失败,请稍后更新或联系宝塔运维"
exit;
fi
unzip -o /tmp/panel.zip -d $setup_path/server/ > /dev/null
rm -f /tmp/panel.zip
cd $setup_path/server/panel/
@@ -67,17 +73,24 @@ if [ "${check_bt}" = "" ];then
wget -O /etc/init.d/bt $download_Url/install/src/bt7.init -T 20
chmod +x /etc/init.d/bt
fi
echo "=============================================================="
echo "正在修复面板依赖问题"
rm -f /www/server/panel/*.pyc
rm -f /www/server/panel/class/*.pyc
#pip install flask_sqlalchemy
#pip install itsdangerous==0.24
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
@@ -92,12 +105,59 @@ pymysql=$(echo "$pip_list"|grep pymysql)
if [ "$pymysql" = "" ];then
$mypip install pymysql
fi
GEVENT_V=$(btpip list 2> /dev/null|grep "gevent "|awk '{print $2}'|cut -f 1 -d '.')
if [ "${GEVENT_V}" -le "1" ];then
/www/server/panel/pyenv/bin/pip3 install -I gevent
fi
BROTLI_C=$(btpip list 2> /dev/null |grep Brotli)
if [ -z "$BROTLI_C" ]; then
btpip install brotli
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
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
$mypip install pycryptodome
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
@@ -126,6 +186,12 @@ if [ ! -f /www/server/panel/data/total_nps.pl ]; then
echo "" > /www/server/panel/data/total_nps.pl
fi
echo "==========================================="
echo "正在更新面板文件..............."
sleep 1
echo "更新完成!"
echo "==========================================="
chattr -i /etc/init.d/bt
chmod +x /etc/init.d/bt
echo "====================================="

View File

@@ -14,10 +14,14 @@ if [ "${is64bit}" != '64' ];then
echo "退出、不做任何操作"
exit 1
fi
Centos6Check=$(cat /etc/redhat-release | grep ' 6.' | grep -iE 'centos|Red Hat')
if [ "${Centos6Check}" ];then
echo "Centos6不支持升级宝塔面板建议备份数据重装更换Centos7/8安装宝塔面板"
exit 1
fi
Btapi_Url='http://www.example.com'
up_plugin=0
download_file(){

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 KiB

After

Width:  |  Height:  |  Size: 206 KiB

View File

@@ -17,11 +17,17 @@ Route::post('/Auth/GetAuthToken', 'api/get_auth_token');
Route::post('/Auth/GetBindCode', 'api/return_error');
Route::any('/bt_monitor/update_history', 'api/btm_update_history');
Route::any('/bt_monitor/latest_version', 'api/btm_latest_version');
Route::any('/bt_waf/get_malicious_ip', 'api/get_ssl_list');
Route::any('/bt_waf/daily_count_v2', 'api/get_ssl_list');
Route::any('/bt_waf/latest_version', 'api/btwaf_latest_version');
Route::group('authorization', function () {
Route::post('/login', 'api/authorization_login');
Route::post('/info', 'api/authorization_info');
Route::post('/info_v2', 'api/authorization_info');
Route::post('/update_license', 'api/update_license');
Route::post('/get_unactivated_licenses', 'api/get_ssl_list');
Route::post('/is_obtained_btw_trial', 'api/is_obtained_btw_trial');
Route::miss('api/return_error');
});
@@ -43,6 +49,7 @@ Route::group('api', function () {
Route::get('/index/get_win_date', 'api/get_win_date');
Route::get('/panel/is_pro', 'api/is_pro');
Route::get('/getIpAddress', 'api/get_ip_address');
Route::get('/GetAD', 'api/return_empty');
Route::post('/Auth/GetAuthToken', 'api/get_auth_token');
Route::post('/Auth/GetBindCode', 'api/return_error');
Route::post('/Auth/GetSSLList', 'api/get_ssl_list');
@@ -104,11 +111,13 @@ Route::group('api', function () {
Route::get('/wpanel/get_beta_logs', 'api/get_beta_logs');
Route::post('/v2/common_v1_authorization/get_pricing', 'api/return_error2');
Route::post('/v2/common_v2_authorization/get_pricing', 'api/return_error2');
Route::any('/bt_waf/getSpiders', 'api/btwaf_getspiders');
Route::post('/bt_waf/addSpider', 'api/return_empty');
Route::post('/bt_waf/getVulScanInfoList', 'api/return_empty');
Route::post('/bt_waf/reportInterceptFail', 'api/return_empty');
Route::any('/panel/get_spider', 'api/get_spider');
Route::miss('api/return_error');
});

View File

@@ -1,458 +1,483 @@
/*
*宝塔面板去除各种计算题与延时等待
*/
if("undefined" != typeof bt && bt.hasOwnProperty("show_confirm")){
bt.show_confirm = function(title, msg, callback, error) {
layer.open({
type: 1,
title: title,
area: "365px",
closeBtn: 2,
shadeClose: true,
btn: [lan['public'].ok, lan['public'].cancel],
content: "<div class='bt-form webDelete pd20'>\
<p style='font-size:13px;word-break: break-all;margin-bottom: 5px;'>" + msg + "</p>" + (error || '') + "\
</div>",
yes: function (index, layero) {
layer.close(index);
if (callback) callback();
}
});
}
}
if("undefined" != typeof bt && bt.hasOwnProperty("prompt_confirm")){
bt.prompt_confirm = function (title, msg, callback) {
layer.open({
type: 1,
title: title,
area: "350px",
closeBtn: 2,
btn: ['确认', '取消'],
content: "<div class='bt-form promptDelete pd20'>\
<p>" + msg + "</p>\
</div>",
yes: function (layers, index) {
layer.close(layers)
if (callback) callback()
}
});
}
}
if("undefined" != typeof bt && bt.hasOwnProperty("compute_confirm")){
bt.compute_confirm = function (config, callback) {
layer.open({
type: 1,
title: config.title,
area: '430px',
closeBtn: 2,
shadeClose: true,
btn: [lan['public'].ok, lan['public'].cancel],
content:
'<div class="bt-form hint_confirm pd30">\
<div class="hint_title">\
<i class="hint-confirm-icon"></i>\
<div class="hint_con">' +
config.msg +
'</div>\
</div>\
</div>',
yes: function (layers, index) {
layer.close(layers)
if (callback) callback()
}
});
}
}
if("undefined" != typeof database && database.hasOwnProperty("del_database")){
database.del_database = function (wid, dbname, obj, callback) {
var is_db_type = false, del_data = []
if (typeof wid === 'object') {
del_data = wid
is_db_type = wid.some(function (item) {
return item.db_type > 0
})
var ids = [];
for (var i = 0; i < wid.length; i++) {
ids.push(wid[i].id);
}
wid = ids
}
var type = $('.database-pos .tabs-item.active').data('type'),
title = '',
tips = '';
title = typeof dbname === "function" ? '批量删除数据库' : '删除数据库 - [ ' + dbname + ' ]';
tips = is_db_type || !recycle_bin_db_open || type !== 'mysql' ? '<span class="color-red">当前列表存在彻底删除后无法恢复的数据库</span>,请仔细查看列表,以防误删,是否继续操作?' : '当前列表数据库将迁移至数据库回收站,如需彻底删除请前往数据库回收站,是否继续操作?'
var arrs = wid instanceof Array ? wid : [wid]
var ids = JSON.stringify(arrs),
countDown = 9;
if (arrs.length == 1) countDown = 4
var loadT = bt.load('正在检测数据库数据信息,请稍候...'),
param = { url: 'database/' + bt.data.db_tab_name + '/check_del_data', data: { data: JSON.stringify({ ids: ids }) } }
if (bt.data.db_tab_name == 'mysql') param = { url: 'database?action=check_del_data', data: { ids: ids } }
bt_tools.send(param, function (res) {
loadT.close()
layer.open({
type: 1,
title: title,
area: '740px',
skin: 'verify_site_layer_info',
closeBtn: 2,
shadeClose: true,
content: '<div class="check_delete_site_main hint_confirm pd30">' +
"<div class='hint_title'>\
<i class=\'hint-confirm-icon\'></i>\
<div class=\'hint_con\'>"+ tips + "</div>\
</div>"+
'<div id="check_layer_content" class="ptb15">' +
'</div>' +
'<div class="check_layer_message">' +
(is_db_type ? '<span class="color-red">注意:远程数据库暂不支持数据库回收站,选中的数据库将彻底删除</span><br>' : '') +
(!recycle_bin_db_open ? '<span class="color-red">风险操作:当前数据库回收站未开启,删除数据库将永久消失</span><br>' : '')
+ '<span class="color-red">请仔细阅读以上要删除信息,防止数据库被误删</span></div>' +
'</div>',
btn: ['下一步', lan.public.cancel],
success: function (layers) {
setTimeout(function () { $(layers).css('top', ($(window).height() - $(layers).height()) / 2); }, 50)
var rdata = res.data,
newTime = parseInt(new Date().getTime() / 1000),
t_icon = ' <span class="glyphicon glyphicon-info-sign" style="color: red;width:15px;height: 15px;;vertical-align: middle;"></span>';
for (var j = 0; j < rdata.length; j++) {
for (var i = 0; i < del_data.length; i++) {
if (rdata[j].id == del_data[i].id) {
var is_time_rule = (newTime - rdata[j].st_time) > (86400 * 30) && (rdata[j].total > 1024 * 10),
is_database_rule = res.db_size <= rdata[j].total,
database_time = bt.format_data(rdata[j].st_time, 'yyyy-MM-dd'),
database_size = bt.format_size(rdata[j].total);
var f_size = database_size
var t_size = '注意:此数据库较大,可能为重要数据,请谨慎操作.\n数据库' + database_size;
if (rdata[j].total < 2048) t_size = '注意事项:当前数据库不为空,可能为重要数据,请谨慎操作.\n数据库' + database_size;
if (rdata[j].total === 0) t_size = '';
rdata[j]['t_size'] = t_size
rdata[j]['f_size'] = f_size
rdata[j]['database_time'] = database_time
rdata[j]['is_time_rule'] = is_time_rule
rdata[j]['is_database_rule'] = is_database_rule
rdata[j]['db_type'] = del_data[i].db_type
rdata[j]['conn_config'] = del_data[i].conn_config
}
}
}
var filterData = rdata.filter(function (el) {
return ids.indexOf(el.id) != -1
})
bt_tools.table({
el: '#check_layer_content',
data: filterData,
height: '300px',
column: [
{ fid: 'name', title: '数据库名称' },
{
title: '数据库大小', template: function (row) {
return '<span class="' + (row.is_database_rule ? 'warning' : '') + '" style="width: 110px;" title="' + row.t_size + '">' + row.f_size + (row.is_database_rule ? t_icon : '') + '</span>'
}
},
{
title: '数据库位置', template: function (row) {
var type_column = '-'
switch (row.db_type) {
case 0:
type_column = '本地数据库'
break;
case 1:
case 2:
type_column = '远程数据库'
break;
}
return '<span style="width: 110px;" title="' + type_column + '">' + type_column + '</span>'
}
},
{
title: '创建时间', template: function (row) {
return '<span ' + (is_time_rule && row.total != 0 ? 'class="warning"' : '') + ' title="' + (row.is_time_rule && row.total != 0 ? '重要:此数据库创建时间较早,可能为重要数据,请谨慎操作.' : '') + '时间:' + row.database_time + '">' + row.database_time + '</span>'
}
},
{
title: '删除结果', align: 'right', template: function (row, index, ev, _that) {
var _html = ''
switch (row.db_type) {
case 0:
_html = type !== 'mysql' ? '彻底删除' : (!recycle_bin_db_open ? '彻底删除' : '移至回收站')
break;
case 1:
case 2:
_html = '彻底删除'
break;
}
return '<span style="width: 110px;" class="' + (_html === '彻底删除' ? 'warning' + (row.db_type > 0 ? ' remote_database' : '') : '') + '">' + _html + '</span>'
}
}
],
success: function () {
$('#check_layer_content').find('.glyphicon-info-sign').click(function (e) {
var msg = $(this).parent().prop('title')
msg = msg.replace('数据库:','<br>数据库:')
layer.tips(msg, $(this).parent(), { tips: [1, 'red'], time: 3000 })
$(document).click(function (ev) {
layer.closeAll('tips');
$(this).unbind('click');
ev.stopPropagation();
ev.preventDefault();
});
e.stopPropagation();
e.preventDefault();
});
if ($('.remote_database').length) {
$('.remote_database').each(function (index, el) {
var id = $(el).parent().parent().parent().index()
$('#check_layer_content tbody tr').eq(id).css('background-color', '#ff00000a')
})
}
}
})
},
yes: function (indes, layers) {
title = typeof dbname === "function" ? '二次验证信息,批量删除数据库' : '二次验证信息,删除数据库 - [ ' + dbname + ' ]';
if (type !== 'mysql') {
tips = '<span class="color-red">当前数据库暂不支持数据库回收站,删除后将无法恢复</span>,此操作不可逆,是否继续操作?';
} else {
tips = is_db_type ? '<span class="color-red">远程数据库不支持数据库回收站,删除后将无法恢复</span>,此操作不可逆,是否继续操作?' : recycle_bin_db_open ? '删除后如需彻底删除请前往数据库回收站,是否继续操作?' : '删除后可能会影响业务使用,此操作不可逆,是否继续操作?'
}
layer.open({
type: 1,
title: title,
icon: 0,
skin: 'delete_site_layer',
area: "530px",
closeBtn: 2,
shadeClose: true,
content: "<div class=\'bt-form webDelete hint_confirm pd30\' id=\'site_delete_form\'>" +
"<div class='hint_title'>\
<i class=\'hint-confirm-icon\'></i>\
<div class=\'hint_con\'>"+ tips + "</div>\
</div>"+
"<div style=\'color:red;margin:18px 0 18px 18px;font-size:14px;font-weight: bold;\'>注意:数据无价,请谨慎操作!!!" + (type === 'mysql' && !recycle_bin_db_open ? '<br>风险操作:当前数据库回收站未开启,删除数据库将永久消失!' : '') + "</div>"+
"</div>",
btn: ['确认删除', '取消删除'],
yes: function (indexs) {
var data = {
id: wid,
name: dbname
};
if (typeof dbname === "function") {
delete data.id;
delete data.name;
}
layer.close(indexs)
layer.close(indes)
if (typeof dbname === "function") {
dbname(data)
} else {
data.id = data.id[0]
bt.database.del_database(data, function (rdata) {
layer.closeAll()
if (callback) callback(rdata);
bt.msg(rdata);
})
}
}
})
}
})
})
}
}
if("undefined" != typeof site && site.hasOwnProperty("del_site")){
site.del_site = function (wid, wname, callback) {
title = typeof wname === "function" ? '批量删除站点' : '删除站点 [ ' + wname + ' ]';
layer.open({
type: 1,
title: title,
icon: 0,
skin: 'delete_site_layer',
area: "440px",
closeBtn: 2,
shadeClose: true,
content: "<div class=\'bt-form webDelete pd30\' id=\'site_delete_form\'>" +
'<i class="layui-layer-ico layui-layer-ico0"></i>' +
"<div class=\'f13 check_title\'>是否要删除关联的FTP、数据库、站点目录</div>" +
"<div class=\"check_type_group\">" +
"<label><input type=\"checkbox\" name=\"ftp\"><span>FTP</span></label>" +
"<label><input type=\"checkbox\" name=\"database\"><span>数据库</span>" + (!recycle_bin_db_open ? '<span class="glyphicon glyphicon-info-sign" style="color: red"></span>' : '') + "</label>" +
"<label><input type=\"checkbox\" name=\"path\"><span>站点目录</span>" + (!recycle_bin_open ? '<span class="glyphicon glyphicon-info-sign" style="color: red"></span>' : '') + "</label>" +
"</div>" +
"</div>",
btn: [lan.public.ok, lan.public.cancel],
success: function (layers, indexs) {
$(layers).find('.check_type_group label').hover(function () {
var name = $(this).find('input').attr('name');
if (name === 'database' && !recycle_bin_db_open) {
layer.tips('风险操作:当前数据库回收站未开启,删除数据库将永久消失!', this, { tips: [1, 'red'], time: 0 })
} else if (name === 'path' && !recycle_bin_open) {
layer.tips('风险操作:当前文件回收站未开启,删除站点目录将永久消失!', this, { tips: [1, 'red'], time: 0 })
}
}, function () {
layer.closeAll('tips');
});
},
yes: function (indexs) {
var data = { id: wid, webname: wname };
$('#site_delete_form input[type=checkbox]').each(function (index, item) {
if ($(item).is(':checked')) data[$(item).attr('name')] = 1
})
var is_database = data.hasOwnProperty('database'), is_path = data.hasOwnProperty('path'), is_ftp = data.hasOwnProperty('ftp');
if ((!is_database && !is_path) && (!is_ftp || is_ftp)) {
if (typeof wname === "function") {
wname(data)
return false;
}
bt.site.del_site(data, function (rdata) {
layer.close(indexs);
if (callback) callback(rdata);
bt.msg(rdata);
})
return false
}
if (typeof wname === "function") {
delete data.id;
delete data.webname;
}
layer.close(indexs)
var ids = JSON.stringify(wid instanceof Array ? wid : [wid]), countDown = typeof wname === 'string' ? 4 : 9;
title = typeof wname === "function" ? '二次验证信息,批量删除站点' : '二次验证信息,删除站点 [ ' + wname + ' ]';
var loadT = bt.load('正在检测站点数据信息,请稍候...')
bt.send('check_del_data', 'site/check_del_data', { ids: ids }, function (res) {
loadT.close()
layer.open({
type: 1,
title: title,
closeBtn: 2,
skin: 'verify_site_layer_info',
area: '740px',
content: '<div class="check_delete_site_main pd30">' +
'<i class="layui-layer-ico layui-layer-ico0"></i>' +
'<div class="check_layer_title">堡塔温馨提示您,请冷静几秒钟,确认以下要删除的数据。</div>' +
'<div class="check_layer_content">' +
'<div class="check_layer_item">' +
'<div class="check_layer_site"></div>' +
'<div class="check_layer_database"></div>' +
'</div>' +
'</div>' +
'<div class="check_layer_error ' + (is_database && data['database'] && !recycle_bin_db_open ? '' : 'hide') + '"><span class="glyphicon glyphicon-info-sign"></span>风险事项:当前未开启数据库回收站功能,删除数据库后,数据库将永久消失!</div>' +
'<div class="check_layer_error ' + (is_path && data['path'] && !recycle_bin_open ? '' : 'hide') + '"><span class="glyphicon glyphicon-info-sign"></span>风险事项:当前未开启文件回收站功能,删除站点目录后,站点目录将永久消失!</div>' +
'<div class="check_layer_message"><span style="color:red">注意:请仔细阅读以上要删除信息,防止网站数据被误删</span></div>' +
'</div>',
// recycle_bin_db_open &&
// recycle_bin_open &&
btn: ['确认删除', '取消删除'],
success: function (layers) {
var html = '', rdata = res.data;
for (var i = 0; i < rdata.length; i++) {
var item = rdata[i], newTime = parseInt(new Date().getTime() / 1000),
t_icon = '<span class="glyphicon glyphicon-info-sign" style="color: red;width:15px;height: 15px;;vertical-align: middle;"></span>';
site_html = (function (item) {
if (!is_path) return ''
var is_time_rule = (newTime - item.st_time) > (86400 * 30) && (item.total > 1024 * 10),
is_path_rule = res.file_size <= item.total,
dir_time = bt.format_data(item.st_time, 'yyyy-MM-dd'),
dir_size = bt.format_size(item.total);
var f_html = '<i ' + (is_path_rule ? 'class="warning"' : '') + ' style = "vertical-align: middle;" > ' + (item.limit ? '大于50MB' : dir_size) + '</i> ' + (is_path_rule ? t_icon : '');
var f_title = (is_path_rule ? '注意:此目录较大,可能为重要数据,请谨慎操作.\n' : '') + '目录:' + item.path + '(' + (item.limit ? '大于' : '') + dir_size + ')';
return '<div class="check_layer_site">' +
'<span title="站点:' + item.name + '">站点名:' + item.name + '</span>' +
'<span title="' + f_title + '" >目录:<span style="vertical-align: middle;max-width: 160px;width: auto;">' + item.path + '</span> (' + f_html + ')</span>' +
'<span title="' + (is_time_rule ? '注意:此站点创建时间较早,可能为重要数据,请谨慎操作.\n' : '') + '时间:' + dir_time + '">创建时间:<i ' + (is_time_rule ? 'class="warning"' : '') + '>' + dir_time + '</i></span>' +
'</div>'
}(item)),
database_html = (function (item) {
if (!is_database || !item.database) return '';
var is_time_rule = (newTime - item.st_time) > (86400 * 30) && (item.total > 1024 * 10),
is_database_rule = res.db_size <= item.database.total,
database_time = bt.format_data(item.database.st_time, 'yyyy-MM-dd'),
database_size = bt.format_size(item.database.total);
var f_size = '<i ' + (is_database_rule ? 'class="warning"' : '') + ' style = "vertical-align: middle;" > ' + database_size + '</i> ' + (is_database_rule ? t_icon : '');
var t_size = '注意:此数据库较大,可能为重要数据,请谨慎操作.\n数据库' + database_size;
return '<div class="check_layer_database">' +
'<span title="数据库:' + item.database.name + '">数据库:' + item.database.name + '</span>' +
'<span title="' + t_size + '">大小:' + f_size + '</span>' +
'<span title="' + (is_time_rule && item.database.total != 0 ? '重要:此数据库创建时间较早,可能为重要数据,请谨慎操作.' : '') + '时间:' + database_time + '">创建时间:<i ' + (is_time_rule && item.database.total != 0 ? 'class="warning"' : '') + '>' + database_time + '</i></span>' +
'</div>'
}(item))
if ((site_html + database_html) !== '') html += '<div class="check_layer_item">' + site_html + database_html + '</div>';
}
if (html === '') html = '<div style="text-align: center;width: 100%;height: 100%;line-height: 300px;font-size: 15px;">无数据</div>'
$('.check_layer_content').html(html)
},
yes: function (indes, layers) {
if (typeof wname === "function") {
wname(data)
} else {
bt.site.del_site(data, function (rdata) {
layer.closeAll()
if (rdata.status) site.get_list();
if (callback) callback(rdata);
bt.msg(rdata);
})
}
}
})
})
}
})
}
}
if("undefined" != typeof bt && bt.hasOwnProperty("firewall") && bt.firewall.hasOwnProperty("add_accept_port")){
bt.firewall.add_accept_port = function(type, port, ps, callback) {
var action = "AddDropAddress";
if (type == 'port') {
ports = port.split(':');
if (port.indexOf('-') != -1) ports = port.split('-');
for (var i = 0; i < ports.length; i++) {
if (!bt.check_port(ports[i])) {
layer.msg('可用端口范围1-65535', { icon: 2 });
// layer.msg(lan.firewall.port_err, {
// icon: 5
// });
return;
}
}
action = "AddAcceptPort";
}
loading = bt.load();
bt.send(action, 'firewall/' + action, { port: port, type: type, ps: ps }, function(rdata) {
loading.close();
if (callback) callback(rdata);
})
}
}
function SafeMessage(j, h, g, f) {
if(f == undefined) {
f = ""
}
var mess = layer.open({
type: 1,
title: j,
area: "350px",
closeBtn: 2,
shadeClose: true,
content: "<div class='bt-form webDelete pd20 pb70'><p>" + h + "</p>" + f + "<div class='bt-form-submit-btn'><button type='button' class='btn btn-danger btn-sm bt-cancel'>"+lan.public.cancel+"</button> <button type='button' id='toSubmit' class='btn btn-success btn-sm' >"+lan.public.ok+"</button></div></div>"
});
$(".bt-cancel").click(function(){
layer.close(mess);
});
$("#toSubmit").click(function() {
layer.close(mess);
g();
})
}
$(document).ready(function () {
if($('#updata_pro_info').length>0){
$('#updata_pro_info').html('');
bt.set_cookie('productPurchase', 1);
}
/*
*宝塔面板去除各种计算题与延时等待
*/
if("undefined" != typeof bt && bt.hasOwnProperty("show_confirm")){
bt.show_confirm = function(title, msg, callback, error) {
layer.open({
type: 1,
title: title,
area: "365px",
closeBtn: 2,
shadeClose: true,
btn: [lan['public'].ok, lan['public'].cancel],
content: "<div class='bt-form webDelete pd20'>\
<p style='font-size:13px;word-break: break-all;margin-bottom: 5px;'>" + msg + "</p>" + (error || '') + "\
</div>",
yes: function (index, layero) {
layer.close(index);
if (callback) callback();
}
});
}
}
if("undefined" != typeof bt && bt.hasOwnProperty("prompt_confirm")){
bt.prompt_confirm = function (title, msg, callback) {
layer.open({
type: 1,
title: title,
area: "350px",
closeBtn: 2,
btn: ['确认', '取消'],
content: "<div class='bt-form promptDelete pd20'>\
<p>" + msg + "</p>\
</div>",
yes: function (layers, index) {
layer.close(layers)
if (callback) callback()
}
});
}
}
if("undefined" != typeof bt && bt.hasOwnProperty("compute_confirm")){
bt.compute_confirm = function (config, callback) {
layer.open({
type: 1,
title: config.title,
area: '430px',
closeBtn: 2,
shadeClose: true,
btn: [lan['public'].ok, lan['public'].cancel],
content:
'<div class="bt-form hint_confirm pd30">\
<div class="hint_title">\
<i class="hint-confirm-icon"></i>\
<div class="hint_con">' +
config.msg +
'</div>\
</div>\
</div>',
yes: function (layers, index) {
layer.close(layers)
if (callback) callback()
}
});
}
}
if("undefined" != typeof bt && bt.hasOwnProperty("input_confirm")){
bt.input_confirm = function (config, callback) {
layer.open({
type: 1,
title: config.title,
area: '430px',
closeBtn: 2,
shadeClose: true,
btn: [lan['public'].ok, lan['public'].cancel],
content:
'<div class="bt-form hint_confirm pd30">\
<div class="hint_title">\
<i class="hint-confirm-icon"></i>\
<div class="hint_con">' +
config.msg +
'</div>\
</div>\
</div>',
yes: function (layers, index) {
layer.close(layers);
if (callback) callback();
},
});
}
}
if("undefined" != typeof database && database.hasOwnProperty("del_database")){
database.del_database = function (wid, dbname, obj, callback) {
var is_db_type = false, del_data = []
if (typeof wid === 'object') {
del_data = wid
is_db_type = wid.some(function (item) {
return item.db_type > 0
})
var ids = [];
for (var i = 0; i < wid.length; i++) {
ids.push(wid[i].id);
}
wid = ids
}
var type = $('.database-pos .tabs-item.active').data('type'),
title = '',
tips = '';
title = typeof dbname === "function" ? '批量删除数据库' : '删除数据库 - [ ' + dbname + ' ]';
tips = is_db_type || !recycle_bin_db_open || type !== 'mysql' ? '<span class="color-red">当前列表存在彻底删除后无法恢复的数据库</span>,请仔细查看列表,以防误删,是否继续操作?' : '当前列表数据库将迁移至数据库回收站,如需彻底删除请前往数据库回收站,是否继续操作?'
var arrs = wid instanceof Array ? wid : [wid]
var ids = JSON.stringify(arrs),
countDown = 9;
if (arrs.length == 1) countDown = 4
var loadT = bt.load('正在检测数据库数据信息,请稍候...'),
param = { url: 'database/' + bt.data.db_tab_name + '/check_del_data', data: { data: JSON.stringify({ ids: ids }) } }
if (bt.data.db_tab_name == 'mysql') param = { url: 'database?action=check_del_data', data: { ids: ids } }
bt_tools.send(param, function (res) {
loadT.close()
layer.open({
type: 1,
title: title,
area: '740px',
skin: 'verify_site_layer_info',
closeBtn: 2,
shadeClose: true,
content: '<div class="check_delete_site_main hint_confirm pd30">' +
"<div class='hint_title'>\
<i class=\'hint-confirm-icon\'></i>\
<div class=\'hint_con\'>"+ tips + "</div>\
</div>"+
'<div id="check_layer_content" class="ptb15">' +
'</div>' +
'<div class="check_layer_message">' +
(is_db_type ? '<span class="color-red">注意:远程数据库暂不支持数据库回收站,选中的数据库将彻底删除</span><br>' : '') +
(!recycle_bin_db_open ? '<span class="color-red">风险操作:当前数据库回收站未开启,删除数据库将永久消失</span><br>' : '')
+ '<span class="color-red">请仔细阅读以上要删除信息,防止数据库被误删</span></div>' +
'</div>',
btn: ['下一步', lan.public.cancel],
success: function (layers) {
setTimeout(function () { $(layers).css('top', ($(window).height() - $(layers).height()) / 2); }, 50)
var rdata = res.data,
newTime = parseInt(new Date().getTime() / 1000),
t_icon = ' <span class="glyphicon glyphicon-info-sign" style="color: red;width:15px;height: 15px;;vertical-align: middle;"></span>';
for (var j = 0; j < rdata.length; j++) {
for (var i = 0; i < del_data.length; i++) {
if (rdata[j].id == del_data[i].id) {
var is_time_rule = (newTime - rdata[j].st_time) > (86400 * 30) && (rdata[j].total > 1024 * 10),
is_database_rule = res.db_size <= rdata[j].total,
database_time = bt.format_data(rdata[j].st_time, 'yyyy-MM-dd'),
database_size = bt.format_size(rdata[j].total);
var f_size = database_size
var t_size = '注意:此数据库较大,可能为重要数据,请谨慎操作.\n数据库' + database_size;
if (rdata[j].total < 2048) t_size = '注意事项:当前数据库不为空,可能为重要数据,请谨慎操作.\n数据库' + database_size;
if (rdata[j].total === 0) t_size = '';
rdata[j]['t_size'] = t_size
rdata[j]['f_size'] = f_size
rdata[j]['database_time'] = database_time
rdata[j]['is_time_rule'] = is_time_rule
rdata[j]['is_database_rule'] = is_database_rule
rdata[j]['db_type'] = del_data[i].db_type
rdata[j]['conn_config'] = del_data[i].conn_config
}
}
}
var filterData = rdata.filter(function (el) {
return ids.indexOf(el.id) != -1
})
bt_tools.table({
el: '#check_layer_content',
data: filterData,
height: '300px',
column: [
{ fid: 'name', title: '数据库名称' },
{
title: '数据库大小', template: function (row) {
return '<span class="' + (row.is_database_rule ? 'warning' : '') + '" style="width: 110px;" title="' + row.t_size + '">' + row.f_size + (row.is_database_rule ? t_icon : '') + '</span>'
}
},
{
title: '数据库位置', template: function (row) {
var type_column = '-'
switch (row.db_type) {
case 0:
type_column = '本地数据库'
break;
case 1:
case 2:
type_column = '远程数据库'
break;
}
return '<span style="width: 110px;" title="' + type_column + '">' + type_column + '</span>'
}
},
{
title: '创建时间', template: function (row) {
return '<span ' + (is_time_rule && row.total != 0 ? 'class="warning"' : '') + ' title="' + (row.is_time_rule && row.total != 0 ? '重要:此数据库创建时间较早,可能为重要数据,请谨慎操作.' : '') + '时间:' + row.database_time + '">' + row.database_time + '</span>'
}
},
{
title: '删除结果', align: 'right', template: function (row, index, ev, _that) {
var _html = ''
switch (row.db_type) {
case 0:
_html = type !== 'mysql' ? '彻底删除' : (!recycle_bin_db_open ? '彻底删除' : '移至回收站')
break;
case 1:
case 2:
_html = '彻底删除'
break;
}
return '<span style="width: 110px;" class="' + (_html === '彻底删除' ? 'warning' + (row.db_type > 0 ? ' remote_database' : '') : '') + '">' + _html + '</span>'
}
}
],
success: function () {
$('#check_layer_content').find('.glyphicon-info-sign').click(function (e) {
var msg = $(this).parent().prop('title')
msg = msg.replace('数据库:','<br>数据库:')
layer.tips(msg, $(this).parent(), { tips: [1, 'red'], time: 3000 })
$(document).click(function (ev) {
layer.closeAll('tips');
$(this).unbind('click');
ev.stopPropagation();
ev.preventDefault();
});
e.stopPropagation();
e.preventDefault();
});
if ($('.remote_database').length) {
$('.remote_database').each(function (index, el) {
var id = $(el).parent().parent().parent().index()
$('#check_layer_content tbody tr').eq(id).css('background-color', '#ff00000a')
})
}
}
})
},
yes: function (indes, layers) {
title = typeof dbname === "function" ? '二次验证信息,批量删除数据库' : '二次验证信息,删除数据库 - [ ' + dbname + ' ]';
if (type !== 'mysql') {
tips = '<span class="color-red">当前数据库暂不支持数据库回收站,删除后将无法恢复</span>,此操作不可逆,是否继续操作?';
} else {
tips = is_db_type ? '<span class="color-red">远程数据库不支持数据库回收站,删除后将无法恢复</span>,此操作不可逆,是否继续操作?' : recycle_bin_db_open ? '删除后如需彻底删除请前往数据库回收站,是否继续操作?' : '删除后可能会影响业务使用,此操作不可逆,是否继续操作?'
}
layer.open({
type: 1,
title: title,
icon: 0,
skin: 'delete_site_layer',
area: "530px",
closeBtn: 2,
shadeClose: true,
content: "<div class=\'bt-form webDelete hint_confirm pd30\' id=\'site_delete_form\'>" +
"<div class='hint_title'>\
<i class=\'hint-confirm-icon\'></i>\
<div class=\'hint_con\'>"+ tips + "</div>\
</div>"+
"<div style=\'color:red;margin:18px 0 18px 18px;font-size:14px;font-weight: bold;\'>注意:数据无价,请谨慎操作!!!" + (type === 'mysql' && !recycle_bin_db_open ? '<br>风险操作:当前数据库回收站未开启,删除数据库将永久消失!' : '') + "</div>"+
"</div>",
btn: ['确认删除', '取消删除'],
yes: function (indexs) {
var data = {
id: wid,
name: dbname
};
if (typeof dbname === "function") {
delete data.id;
delete data.name;
}
layer.close(indexs)
layer.close(indes)
if (typeof dbname === "function") {
dbname(data)
} else {
data.id = data.id[0]
bt.database.del_database(data, function (rdata) {
layer.closeAll()
if (callback) callback(rdata);
bt.msg(rdata);
})
}
}
})
}
})
})
}
}
if("undefined" != typeof site && site.hasOwnProperty("del_site")){
site.del_site = function (wid, wname, callback) {
title = typeof wname === "function" ? '批量删除站点' : '删除站点 [ ' + wname + ' ]';
layer.open({
type: 1,
title: title,
icon: 0,
skin: 'delete_site_layer',
area: "440px",
closeBtn: 2,
shadeClose: true,
content: "<div class=\'bt-form webDelete pd30\' id=\'site_delete_form\'>" +
'<i class="layui-layer-ico layui-layer-ico0"></i>' +
"<div class=\'f13 check_title\'>是否要删除关联的FTP、数据库、站点目录</div>" +
"<div class=\"check_type_group\">" +
"<label><input type=\"checkbox\" name=\"ftp\"><span>FTP</span></label>" +
"<label><input type=\"checkbox\" name=\"database\"><span>数据库</span>" + (!recycle_bin_db_open ? '<span class="glyphicon glyphicon-info-sign" style="color: red"></span>' : '') + "</label>" +
"<label><input type=\"checkbox\" name=\"path\"><span>站点目录</span>" + (!recycle_bin_open ? '<span class="glyphicon glyphicon-info-sign" style="color: red"></span>' : '') + "</label>" +
"</div>" +
"</div>",
btn: [lan.public.ok, lan.public.cancel],
success: function (layers, indexs) {
$(layers).find('.check_type_group label').hover(function () {
var name = $(this).find('input').attr('name');
if (name === 'database' && !recycle_bin_db_open) {
layer.tips('风险操作:当前数据库回收站未开启,删除数据库将永久消失!', this, { tips: [1, 'red'], time: 0 })
} else if (name === 'path' && !recycle_bin_open) {
layer.tips('风险操作:当前文件回收站未开启,删除站点目录将永久消失!', this, { tips: [1, 'red'], time: 0 })
}
}, function () {
layer.closeAll('tips');
});
},
yes: function (indexs) {
var data = { id: wid, webname: wname };
$('#site_delete_form input[type=checkbox]').each(function (index, item) {
if ($(item).is(':checked')) data[$(item).attr('name')] = 1
})
var is_database = data.hasOwnProperty('database'), is_path = data.hasOwnProperty('path'), is_ftp = data.hasOwnProperty('ftp');
if ((!is_database && !is_path) && (!is_ftp || is_ftp)) {
if (typeof wname === "function") {
wname(data)
return false;
}
bt.site.del_site(data, function (rdata) {
layer.close(indexs);
if (callback) callback(rdata);
bt.msg(rdata);
})
return false
}
if (typeof wname === "function") {
delete data.id;
delete data.webname;
}
layer.close(indexs)
var ids = JSON.stringify(wid instanceof Array ? wid : [wid]), countDown = typeof wname === 'string' ? 4 : 9;
title = typeof wname === "function" ? '二次验证信息,批量删除站点' : '二次验证信息,删除站点 [ ' + wname + ' ]';
var loadT = bt.load('正在检测站点数据信息,请稍候...')
bt.send('check_del_data', 'site/check_del_data', { ids: ids }, function (res) {
loadT.close()
layer.open({
type: 1,
title: title,
closeBtn: 2,
skin: 'verify_site_layer_info',
area: '740px',
content: '<div class="check_delete_site_main pd30">' +
'<i class="layui-layer-ico layui-layer-ico0"></i>' +
'<div class="check_layer_title">堡塔温馨提示您,请冷静几秒钟,确认以下要删除的数据。</div>' +
'<div class="check_layer_content">' +
'<div class="check_layer_item">' +
'<div class="check_layer_site"></div>' +
'<div class="check_layer_database"></div>' +
'</div>' +
'</div>' +
'<div class="check_layer_error ' + (is_database && data['database'] && !recycle_bin_db_open ? '' : 'hide') + '"><span class="glyphicon glyphicon-info-sign"></span>风险事项:当前未开启数据库回收站功能,删除数据库后,数据库将永久消失!</div>' +
'<div class="check_layer_error ' + (is_path && data['path'] && !recycle_bin_open ? '' : 'hide') + '"><span class="glyphicon glyphicon-info-sign"></span>风险事项:当前未开启文件回收站功能,删除站点目录后,站点目录将永久消失!</div>' +
'<div class="check_layer_message"><span style="color:red">注意:请仔细阅读以上要删除信息,防止网站数据被误删</span></div>' +
'</div>',
// recycle_bin_db_open &&
// recycle_bin_open &&
btn: ['确认删除', '取消删除'],
success: function (layers) {
var html = '', rdata = res.data;
for (var i = 0; i < rdata.length; i++) {
var item = rdata[i], newTime = parseInt(new Date().getTime() / 1000),
t_icon = '<span class="glyphicon glyphicon-info-sign" style="color: red;width:15px;height: 15px;;vertical-align: middle;"></span>';
site_html = (function (item) {
if (!is_path) return ''
var is_time_rule = (newTime - item.st_time) > (86400 * 30) && (item.total > 1024 * 10),
is_path_rule = res.file_size <= item.total,
dir_time = bt.format_data(item.st_time, 'yyyy-MM-dd'),
dir_size = bt.format_size(item.total);
var f_html = '<i ' + (is_path_rule ? 'class="warning"' : '') + ' style = "vertical-align: middle;" > ' + (item.limit ? '大于50MB' : dir_size) + '</i> ' + (is_path_rule ? t_icon : '');
var f_title = (is_path_rule ? '注意:此目录较大,可能为重要数据,请谨慎操作.\n' : '') + '目录:' + item.path + '(' + (item.limit ? '大于' : '') + dir_size + ')';
return '<div class="check_layer_site">' +
'<span title="站点:' + item.name + '">站点名:' + item.name + '</span>' +
'<span title="' + f_title + '" >目录:<span style="vertical-align: middle;max-width: 160px;width: auto;">' + item.path + '</span> (' + f_html + ')</span>' +
'<span title="' + (is_time_rule ? '注意:此站点创建时间较早,可能为重要数据,请谨慎操作.\n' : '') + '时间:' + dir_time + '">创建时间:<i ' + (is_time_rule ? 'class="warning"' : '') + '>' + dir_time + '</i></span>' +
'</div>'
}(item)),
database_html = (function (item) {
if (!is_database || !item.database) return '';
var is_time_rule = (newTime - item.st_time) > (86400 * 30) && (item.total > 1024 * 10),
is_database_rule = res.db_size <= item.database.total,
database_time = bt.format_data(item.database.st_time, 'yyyy-MM-dd'),
database_size = bt.format_size(item.database.total);
var f_size = '<i ' + (is_database_rule ? 'class="warning"' : '') + ' style = "vertical-align: middle;" > ' + database_size + '</i> ' + (is_database_rule ? t_icon : '');
var t_size = '注意:此数据库较大,可能为重要数据,请谨慎操作.\n数据库' + database_size;
return '<div class="check_layer_database">' +
'<span title="数据库:' + item.database.name + '">数据库:' + item.database.name + '</span>' +
'<span title="' + t_size + '">大小:' + f_size + '</span>' +
'<span title="' + (is_time_rule && item.database.total != 0 ? '重要:此数据库创建时间较早,可能为重要数据,请谨慎操作.' : '') + '时间:' + database_time + '">创建时间:<i ' + (is_time_rule && item.database.total != 0 ? 'class="warning"' : '') + '>' + database_time + '</i></span>' +
'</div>'
}(item))
if ((site_html + database_html) !== '') html += '<div class="check_layer_item">' + site_html + database_html + '</div>';
}
if (html === '') html = '<div style="text-align: center;width: 100%;height: 100%;line-height: 300px;font-size: 15px;">无数据</div>'
$('.check_layer_content').html(html)
},
yes: function (indes, layers) {
if (typeof wname === "function") {
wname(data)
} else {
bt.site.del_site(data, function (rdata) {
layer.closeAll()
if (rdata.status) site.get_list();
if (callback) callback(rdata);
bt.msg(rdata);
})
}
}
})
})
}
})
}
}
if("undefined" != typeof bt && bt.hasOwnProperty("firewall") && bt.firewall.hasOwnProperty("add_accept_port")){
bt.firewall.add_accept_port = function(type, port, ps, callback) {
var action = "AddDropAddress";
if (type == 'port') {
ports = port.split(':');
if (port.indexOf('-') != -1) ports = port.split('-');
for (var i = 0; i < ports.length; i++) {
if (!bt.check_port(ports[i])) {
layer.msg('可用端口范围1-65535', { icon: 2 });
// layer.msg(lan.firewall.port_err, {
// icon: 5
// });
return;
}
}
action = "AddAcceptPort";
}
loading = bt.load();
bt.send(action, 'firewall/' + action, { port: port, type: type, ps: ps }, function(rdata) {
loading.close();
if (callback) callback(rdata);
})
}
}
function SafeMessage(j, h, g, f) {
if(f == undefined) {
f = ""
}
var mess = layer.open({
type: 1,
title: j,
area: "350px",
closeBtn: 2,
shadeClose: true,
content: "<div class='bt-form webDelete pd20 pb70'><p>" + h + "</p>" + f + "<div class='bt-form-submit-btn'><button type='button' class='btn btn-danger btn-sm bt-cancel'>"+lan.public.cancel+"</button> <button type='button' id='toSubmit' class='btn btn-success btn-sm' >"+lan.public.ok+"</button></div></div>"
});
$(".bt-cancel").click(function(){
layer.close(mess);
});
$("#toSubmit").click(function() {
layer.close(mess);
g();
})
}
$(document).ready(function () {
if($('#updata_pro_info').length>0){
$('#updata_pro_info').html('');
bt.set_cookie('productPurchase', 1);
}
})

View File

@@ -14,12 +14,14 @@
- 全局搜索替换 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文件
- 全局搜索替换 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/jobs.py 文件 \#尝试升级到独立环境 下面的 public.get_url() 改成 public.GetConfigValue('home')
@@ -42,6 +44,8 @@
在 def check_domain_cloud(domain): 这一行下面加上 return
在 def err_collect 这一行下面加上 return
在 def get_improvement(): 这一行下面加上 return False
在free_login_area方法内get_free_ips_area替换成get_ips_area
@@ -50,45 +54,61 @@
在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)这行代码下面加上
```python
temp_file = temp_file.replace('wget -O Tpublic.sh', '#wget -O Tpublic.sh')
temp_file = temp_file.replace('\cp -rpa Tpublic.sh', '#\cp -rpa Tpublic.sh')
temp_file = temp_file.replace('http://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
```
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()一行
- install/install_soft.sh 在bash执行之前加入以下代码
- script/reload_check.py 文件在第2行插入sys.exit()
- script/local_fix.sh 文件,${D_NODE_URL}替换成www.example.com
- tools.py 文件u_input == 16下面的public.get_url()替换成public.GetConfigValue('home')
- install/install_soft.sh 在. 执行之前加入以下代码
```shell
sed -i "s/http:\/\/download.bt.cn\/install\/public.sh/http:\/\/www.example.com\/install\/public.sh/" lib.sh
sed -i "s/https:\/\/download.bt.cn\/install\/public.sh/http:\/\/www.example.com\/install\/public.sh/" lib.sh
sed -i "/wget -O Tpublic.sh/d" $name.sh
```
- install/public.sh 用官网最新版的[public.sh](http://download.bt.cn/install/public.sh)替换并去除最下面bt_check一行
- 去除无用的定时任务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()
check_node_status()
- 去除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)以及下面的行
@@ -113,12 +133,10 @@
- [可选]关闭自动生成访问日志:在 BTPanel/\_\_init\_\_.py 删除public.write_request_log这一行
- [可选]删除小图标广告:在BTPanel/static/js/site.js删除“WAF防火墙”对应的span标签
- [可选]上传文件默认选中覆盖在BTPanel/static/js/upload-drog.jsid="all_operation"加checked属性
- [可选]新版vite页面去除需求反馈、各种广告、计算题等执行 php think cleanvitejs <面板BTPanel/static/vite/js路径>
解压安装包panel6.zip将更新包改好的文件覆盖到里面然后重新打包即可更新安装包。
解压安装包[panel6.zip](http://download.bt.cn/install/src/panel6.zip),将更新包改好的文件覆盖到里面,然后重新打包,即可更新安装包。(
别忘了删除class文件夹里面所有的.so文件

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属性