Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
flucont committed Jul 22, 2022
1 parent 2ed20ab commit efbb093
Show file tree
Hide file tree
Showing 110 changed files with 533 additions and 96 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

网站后台管理可一键同步宝塔官方的插件列表与增量更新插件包,还有云端使用记录、IP黑白名单、操作日志、定时任务等功能。

本项目自带的宝塔安装包和更新包是7.9.2最新版,已修改适配此第三方云端,并且全开源,无so等加密文件。
本项目自带的宝塔安装包和更新包是7.9.3最新版,已修改适配此第三方云端,并且全开源,无so等加密文件。

觉得该项目不错的可以给个Star~

Expand Down
11 changes: 11 additions & 0 deletions app/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
$ch = curl_init();
Expand Down
6 changes: 4 additions & 2 deletions app/controller/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,12 @@ public function get_ip_address(){

//绑定账号
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(){
$os = input('post.os');
$json_arr = Plugins::get_deplist($os);
Expand Down
12 changes: 12 additions & 0 deletions app/lib/Btapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,18 @@ public function create_plugin_other_order($pid){
$data = json_decode($result,true);
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(){
Expand Down
17 changes: 17 additions & 0 deletions app/lib/Plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,23 @@ private static function download_file($btapi, $filename, $filepath){
}
}

//刷新一键部署列表
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'){
$json_file = get_data_dir($os).'config/deployment_list.json';
Expand Down
2 changes: 1 addition & 1 deletion app/view/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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-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}&nbsp;&nbsp;<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>&nbsp;<a href="/admin/record" class="btn btn-xs btn-default">使用记录</a>&nbsp;<a href="/admin/black" class="btn btn-xs btn-default">黑白名单</a>&nbsp;<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>&nbsp;<a href="/admin/record" class="btn btn-xs btn-default">使用记录</a>&nbsp;<a href="/admin/list" class="btn btn-xs btn-default">黑白名单</a>&nbsp;<a href="/download" class="btn btn-xs btn-default" target="_blank">安装脚本</a></div>
</div>
</div>
<div class="panel panel-info">
Expand Down
2 changes: 1 addition & 1 deletion app/view/admin/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li class="active">
<a href="./login.php"><span class="glyphicon glyphicon-user"></span> 登录</a>
<a href="#"><span class="glyphicon glyphicon-user"></span> 登录</a>
</li>
</ul>
</div><!-- /.navbar-collapse -->
Expand Down
2 changes: 1 addition & 1 deletion data/config/deployment_list.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/config/plugin_list.json

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
4 changes: 2 additions & 2 deletions install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ INSERT INTO `cloud_config` (`key`, `value`) VALUES
('bt_key', ''),
('whitelist', '0'),
('download_page', '1'),
('new_version', '7.9.2'),
('new_version', '7.9.3'),
('update_msg', '暂无更新日志'),
('update_date', '2022-06-01'),
('update_date', '2022-07-13'),
('new_version_win', '7.6.0'),
('update_msg_win', '暂无更新日志'),
('update_date_win', '2022-06-01'),
Expand Down
7 changes: 6 additions & 1 deletion public/install/install_6.0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [ "${Centos6Check}" ];then
fi

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安装宝塔面板"
exit 1
fi
Expand Down Expand Up @@ -554,6 +554,11 @@ Install_Bt(){
panelPort="8888"
if [ -f ${setup_path}/server/panel/data/port.pl ];then
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
mkdir -p ${setup_path}/server/panel/logs
mkdir -p ${setup_path}/server/panel/vhost/apache
Expand Down
Binary file modified public/install/src/panel6.zip
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions public/install/update6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,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='7.9.2'
version='7.9.3'
fi
armCheck=$(uname -m|grep arm)
if [ "${armCheck}" ];then
Expand All @@ -60,7 +60,7 @@ cd $setup_path/server/panel/
check_bt=`cat /etc/init.d/bt`
if [ "${check_bt}" = "" ];then
rm -f /etc/init.d/bt
wget -O /etc/init.d/bt $download_Url/install/src/bt6.init -T 20
wget -O /etc/init.d/bt $download_Url/install/src/bt7.init -T 20
chmod +x /etc/init.d/bt
fi
rm -f /www/server/panel/*.pyc
Expand Down
Loading

0 comments on commit efbb093

Please sign in to comment.