This commit is contained in:
flucont 2022-07-25 22:46:40 +08:00
parent efbb0934f0
commit 29a874afd4
10 changed files with 222 additions and 7 deletions

View File

@ -166,6 +166,7 @@ class Plugins
//解密并下载插件主程序文件
public static function decode_plugin_main($plugin_name, $version, $main_filepath, $os = 'Linux'){
if(self::decode_plugin_main_local($main_filepath, $os)) return true;
$btapi = self::get_btapi($os);
$result = $btapi->get_decode_plugin_main($plugin_name, $version);
if($result && isset($result['status'])){
@ -181,6 +182,30 @@ class Plugins
}
}
//本地解密插件主程序文件
public static function decode_plugin_main_local($main_filepath, $os = 'Linux'){
$btapi = self::get_btapi($os);
$userinfo = $btapi->get_user_info();
if(isset($userinfo['uid'])){
$src = file_get_contents($main_filepath);
$data = explode("\n", $src)[0];
$uid = $userinfo['uid'];
$serverid = $userinfo['serverid'];
$key = md5(substr($serverid, 10, 16).$uid.$serverid);
$iv = md5($key.$serverid);
$key = substr($key, 8, 16);
$iv = substr($iv, 8, 16);
$de_text = openssl_decrypt($data, 'aes-128-cbc', $key, 0, $iv);
if(!empty($de_text)){
file_put_contents($main_filepath, $de_text);
return true;
}
return false;
}else{
throw new Exception('解密插件主程序文件失败,获取用户信息失败');
}
}
//去除插件主程序文件授权校验
public static function noauth_plugin_main($main_filepath){
$data = file_get_contents($main_filepath);

View File

@ -35,7 +35,7 @@ td{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;max-width:340px;
<div class="modal-body">
<p>“版本与状态”一列中,红色的按钮代表本地不存在该版本插件包,需要点击下载;绿色的按钮代表已存在。</p>
<p>官方插件包本地存储路径是/data/plugins/package/软件标识-版本号.zip第三方插件包路径是/data/plugins/other/other/,对于部分包含二次验证的插件可以自行修改。</p>
<p>点击【重新获取】按钮会从宝塔官方获取最新插件列表,但是插件包需要手动点击下载。如果需要批量下载插件包,可查看<a href="/admin/set/type/task">定时任务设置</a></p>
<p>点击【重新获取】按钮会从宝塔官方获取最新插件列表,但是插件包需要手动点击下载。如果需要批量下载插件包,可查看<a href="/admin/set/mod/task">定时任务设置</a></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>

View File

@ -35,7 +35,7 @@ td{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;max-width:340px;
<div class="modal-body">
<p>“版本与状态”一列中,红色的按钮代表本地不存在该版本插件包,需要点击下载;绿色的按钮代表已存在。</p>
<p>官方插件包本地存储路径是/data/win/plugins/package/软件标识-版本号.zip第三方插件包路径是/data/plugins/other/other/,对于部分包含二次验证的插件可以自行修改。</p>
<p>点击【重新获取】按钮会从宝塔官方获取最新插件列表,但是插件包需要手动点击下载。如果需要批量下载插件包,可查看<a href="/admin/set/type/task">定时任务设置</a></p>
<p>点击【重新获取】按钮会从宝塔官方获取最新插件列表,但是插件包需要手动点击下载。如果需要批量下载插件包,可查看<a href="/admin/set/mod/task">定时任务设置</a></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>

View File

@ -2,8 +2,8 @@
{block name="title"}系统设置{/block}
{block name="main"}
<div class="container" style="padding-top:70px;">
<div class="col-xs-12 col-sm-10 col-lg-8 center-block" style="float: none;">
{if $mod=='sys'}
<div class="col-sm-12 col-md-6 center-block">
<div class="panel panel-primary">
<div class="panel-heading"><h3 class="panel-title">系统基本设置</h3></div>
<div class="panel-body">
@ -54,12 +54,14 @@
</form>
</div>
</div>
</div>
<div class="col-sm-12 col-md-6 center-block">
<div class="panel panel-primary">
<div class="panel-heading"><h3 class="panel-title">宝塔Linux面板接口设置</h3></div>
<div class="panel-body">
<form onsubmit="return saveSetting(this)" method="post" class="form" role="form">
<p>以下宝塔面板请使用官方最新脚本安装并绑定账号,用于获取最新插件列表及插件包</p>
<p><a href="/static/file/kaixin.zip">下载专用插件</a>,在面板【软件商店】->【第三方应用】,点击【导入插件】,导入该专用插件<b>然后重启一次面板</b></p>
<p><a href="/static/file/kaixin.zip">下载专用插件(Linux)</a>,在面板【软件商店】->【第三方应用】,点击【导入插件】,导入该专用插件</p>
<div class="form-group">
<label>宝塔面板URL</label><br/>
<input type="text" name="bt_url" value="{:config_get('bt_url')}" class="form-control"/>
@ -81,8 +83,7 @@
<div class="panel-body">
<form onsubmit="return saveSetting(this)" method="post" class="form" role="form">
<p>以下宝塔面板请使用官方最新脚本安装并绑定账号,用于获取最新插件列表及插件包</p>
<p><a href="/static/file/win/kaixin.zip">下载专用插件</a>,在面板【软件商店】->【第三方应用】,点击【导入插件】,导入该专用插件。</p>
<p><a href="/static/file/win/__init__.zip">下载py替换文件</a>解压覆盖到C:\Program Files\python\Lib\json\目录下,然后重启面板。</p>
<p><a href="/static/file/win/kaixin.zip">下载专用插件(Win)</a>,在面板【软件商店】->【第三方应用】,点击【导入插件】,导入该专用插件。</p>
<div class="form-group">
<label>宝塔面板URL</label><br/>
<input type="text" name="wbt_url" value="{:config_get('wbt_url')}" class="form-control"/>
@ -99,7 +100,9 @@
</form>
</div>
</div>
</div>
{elseif $mod=='task'}
<div class="col-sm-12 col-md-6 center-block">
<div class="panel panel-success">
<div class="panel-heading"><h3 class="panel-title">定时任务说明</h3></div>
<div class="panel-body">
@ -111,6 +114,8 @@
</form>
</div>
</div>
</div>
<div class="col-sm-12 col-md-6 center-block">
<div class="panel panel-info">
<div class="panel-heading"><h3 class="panel-title">定时任务设置</h3></div>
<div class="panel-body">
@ -129,7 +134,9 @@
</form>
</div>
</div>
</div>
{elseif $mod=='account'}
<div class="col-xs-12 col-sm-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">
@ -155,6 +162,7 @@
</div>
</form>
</div>
</div>
{/if}
<script src="//cdn.staticfile.org/layer/3.5.1/layer.js"></script>
<script>

Binary file not shown.

View File

@ -535,4 +535,186 @@ canvas {
.wrap-title a {
font-size: 12px;
}
}
}
@media screen and (max-width: 1440px) {
.wrap {
width: 97%;
}
}
@media only screen and (max-width: 1299px) {
.d2 .wrap,
.d3 .wrap,
.d4 .wrap {
padding: 60px 0;
}
.install-box {
padding: 24px 20px 10px;
padding-right: 0;
}
.install-box.linux .title,
.install-box.windows .title,
.install-box .title {
margin-bottom: 10px;
font-size: 20px;
}
.install-box .img {
flex: 0 0 40%;
}
.install-box.linux .title,
.install-box.windows .title {
margin-bottom: 16px;
}
.install-box .desc {
font-size: 13px;
}
.install-box .btn {
padding: 0 12px;
height: 30px;
border-radius: 8px;
font-size: 12px;
}
}
@media only screen and (max-width: 1200px) {
.install-box .title {
font-size: 16px;
}
.install-box .desc {
font-size: 12px;
}
}
@media only screen and (max-width: 980px) {
.install-list {
justify-content: flex-start;
flex-wrap: wrap;
}
.install-box,
.install-box.linux,
.install-box.windows {
width: 48%;
padding: 15px;
align-items: center;
}
.install-box:nth-child(2n) {
margin-left: 4%;
}
.install-box.app {
margin-top: 30px;
margin-left: 0;
}
.install-box.monitor {
margin-top: 30px;
}
.install-box.linux .title,
.install-box.windows .title,
.install-box .title {
font-size: 16px;
}
.install-box .btn {
height: 24px;
padding: 0 10px;
border-radius: 6px;
font-weight: normal;
}
.install-box .btn + .btn {
margin-left: 5px;
}
.install-code {
flex-direction: column;
align-items: flex-start;
}
.install-code .code-cont {
width: 100%;
}
.install-code .command {
flex: 1;
width: 0;
margin-left: 0;
line-height: 18px;
font-size: 12px;
word-break: break-all;
}
.online-install-cont {
flex-direction: column;
}
.online-install-cont .form {
margin-bottom: 20px;
}
.online-install-cont .pr-70 {
padding-right: 0;
}
.online-install-cont .pl-10 {
padding-left: 0;
}
.online-install-cont .first-line {
flex-wrap: wrap;
}
.online-install-cont .server-line {
width: 100%;
flex: none;
}
.online-install-cont .port-line {
flex: none;
margin-top: 20px;
width: 100%;
}
.d2 .desc,
.d2 .tips {
line-height: 24px;
}
}
@media only screen and (max-width: 768px) {
.d2 .wrap,
.d3 .wrap,
.d4 .wrap {
padding: 40px 0;
}
.d1 .wrap {
padding-top: 40px;
}
.install-box {
flex-wrap: wrap;
}
.install-box .img,
.install-box .cont {
flex: 0 0 100%;
}
.install-box .cont {
margin-top: 10px;
margin-left: 0;
padding: 0;
}
.install-box .title,
.install-box.linux .title,
.install-box.windows .title {
margin-bottom: 10px;
}
.install-box .desc {
margin-bottom: 10px;
}
.wrap-title {
margin-bottom: 20px;
}
.wrap-title::before {
width: 3px;
height: 20px;
margin-right: 10px;
}
.wrap-title .text {
font-size: 20px;
margin-right: 10px;
}
.wrap-title a {
font-size: 12px;
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.