Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new #1

Merged
merged 98 commits into from
Apr 16, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
67e3193
new branch
lordlezehaf Jan 9, 2019
256a623
忽略install/composer锁
Jan 30, 2019
1705504
Revert "忽略install/composer锁"
Jan 30, 2019
8a975d0
添加ssrpanel自动安装并修复sql错误
Jan 30, 2019
be59753
添加当面付接口/公私钥输入时自动去除空格和换行
Jan 30, 2019
e8cec07
添加升级sql
Jan 30, 2019
a2c30f4
回调测试
Jan 30, 2019
047402f
回调测试
Jan 30, 2019
dbfbb1a
回调测试
Jan 30, 2019
f776a52
完成当面付接口
Jan 30, 2019
0b3e1a9
go
Jan 30, 2019
741b4b8
适配vnet,限速字段调整
lordlezehaf Feb 13, 2019
1788f82
1.修正数据库高负载BUG(杜若)
lordlezehaf Feb 14, 2019
25a55d3
重置所有用户的限速字段
lordlezehaf Feb 14, 2019
a784af9
fix scripts
lordlezehaf Feb 14, 2019
5096f10
优化
lordlezehaf Feb 15, 2019
f4718f7
Merge branch 'master' into master
Scyllaly Feb 15, 2019
7750a43
Update install.php
Scyllaly Feb 15, 2019
b535a25
Merge pull request #1305 from yiheyang/master
Scyllaly Feb 15, 2019
721b03d
merge f2fpay
lordlezehaf Feb 16, 2019
3d21039
merge f2fpay
lordlezehaf Feb 16, 2019
4641cb0
merge f2fpay
lordlezehaf Feb 16, 2019
a2545c1
merge f2fpay
lordlezehaf Feb 16, 2019
2fdf824
增加mailgun默认配置项
Scyllaly Feb 17, 2019
6146677
更新CA证书、在线IP表增适配vnet单端口、v2ray上报IP、v2ray单端口
lordlezehaf Feb 18, 2019
bbdf36c
注册页优化
lordlezehaf Feb 18, 2019
80329be
修正因使用队列而导致发件失败无法正确捕获异常(感谢@HeroYi的帮助)
lordlezehaf Feb 18, 2019
59c3943
修正因使用队列而导致发件失败无法正确捕获异常(感谢@HeroYi的帮助)
lordlezehaf Feb 18, 2019
cfa79cf
vnstat一键安装脚本
lordlezehaf Feb 19, 2019
19c8c14
安全入口
lordlezehaf Feb 20, 2019
55c072c
安全入口
lordlezehaf Feb 22, 2019
1a97463
初始化用户默认标签
lordlezehaf Feb 22, 2019
4133432
修正唯一入口
lordlezehaf Feb 22, 2019
6f65ba7
1.移除push_bear
lordlezehaf Feb 28, 2019
f1056d0
1.移除push_bear
lordlezehaf Feb 28, 2019
1d85845
分来开节点离线提醒和TCP阻断检测
lordlezehaf Mar 1, 2019
eeceec5
改进购买商品页
lordlezehaf Mar 4, 2019
91e384d
改进购买商品页
lordlezehaf Mar 4, 2019
5c59266
解决支付宝当面付二维码不生成问题
lordlezehaf Mar 4, 2019
ab8c945
解决支付宝当面付二维码不生成问题
lordlezehaf Mar 4, 2019
e992c3d
优化节点列表
lordlezehaf Mar 4, 2019
c0929fd
修复高级订阅BUG
lordlezehaf Mar 4, 2019
287fe6b
修复节点离线提醒
lordlezehaf Mar 4, 2019
139afcd
修复支付宝当面付创建账单失败问题、限制未购买任何服务的账号:不展示订阅信息
lordlezehaf Mar 4, 2019
8e5b59d
适配Quantumult的自定义订阅头
lordlezehaf Mar 5, 2019
fd5db0f
美化个人中心界面
lordlezehaf Mar 6, 2019
d4564ae
演示环境禁止修改安全码
lordlezehaf Mar 6, 2019
5a2f9be
日常开发
Scyllaly Mar 9, 2019
fcacb67
日常开发
lordlezehaf Mar 11, 2019
c274904
日常开发
lordlezehaf Mar 11, 2019
1c6ed05
适配rico93的v2ray插件
lordlezehaf Mar 13, 2019
a3f2d54
1.彻底移除pushbear
lordlezehaf Mar 14, 2019
251d637
完成了Geetest极验验证 & 优化了系统设置切换栏的CSS样式
Mar 15, 2019
a8b289e
完成了Geetest极验验证 & 优化了系统设置切换栏的CSS样式
Mar 15, 2019
6ed63e3
增加F2FPay自定义商品名选项,完善F2FPay设置注释
Mar 17, 2019
e59cc3e
修复Kitsunebi不可用的问题
Mar 17, 2019
6847cbe
Update 20190317.sql
Mar 17, 2019
da38cd7
极验验证码逻辑优化
Mar 18, 2019
2b69d37
Merge pull request #1481 from mlgexyz/master
Scyllaly Mar 18, 2019
fdb95f6
优化Geetest验证并新增Google reCAPTCHA
Mar 20, 2019
6dbdf7f
优化Geetest验证并新增Goole reCAPTCHA验证
Mar 20, 2019
d8181b9
整理数据库
Mar 20, 2019
9dddfb4
添加注册界面验证码和sql语句文件
Mar 21, 2019
b1760fb
更新 03.17 和 03.21 的 sql语句 到 db.sql
Mar 21, 2019
d33bd9e
更新env配置
Mar 21, 2019
2597834
restore readme.md
Mar 21, 2019
7ee1d06
暂时解决 多人提到的 Class translator does not exist 错误
Mar 21, 2019
f51b437
更新GoogleNoCAPTCHA移动端适配
Mar 21, 2019
8223b9c
Merge pull request #1495 from mlgexyz/branch1
Scyllaly Mar 22, 2019
be6347e
解决 Class translator does not exist 错误
Mar 22, 2019
4082ec7
Merge branch 'master' into master
Mar 22, 2019
fe8ad50
Merge pull request #1498 from MIseChow/master
Scyllaly Mar 25, 2019
16a8987
merge geetest & recaptcha
lordlezehaf Mar 25, 2019
e2257b6
merge geetest & recaptcha
lordlezehaf Mar 25, 2019
ab56fa5
Update Article
Mar 25, 2019
f1e5af8
Add Default Article
Mar 28, 2019
8580c2d
Merge pull request #1506 from mlgexyz/branch1
Scyllaly Mar 29, 2019
e1a4ab6
1.MERGED
lordlezehaf Mar 29, 2019
693b671
“修复验证码无法隐藏的问题”
Mar 31, 2019
bc04303
“修复使用教程缩进问题”
Mar 31, 2019
ada7a34
Merge pull request #1514 from mlgexyz/branch2
Scyllaly Apr 1, 2019
5eda890
Merge pull request #1513 from mlgexyz/branch1
Scyllaly Apr 1, 2019
51dca54
日常开发
lordlezehaf Apr 3, 2019
1ad5979
可以自定义生成的邀请码的有效期
lordlezehaf Apr 4, 2019
ecf868e
代码优化,引入软删除
Scyllaly Apr 7, 2019
638a271
适配Quantumult订阅 #1538
lordlezehaf Apr 8, 2019
dbde0a2
加入中转节点
Scyllaly Apr 8, 2019
d8ace0b
加入shadowrocket订阅扫码 #1448
Scyllaly Apr 8, 2019
713da09
Update 20190408.sql
Scyllaly Apr 8, 2019
fc70e0d
中转节点屏蔽离线提醒
lordlezehaf Apr 9, 2019
69f755b
修正基佬提得BUG
lordlezehaf Apr 10, 2019
608e265
日常开发
lordlezehaf Apr 10, 2019
2b7d17d
使用验证器,精简代码
lordlezehaf Apr 15, 2019
0030677
使用验证器,精简代码
lordlezehaf Apr 15, 2019
5a80ca0
使用验证器,移除用户积分日志
lordlezehaf Apr 16, 2019
d7a5700
使用验证器,移除用户积分日志
lordlezehaf Apr 16, 2019
ba7d9a2
使用验证器,移除用户积分日志
lordlezehaf Apr 16, 2019
a941f0d
使用验证器,移除用户积分日志
lordlezehaf Apr 16, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/Components/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ public static function addEmailLog($address, $title, $content, $status = 1, $err
$log->content = $content;
$log->status = $status;
$log->error = $error;
$log->created_at = date('Y-m-d H:i:s');

return $log->save();
}
Expand Down
1 change: 0 additions & 1 deletion app/Components/ServerChan.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ private static function addLog($title, $content, $status = 1, $error = '')
$log->content = $content;
$log->status = $status;
$log->error = $error;
$log->created_at = date('Y-m-d H:i:s');

