-
Notifications
You must be signed in to change notification settings - Fork 680
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit aa293b6
Showing
127 changed files
with
14,478 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
APP_DEBUG = false | ||
|
||
[APP] | ||
DEFAULT_TIMEZONE = Asia/Shanghai | ||
|
||
[DATABASE] | ||
TYPE = mysql | ||
HOSTNAME = {dbhost} | ||
DATABASE = {dbname} | ||
USERNAME = {dbuser} | ||
PASSWORD = {dbpwd} | ||
HOSTPORT = {dbport} | ||
CHARSET = utf8mb4 | ||
PREFIX = {dbprefix} | ||
DEBUG = false | ||
|
||
[LANG] | ||
default_lang = zh-cn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/.idea | ||
/.vscode | ||
/vendor | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Flucont | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# 宝塔面板第三方云端 | ||
这是一个用php开发的宝塔面板第三方云端站点程序。 | ||
|
||
你可以使用此程序搭建属于自己的宝塔面板第三方云端,实现最新版宝塔面板私有化部署,不与宝塔官方接口通信,满足隐私安全合规需求。同时还可以去除面板强制绑定账号,DIY面板功能等。 | ||
|
||
网站后台管理可一键同步宝塔官方的插件列表与增量更新插件包,还有云端使用记录、IP黑白名单、操作日志、定时任务等功能。 | ||
|
||
本项目自带的宝塔安装包和更新包是7.9.8最新版,已修改适配此第三方云端,并且全开源,无so等加密文件。 | ||
|
||
觉得该项目不错的可以给个Star~ | ||
|
||
## 声明 | ||
|
||
1.此项目只能以自用为目的,不得侵犯堡塔公司及其他第三方的知识产权和其他合法权利。 | ||
|
||
2.搭建使用此项目必须有一定的编程和Linux运维基础,纯小白不建议使用。 | ||
|
||
## 环境要求 | ||
|
||
* `PHP` >= 7.4 | ||
* `MySQL` >= 5.6 | ||
* `fileinfo`扩展 | ||
* `ZipArchive`扩展 | ||
|
||
## 部署方法 | ||
|
||
- [下载最新版的Release包](https://github.com/flucont/btcloud/releases) | ||
- 如果是下载的源码包,需要执行 `composer install --no-dev` 安装依赖,如果是下载的Release包,则不需要 | ||
- 设置网站运行目录为`public` | ||
- 设置伪静态为`ThinkPHP` | ||
- 访问网站,会自动跳转到安装页面,根据提示安装完成 | ||
|
||
## 使用方法 | ||
|
||
- 在`批量替换工具`,执行页面显示的命令,可将bt安装包、更新包和脚本文件里面的`http://www.example.com`批量替换成当前网站的网址。 | ||
- 在`系统基本设置`修改宝塔面板接口设置。你需要准备一个使用官方最新脚本安装并绑定账号的宝塔面板,用于获取最新插件列表及插件包。并根据界面提示安装好专用插件。 | ||
- 在`定时任务设置`执行所显示的命令从宝塔官方获取最新的插件列表并批量下载插件包(增量更新)。当然你也可以去插件列表,一个一个点击下载。 | ||
- 访问网站`/download`查看使用此第三方云端的一键安装脚本。 | ||
|
||
## 其他 | ||
|
||
- [Linux面板官方更新包修改记录](./wiki/update.md) | ||
|
||
- [Windows面板官方更新包修改记录](./wiki/updatewin.md) | ||
|
||
- 宝塔面板官方版与此第三方云端版对比: | ||
|
||
| | 官方版 | 此第三方云端版 | | ||
| ---------- | ------------------------------------------------------------ | -------------------------------------------------- | | ||
| 版本更新 | 支持 | 支持 | | ||
| 面板广告 | 有广告 | 无广告 | | ||
| 是否全开源 | 没有全开源 | 全开源 | | ||
| 资源占用 | 各种统计上报等任务,资源占用略高 | 去除了很多无用的定时任务,资源占较少 | | ||
| 兼容性 | 由于编译的so文件有系统架构限制,兼容的系统仅限已编译的so对应的系统架构 | 由于全开源,没有已编译的so文件,因此无系统架构限制 | | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
deny from all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
declare (strict_types = 1); | ||
|
||
namespace app; | ||
|
||
use think\Service; | ||
|
||
/** | ||
* 应用服务类 | ||
*/ | ||
class AppService extends Service | ||
{ | ||
public function register() | ||
{ | ||
// 服务注册 | ||
} | ||
|
||
public function boot() | ||
{ | ||
// 服务启动 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
<?php | ||
declare (strict_types = 1); | ||
|
||
namespace app; | ||
|
||
use think\App; | ||
use think\exception\ValidateException; | ||
use think\Validate; | ||
use think\facade\View; | ||
|
||
/** | ||
* 控制器基础类 | ||
*/ | ||
abstract class BaseController | ||
{ | ||
/** | ||
* Request实例 | ||
* @var \think\Request | ||
*/ | ||
protected $request; | ||
|
||
/** | ||
* 应用实例 | ||
* @var \think\App | ||
*/ | ||
protected $app; | ||
|
||
/** | ||
* 是否批量验证 | ||
* @var bool | ||
*/ | ||
protected $batchValidate = false; | ||
|
||
/** | ||
* 控制器中间件 | ||
* @var array | ||
*/ | ||
protected $middleware = []; | ||
|
||
protected $clientip; | ||
|
||
/** | ||
* 构造方法 | ||
* @access public | ||
* @param App $app 应用对象 | ||
*/ | ||
public function __construct(App $app) | ||
{ | ||
$this->app = $app; | ||
$this->request = $this->app->request; | ||
|
||
// 控制器初始化 | ||
$this->initialize(); | ||
} | ||
|
||
// 初始化 | ||
protected function initialize() | ||
{ | ||
$this->clientip = real_ip(); | ||
} | ||
|
||
/** | ||
* 验证数据 | ||
* @access protected | ||
* @param array $data 数据 | ||
* @param string|array $validate 验证器名或者验证规则数组 | ||
* @param array $message 提示信息 | ||
* @param bool $batch 是否批量验证 | ||
* @return array|string|true | ||
* @throws ValidateException | ||
*/ | ||
protected function validate(array $data, $validate, array $message = [], bool $batch = false) | ||
{ | ||
if (is_array($validate)) { | ||
$v = new Validate(); | ||
$v->rule($validate); | ||
} else { | ||
if (strpos($validate, '.')) { | ||
// 支持场景 | ||
[$validate, $scene] = explode('.', $validate); | ||
} | ||
$class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate); | ||
$v = new $class(); | ||
if (!empty($scene)) { | ||
$v->scene($scene); | ||
} | ||
} | ||
|
||
$v->message($message); | ||
|
||
// 是否批量验证 | ||
if ($batch || $this->batchValidate) { | ||
$v->batch(true); | ||
} | ||
|
||
return $v->failException(true)->check($data); | ||
} | ||
|
||
protected function alert($code, $msg = '', $url = null, $wait = 3) | ||
{ | ||
if ($url) { | ||
$url = (strpos($url, '://') || 0 === strpos($url, '/')) ? $url : (string)$this->app->route->buildUrl($url); | ||
} | ||
if(empty($msg)) $msg = '未知错误'; | ||
|
||
View::assign([ | ||
'code' => $code, | ||
'msg' => $msg, | ||
'url' => $url, | ||
'wait' => $wait, | ||
]); | ||
return View::fetch(app()->getAppPath().'view/dispatch_jump.html'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
namespace app; | ||
|
||
use think\db\exception\DataNotFoundException; | ||
use think\db\exception\ModelNotFoundException; | ||
use think\exception\Handle; | ||
use think\exception\HttpException; | ||
use think\exception\HttpResponseException; | ||
use think\exception\ValidateException; | ||
use think\Response; | ||
use Throwable; | ||
|
||
/** | ||
* 应用异常处理类 | ||
*/ | ||
class ExceptionHandle extends Handle | ||
{ | ||
/** | ||
* 不需要记录信息(日志)的异常类列表 | ||
* @var array | ||
*/ | ||
protected $ignoreReport = [ | ||
HttpException::class, | ||
HttpResponseException::class, | ||
ModelNotFoundException::class, | ||
DataNotFoundException::class, | ||
ValidateException::class, | ||
]; | ||
|
||
/** | ||
* 记录异常信息(包括日志或者其它方式记录) | ||
* | ||
* @access public | ||
* @param Throwable $exception | ||
* @return void | ||
*/ | ||
public function report(Throwable $exception): void | ||
{ | ||
// 使用内置的方式记录异常日志 | ||
parent::report($exception); | ||
} | ||
|
||
/** | ||
* Render an exception into an HTTP response. | ||
* | ||
* @access public | ||
* @param \think\Request $request | ||
* @param Throwable $e | ||
* @return Response | ||
*/ | ||
public function render($request, Throwable $e): Response | ||
{ | ||
// 添加自定义异常处理机制 | ||
|
||
// 其他错误交给系统处理 | ||
return parent::render($request, $e); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
namespace app; | ||
|
||
// 应用请求对象类 | ||
class Request extends \think\Request | ||
{ | ||
|
||
} |
Oops, something went wrong.