update
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
网站后台管理可一键同步宝塔官方的插件列表与增量更新插件包,还有云端使用记录、IP黑白名单、操作日志、定时任务等功能。
|
网站后台管理可一键同步宝塔官方的插件列表与增量更新插件包,还有云端使用记录、IP黑白名单、操作日志、定时任务等功能。
|
||||||
|
|
||||||
本项目自带的宝塔安装包和更新包是7.9.2最新版,已修改适配此第三方云端,并且全开源,无so等加密文件。
|
本项目自带的宝塔安装包和更新包是7.9.3最新版,已修改适配此第三方云端,并且全开源,无so等加密文件。
|
||||||
|
|
||||||
觉得该项目不错的可以给个Star~
|
觉得该项目不错的可以给个Star~
|
||||||
|
|
||||||
|
@ -48,6 +48,17 @@ function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function random($length, $numeric = 0) {
|
||||||
|
$seed = base_convert(md5(microtime().$_SERVER['DOCUMENT_ROOT']), 16, $numeric ? 10 : 35);
|
||||||
|
$seed = $numeric ? (str_replace('0', '', $seed).'012340567890') : ($seed.'zZ'.strtoupper($seed));
|
||||||
|
$hash = '';
|
||||||
|
$max = strlen($seed) - 1;
|
||||||
|
for($i = 0; $i < $length; $i++) {
|
||||||
|
$hash .= $seed[mt_rand(0, $max)];
|
||||||
|
}
|
||||||
|
return $hash;
|
||||||
|
}
|
||||||
|
|
||||||
function get_curl($url, $post=0, $referer=0, $cookie=0, $header=0, $ua=0, $nobody=0, $addheader=0)
|
function get_curl($url, $post=0, $referer=0, $cookie=0, $header=0, $ua=0, $nobody=0, $addheader=0)
|
||||||
{
|
{
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
|
@ -259,10 +259,12 @@ class Api extends BaseController
|
|||||||
|
|
||||||
//绑定账号
|
//绑定账号
|
||||||
public function get_auth_token(){
|
public function get_auth_token(){
|
||||||
return json(['status'=>false, 'msg'=>'不支持绑定宝塔官网账号', 'data'=>'5b5d']);
|
$userinfo = ['uid'=>1, 'username'=>'Administrator', 'address'=>'127.0.0.1', 'serverid'=>'1', 'access_key'=>random(32), 'secret_key'=>random(48), 'ukey'=>md5(time()), 'state'=>1];
|
||||||
|
$data = bin2hex(urlencode(json_encode($userinfo)));
|
||||||
|
return json(['status'=>true, 'msg'=>'登录成功!', 'data'=>$data]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//绑定一键部署列表
|
//一键部署列表
|
||||||
public function get_deplist(){
|
public function get_deplist(){
|
||||||
$os = input('post.os');
|
$os = input('post.os');
|
||||||
$json_arr = Plugins::get_deplist($os);
|
$json_arr = Plugins::get_deplist($os);
|
||||||
|
@ -145,6 +145,18 @@ class Btapi
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取一键部署列表
|
||||||
|
public function get_deplist(){
|
||||||
|
$url = $this->BT_PANEL.'/plugin?action=a&name=kaixin&s=get_deplist';
|
||||||
|
|
||||||
|
$p_data = $this->GetKeyData();
|
||||||
|
|
||||||
|
$result = $this->curl($url,$p_data);
|
||||||
|
|
||||||
|
$data = json_decode($result,true);
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private function GetKeyData(){
|
private function GetKeyData(){
|
||||||
$now_time = time();
|
$now_time = time();
|
||||||
|
@ -258,6 +258,23 @@ class Plugins
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//刷新一键部署列表
|
||||||
|
public static function refresh_deplist($os = 'Linux'){
|
||||||
|
$btapi = self::get_btapi($os);
|
||||||
|
$result = $btapi->get_deplist();
|
||||||
|
if($result && isset($result['list']) && isset($result['type'])){
|
||||||
|
if(empty($result['list']) || empty($result['type'])){
|
||||||
|
throw new Exception('获取一键部署列表失败:一键部署列表为空');
|
||||||
|
}
|
||||||
|
$json_file = get_data_dir($os).'config/deployment_list.json';
|
||||||
|
if(!file_put_contents($json_file, json_encode($result))){
|
||||||
|
throw new Exception('保存一键部署列表失败,文件无写入权限');
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
throw new Exception('获取一键部署列表失败:'.(isset($result['msg'])?$result['msg']:'面板连接失败'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//获取一键部署列表
|
//获取一键部署列表
|
||||||
public static function get_deplist($os = 'Linux'){
|
public static function get_deplist($os = 'Linux'){
|
||||||
$json_file = get_data_dir($os).'config/deployment_list.json';
|
$json_file = get_data_dir($os).'config/deployment_list.json';
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<div class="list-group-item"><span class="glyphicon glyphicon-stats"></span> <b>宝塔插件统计:</b>共有 {$stat.total} 个,其中免费插件 {$stat.free} 个,专业版插件 {$stat.pro} 个,企业版插件 {$stat.ltd} 个,第三方插件 {$stat.third} 个</div>
|
<div class="list-group-item"><span class="glyphicon glyphicon-stats"></span> <b>宝塔插件统计:</b>共有 {$stat.total} 个,其中免费插件 {$stat.free} 个,专业版插件 {$stat.pro} 个,企业版插件 {$stat.ltd} 个,第三方插件 {$stat.third} 个</div>
|
||||||
<div class="list-group-item"><span class="glyphicon glyphicon-tint"></span> <b>使用记录统计:</b>历史总共数量:{$stat.record_total},正在使用数量:{$stat.record_isuse}</div>
|
<div class="list-group-item"><span class="glyphicon glyphicon-tint"></span> <b>使用记录统计:</b>历史总共数量:{$stat.record_total},正在使用数量:{$stat.record_isuse}</div>
|
||||||
<div class="list-group-item"><span class="glyphicon glyphicon-time"></span> <b>任务运行情况:</b>上次运行时间:{$stat.runtime|raw} <a href="/admin/set/mod/task" class="btn btn-xs btn-info">查看详情</a></div>
|
<div class="list-group-item"><span class="glyphicon glyphicon-time"></span> <b>任务运行情况:</b>上次运行时间:{$stat.runtime|raw} <a href="/admin/set/mod/task" class="btn btn-xs btn-info">查看详情</a></div>
|
||||||
<div class="list-group-item"><span class="glyphicon glyphicon-cog"></span> <b>常用功能入口:</b><a href="/admin/plugins" class="btn btn-xs btn-default">插件列表</a> <a href="/admin/record" class="btn btn-xs btn-default">使用记录</a> <a href="/admin/black" class="btn btn-xs btn-default">黑白名单</a> <a href="/download" class="btn btn-xs btn-default" target="_blank">安装脚本</a></div>
|
<div class="list-group-item"><span class="glyphicon glyphicon-cog"></span> <b>常用功能入口:</b><a href="/admin/plugins" class="btn btn-xs btn-default">插件列表</a> <a href="/admin/record" class="btn btn-xs btn-default">使用记录</a> <a href="/admin/list" class="btn btn-xs btn-default">黑白名单</a> <a href="/download" class="btn btn-xs btn-default" target="_blank">安装脚本</a></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel panel-info">
|
<div class="panel panel-info">
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
<div id="navbar" class="collapse navbar-collapse">
|
<div id="navbar" class="collapse navbar-collapse">
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<ul class="nav navbar-nav navbar-right">
|
||||||
<li class="active">
|
<li class="active">
|
||||||
<a href="./login.php"><span class="glyphicon glyphicon-user"></span> 登录</a>
|
<a href="#"><span class="glyphicon glyphicon-user"></span> 登录</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div><!-- /.navbar-collapse -->
|
</div><!-- /.navbar-collapse -->
|
||||||
|
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 162 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 598 B |
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 630 B |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 212 B |
Before Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 917 B |
Before Width: | Height: | Size: 971 B |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 595 B |
Before Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 896 B |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 819 B |
Before Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 3.8 KiB |
@ -12,9 +12,9 @@ INSERT INTO `cloud_config` (`key`, `value`) VALUES
|
|||||||
('bt_key', ''),
|
('bt_key', ''),
|
||||||
('whitelist', '0'),
|
('whitelist', '0'),
|
||||||
('download_page', '1'),
|
('download_page', '1'),
|
||||||
('new_version', '7.9.2'),
|
('new_version', '7.9.3'),
|
||||||
('update_msg', '暂无更新日志'),
|
('update_msg', '暂无更新日志'),
|
||||||
('update_date', '2022-06-01'),
|
('update_date', '2022-07-13'),
|
||||||
('new_version_win', '7.6.0'),
|
('new_version_win', '7.6.0'),
|
||||||
('update_msg_win', '暂无更新日志'),
|
('update_msg_win', '暂无更新日志'),
|
||||||
('update_date_win', '2022-06-01'),
|
('update_date_win', '2022-06-01'),
|
||||||
|
@ -26,7 +26,7 @@ if [ "${Centos6Check}" ];then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
UbuntuCheck=$(cat /etc/issue|grep Ubuntu|awk '{print $2}'|cut -f 1 -d '.')
|
UbuntuCheck=$(cat /etc/issue|grep Ubuntu|awk '{print $2}'|cut -f 1 -d '.')
|
||||||
if [ "${UbuntuCheck}" -lt "16" ];then
|
if [ "${UbuntuCheck}" ] && [ "${UbuntuCheck}" -lt "16" ];then
|
||||||
echo "Ubuntu ${UbuntuCheck}不支持安装宝塔面板,建议更换Ubuntu18/20安装宝塔面板"
|
echo "Ubuntu ${UbuntuCheck}不支持安装宝塔面板,建议更换Ubuntu18/20安装宝塔面板"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -554,6 +554,11 @@ Install_Bt(){
|
|||||||
panelPort="8888"
|
panelPort="8888"
|
||||||
if [ -f ${setup_path}/server/panel/data/port.pl ];then
|
if [ -f ${setup_path}/server/panel/data/port.pl ];then
|
||||||
panelPort=$(cat ${setup_path}/server/panel/data/port.pl)
|
panelPort=$(cat ${setup_path}/server/panel/data/port.pl)
|
||||||
|
else
|
||||||
|
RE_NUM=$(expr $RANDOM % 5)
|
||||||
|
if [ "${RE_NUM}" == "1" ];then
|
||||||
|
panelPort=$(expr $RANDOM % 55535 + 10000)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
mkdir -p ${setup_path}/server/panel/logs
|
mkdir -p ${setup_path}/server/panel/logs
|
||||||
mkdir -p ${setup_path}/server/panel/vhost/apache
|
mkdir -p ${setup_path}/server/panel/vhost/apache
|
||||||
|