return $log->save();
}
Expand Down
4 changes: 4 additions & 0 deletions app/Console/Commands/AutoClearLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use App\Http\Models\SsNodeTrafficDaily;
use App\Http\Models\UserBanLog;
use App\Http\Models\UserLoginLog;
use App\Http\Models\UserSubscribeLog;
use App\Http\Models\UserTrafficDaily;
use App\Http\Models\UserTrafficLog;
use App\Http\Models\UserTrafficHourly;
Expand Down Expand Up @@ -75,6 +76,9 @@ private function clearLog()

// 自动清除3个月以前用户登陆日志
UserLoginLog::query()->where('created_at', '<=', date('Y-m-d H:i:s', strtotime("-3 month")))->delete();

// 自动清除1个月前的用户订阅记录
UserSubscribeLog::query()->where('request_time', '<=', date('Y-m-d H:i:s', strtotime("-1 month")))->delete();
}

}
36 changes: 36 additions & 0 deletions app/Console/Commands/upgradeUserSpeedLimit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace App\Console\Commands;

use App\Http\Models\User;
use Illuminate\Console\Command;
use Log;

class upgradeUserSpeedLimit extends Command
{
protected $signature = 'upgradeUserSpeedLimit';
protected $description = '升级用户限速字段,重置初始值';

public function __construct()
{
parent::__construct();
}

public function handle()
{
Log::info('----------------------------【重置用户限速字段】开始----------------------------');

$userList = User::query()->get();
foreach ($userList as $user) {
$data = [
'speed_limit_per_con' => 10737418240,
'speed_limit_per_user' => 10737418240
];

User::query()->where('id', $user->id)->update($data);
Log::info('---用户[ID:' . $user->id . ' - ' . $user->username . ']的限速字段值被重置为10G---');
}

Log::info('----------------------------【重置用户限速字段】结束----------------------------');
}
}
2 changes: 2 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class Kernel extends ConsoleKernel
\App\Console\Commands\UserExpireAutoWarning::class,
\App\Console\Commands\UserTrafficAutoWarning::class,
\App\Console\Commands\upgradeUserPassword::class,
\App\Console\Commands\upgradeUserSpeedLimit::class,
\App\Console\Commands\upgradeUserSubscribe::class,
\App\Console\Commands\upgradeUserVmessId::class,
\App\Console\Commands\AutoReportNode::class,
];
Expand Down
29 changes: 13 additions & 16 deletions app/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2373,22 +2373,16 @@ public function userRebateList(Request $request)
public function userOnlineIPList(Request $request)
{
$username = trim($request->get('username'));
$status = $request->get('status');
$port = intval($request->get('port'));
$wechat = trim($request->get('wechat'));
$qq = trim($request->get('qq'));
$enable = intval($request->get('enable'));

$query = User::query();
$query = User::query()->where('status', '>=', 0)->where('enable', 1);

if ($username) {
$query->where('username', 'like', '%' . $username . '%');
}

if ($status != '') {
$query->where('status', intval($status));
}

if (!empty($wechat)) {
$query->where('wechat', 'like', '%' . $wechat . '%');
}
Expand All @@ -2397,19 +2391,15 @@ public function userOnlineIPList(Request $request)
$query->where('qq', 'like', '%' . $qq . '%');
}

if (!empty($port)) {
$query->where('port', intval($port));
}

if ($enable != '') {
$query->where('enable', intval($enable));
if ($port) {
$query->where('port', $port);
}

$userList = $query->paginate(15)->appends($request->except('page'));
if (!$userList->isEmpty()) {
foreach ($userList as &$user) {
// 最近10条在线IP记录,如果后端设置为60秒上报一次,则为10分钟内的在线IP
$user->onlineIPList = SsNodeIp::query()->with(['node', 'user'])->where('type', 'tcp')->where('port', $user->port)->where('created_at', '>=', strtotime("-10 minutes"))->orderBy('id', 'desc')->limit(10)->get();
// 最近5条在线IP记录,如果后端设置为60秒上报一次,则为10分钟内的在线IP
$user->onlineIPList = SsNodeIp::query()->with(['node'])->where('type', 'tcp')->where('port', $user->port)->where('created_at', '>=', strtotime("-10 minutes"))->orderBy('id', 'desc')->limit(5)->get();
}
}

Expand Down Expand Up @@ -2522,11 +2512,12 @@ public function onlineIPMonitor(Request $request)
$username = trim($request->get('username'));
$port = intval($request->get('port'));
$nodeId = intval($request->get('nodeId'));
$userId = intval($request->get('id'));

$query = SsNodeIp::query()->with(['node', 'user'])->where('type', 'tcp')->where('created_at', '>=', strtotime("-120 seconds"));

if ($ip) {
$query->where('ip', 'like', '%' . $ip . '%');
$query->where('ip', $ip);
}

if ($username) {
Expand All @@ -2547,6 +2538,12 @@ public function onlineIPMonitor(Request $request)
});
}

if ($userId) {
$query->whereHas('user', function ($q) use ($userId) {
$q->where('id', $userId);
});
}

$list = $query->groupBy('port')->orderBy('id', 'desc')->paginate(20)->appends($request->except('page'));

foreach ($list as $vo) {
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ public function login(Request $request)
if (Auth::user()->status < 0) {
Session::flash('errorMsg', '账号已禁用');

Auth::logout(); // 强制退出会话,因为Auth::attempt的时候会产生会话
Auth::logout(); // 强制销毁会话,因为Auth::attempt的时候会产生会话

return Redirect::back()->withInput();
}

if (Auth::user()->status == 0 && self::$systemConfig['is_active_register']) {
Session::flash('errorMsg', '账号未激活,请点击<a href="/activeUser?username=' . Auth::user()->username . '" target="_blank"><span style="color:#000">【激活账号】</span></a>');

Auth::logout(); // 强制退出会话,因为Auth::attempt的时候会产生会话
Auth::logout(); // 强制销毁会话,因为Auth::attempt的时候会产生会话

return Redirect::back()->withInput();
}
Expand Down
1 change: 0 additions & 1 deletion app/Http/Models/EmailLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ class EmailLog extends Model
{
protected $table = 'email_log';
protected $primaryKey = 'id';
public $timestamps = false;

}
9 changes: 8 additions & 1 deletion queue.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
#!/bin/bash
nohup php artisan queue:work database --queue=default --timeout=60 --sleep=5 --tries=3 >> ./storage/logs/queue.log 2>&1 &
ps -ef | grep queue:work | grep -v grep
if [ $? -ne 0 ]
then
echo "start queue process successfully....."
nohup php artisan queue:work database --queue=default --timeout=60 --sleep=5 --tries=3 >> ./queue.log 2>&1 &
else
echo "queue is running....."
fi
10 changes: 6 additions & 4 deletions resources/views/admin/addUser.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,18 +280,20 @@
<label for="speed_limit_per_con" class="col-md-3 control-label">单连接限速</label>
<div class="col-md-8">
<div class="input-group">
<input type="text" class="form-control" name="speed_limit_per_con" value="204800" id="speed_limit_per_con" autocomplete="off" />
<span class="input-group-addon">KB</span>
<input type="text" class="form-control" name="speed_limit_per_con" value="10737418240" id="speed_limit_per_con" autocomplete="off" />
<span class="input-group-addon">Byte</span>
</div>
<span class="help-block"> 为 0 时不限速 </span>
</div>
</div>
<div class="form-group">
<label for="speed_limit_per_user" class="col-md-3 control-label">单用户限速</label>
<div class="col-md-8">
<div class="input-group">
<input type="text" class="form-control" name="speed_limit_per_user" value="204800" id="speed_limit_per_user" autocomplete="off" />
<span class="input-group-addon">KB</span>
<input type="text" class="form-control" name="speed_limit_per_user" value="10737418240" id="speed_limit_per_user" autocomplete="off" />
<span class="input-group-addon">Byte</span>
</div>
<span class="help-block"> 为 0 时不限速 </span>
</div>
</div>
<hr>
Expand Down
20 changes: 10 additions & 10 deletions resources/views/admin/config.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
<button class="btn sbold blue" data-toggle="modal" data-target="#add_config_modal"> 新增 <i class="fa fa-plus"></i> </button>
</div>
</div>
<div class="table-scrollable">
<table class="table table-striped table-bordered table-hover table-checkable order-column">
<div class="table-scrollable table-scrollable-borderless">
<table class="table table-hover table-light table-checkable">
<thead>
<tr>
<th style="width: 50%;"> 名称 </th>
Expand Down Expand Up @@ -74,8 +74,8 @@
<button class="btn sbold blue" data-toggle="modal" data-target="#add_config_modal"> 新增 <i class="fa fa-plus"></i> </button>
</div>
</div>
<div class="table-scrollable">
<table class="table table-striped table-bordered table-hover table-checkable order-column">
<div class="table-scrollable table-scrollable-borderless">
<table class="table table-hover table-light table-checkable">
<thead>
<tr>
<th style="width: 50%;"> 名称 </th>
Expand Down Expand Up @@ -112,8 +112,8 @@
<button class="btn sbold blue" data-toggle="modal" data-target="#add_config_modal"> 新增 <i class="fa fa-plus"></i> </button>
</div>
</div>
<div class="table-scrollable">
<table class="table table-striped table-bordered table-hover table-checkable order-column">
<div class="table-scrollable table-scrollable-borderless">
<table class="table table-hover table-light table-checkable">
<thead>
<tr>
<th style="width: 50%;"> 名称 </th>
Expand Down Expand Up @@ -150,8 +150,8 @@
<button class="btn sbold blue" data-toggle="modal" data-target="#add_level_modal"> 新增 <i class="fa fa-plus"></i> </button>
</div>
</div>
<div class="table-scrollable">
<table class="table table-striped table-bordered table-hover table-checkable order-column">
<div class="table-scrollable table-scrollable-borderless">
<table class="table table-hover table-light table-checkable">
<thead>
<tr>
<th style="width: 35%;"> 等级 </th>
Expand Down Expand Up @@ -188,8 +188,8 @@
<button class="btn sbold blue" data-toggle="modal" data-target="#add_country_modal"> 新增 <i class="fa fa-plus"></i> </button>
</div>
</div>
<div class="table-scrollable">
<table class="table table-striped table-bordered table-hover table-checkable order-column">
<div class="table-scrollable table-scrollable-borderless">
<table class="table table-hover table-light table-checkable">
<thead>
<tr>
<th style="width: 20%;"> 图标 </th>
Expand Down
8 changes: 5 additions & 3 deletions resources/views/admin/editUser.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
</div>
<hr>
<div class="form-group">
<label for="speed_limit_per_user" class="col-md-3 control-label">邀请人</label>
<label for="referral_uid" class="col-md-3 control-label">邀请人</label>
<div class="col-md-8">
<p class="form-control-static"> {{empty($user->referral) ? '无邀请人' : $user->referral->username}} </p>
</div>
Expand Down Expand Up @@ -328,17 +328,19 @@
<div class="col-md-8">
<div class="input-group">
<input type="text" class="form-control" name="speed_limit_per_con" value="{{$user->speed_limit_per_con}}" id="speed_limit_per_con" autocomplete="off">
<span class="input-group-addon">KB</span>
<span class="input-group-addon">Byte</span>
</div>
<span class="help-block"> 为 0 时不限速 </span>
</div>
</div>
<div class="form-group">
<label for="speed_limit_per_user" class="col-md-3 control-label">单用户限速</label>
<div class="col-md-8">
<div class="input-group">
<input type="text" class="form-control" name="speed_limit_per_user" value="{{$user->speed_limit_per_user}}" id="speed_limit_per_user" autocomplete="off">
<span class="input-group-addon">KB</span>
<span class="input-group-addon">Byte</span>
</div>
<span class="help-block"> 为 0 时不限速 </span>
</div>
</div>
<hr>
Expand Down
8 changes: 6 additions & 2 deletions resources/views/admin/onlineIPMonitor.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
</div>
<div class="portlet-body">
<div class="row">
<div class="col-md-3 col-sm-4 col-xs-12">
<input type="text" class="col-md-4 col-sm-4 col-xs-12 form-control" name="id" value="{{Request::get('id')}}" id="id" placeholder="用户ID" onkeydown="if(event.keyCode==13){doSearch();}">
</div>
<div class="col-md-3 col-sm-4 col-xs-12">
<input type="text" class="col-md-4 col-sm-4 col-xs-12 form-control" name="ip" value="{{Request::get('ip')}}" id="ip" placeholder="IP" onkeydown="if(event.keyCode==13){doSearch();}">
</div>
Expand Down Expand Up @@ -71,7 +74,7 @@
<td>{{$vo->type}}</td>
<td>{{$vo->node ? $vo->node->name : '【节点已删除】'}}</td>
<td>{{$vo->user ? $vo->user->username : '【用户已删除】'}}</td>
<td>{{$vo->ip}}</td>
<td><a href="https://www.ipip.net/ip/{{$vo->ip}}.html" target="_blank">{{$vo->ip}}</a></td>
<td>{{$vo->ipInfo}}</td>
</tr>
@endforeach
Expand Down Expand Up @@ -103,12 +106,13 @@
<script type="text/javascript">
// 搜索
function doSearch() {
var id = $("#id").val();
var ip = $("#ip").val();
var username = $("#username").val();
var port = $("#port").val();
var nodeId = $("#nodeId option:checked").val();

window.location.href = '{{url('admin/onlineIPMonitor')}}' + '?ip=' + ip + '&username=' + username + '&port=' + port + '&nodeId=' + nodeId;
window.location.href = '{{url('admin/onlineIPMonitor')}}' + '?id=' + id + '&ip=' + ip + '&username=' + username + '&port=' + port + '&nodeId=' + nodeId;
}

// 重置
Expand Down
Loading