mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-01-22 18:48:14 -05:00
fix: fix know issues
This commit is contained in:
parent
9d27e447d1
commit
6831b40e22
@ -39,11 +39,16 @@ class SendRemindMail extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
if (!(bool) admin_setting('remind_mail_enable', false)) {
|
||||
return;
|
||||
}
|
||||
$users = User::all();
|
||||
$mailService = new MailService();
|
||||
foreach ($users as $user) {
|
||||
if ($user->remind_expire) $mailService->remindExpire($user);
|
||||
if ($user->remind_traffic) $mailService->remindTraffic($user);
|
||||
if ($user->remind_expire)
|
||||
$mailService->remindExpire($user);
|
||||
if ($user->remind_traffic)
|
||||
$mailService->remindTraffic($user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,10 @@ class UniProxyController extends Controller
|
||||
'network_settings' => $protocolSettings['network_settings'],
|
||||
'tls' => $protocolSettings['tls'],
|
||||
'flow' => $protocolSettings['flow'],
|
||||
'tls_settings' => $protocolSettings['tls_settings']
|
||||
'tls_settings' => match ((int) $protocolSettings['tls']) {
|
||||
1 => $protocolSettings['tls_settings'],
|
||||
2 => $protocolSettings['reality_settings']
|
||||
}
|
||||
],
|
||||
'hysteria' => [
|
||||
'version' => $protocolSettings['version'],
|
||||
|
@ -107,6 +107,7 @@ class ConfigController extends Controller
|
||||
'show_protocol_to_server_enable' => (bool) admin_setting('show_protocol_to_server_enable', 0),
|
||||
'default_remind_expire' => (bool) admin_setting('default_remind_expire', 1),
|
||||
'default_remind_traffic' => (bool) admin_setting('default_remind_traffic', 1),
|
||||
'remind_mail_enable' => (bool) admin_setting('remind_mail_enable', false),
|
||||
|
||||
],
|
||||
'frontend' => [
|
||||
|
@ -114,6 +114,7 @@ class ManageController extends Controller
|
||||
{
|
||||
$server = Server::find($request->input('id'));
|
||||
$server->show = 0;
|
||||
$server->code = null;
|
||||
if (!$server) {
|
||||
return $this->fail([400202, '服务器不存在']);
|
||||
}
|
||||
|
@ -57,41 +57,131 @@ class StatController extends Controller
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get order statistics with filtering and pagination
|
||||
*
|
||||
* @param Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function getOrder(Request $request)
|
||||
{
|
||||
$statistics = Stat::where('record_type', 'd')
|
||||
->limit(31)
|
||||
->orderBy('record_at', 'DESC')
|
||||
$request->validate([
|
||||
'start_date' => 'nullable|date_format:Y-m-d',
|
||||
'end_date' => 'nullable|date_format:Y-m-d',
|
||||
'type' => 'nullable|in:paid_total,paid_count,commission_total,commission_count',
|
||||
'page' => 'nullable|integer|min:1',
|
||||
'page_size' => 'nullable|integer|min:1|max:100'
|
||||
]);
|
||||
|
||||
$query = Stat::where('record_type', 'd');
|
||||
|
||||
// Apply date filters
|
||||
if ($request->input('start_date')) {
|
||||
$query->where('record_at', '>=', strtotime($request->input('start_date')));
|
||||
}
|
||||
if ($request->input('end_date')) {
|
||||
$query->where('record_at', '<=', strtotime($request->input('end_date') . ' 23:59:59'));
|
||||
}
|
||||
|
||||
// Get total count for pagination
|
||||
$total = $query->count();
|
||||
|
||||
// Apply pagination
|
||||
$pageSize = $request->input('page_size', 31);
|
||||
$page = $request->input('page', 1);
|
||||
|
||||
$statistics = $query->orderBy('record_at', 'DESC')
|
||||
->forPage($page, $pageSize)
|
||||
->get()
|
||||
->toArray();
|
||||
$result = [];
|
||||
|
||||
$summary = [
|
||||
'paid_total' => 0,
|
||||
'paid_count' => 0,
|
||||
'commission_total' => 0,
|
||||
'commission_count' => 0,
|
||||
'start_date' => $request->input('start_date', date('Y-m-d', strtotime('-30 days'))),
|
||||
'end_date' => $request->input('end_date', date('Y-m-d')),
|
||||
'avg_paid_amount' => 0,
|
||||
'avg_commission_amount' => 0
|
||||
];
|
||||
|
||||
$dailyStats = [];
|
||||
foreach ($statistics as $statistic) {
|
||||
$date = date('m-d', $statistic['record_at']);
|
||||
$result[] = [
|
||||
'type' => '收款金额',
|
||||
$date = date('Y-m-d', $statistic['record_at']);
|
||||
|
||||
// Update summary
|
||||
$summary['paid_total'] += $statistic['paid_total'];
|
||||
$summary['paid_count'] += $statistic['paid_count'];
|
||||
$summary['commission_total'] += $statistic['commission_total'];
|
||||
$summary['commission_count'] += $statistic['commission_count'];
|
||||
|
||||
// Calculate daily stats
|
||||
$dailyData = [
|
||||
'date' => $date,
|
||||
'value' => $statistic['paid_total'] / 100
|
||||
'paid_total' => $statistic['paid_total'],
|
||||
'paid_count' => $statistic['paid_count'],
|
||||
'commission_total' => $statistic['commission_total'],
|
||||
'commission_count' => $statistic['commission_count'],
|
||||
'avg_order_amount' => $statistic['paid_count'] > 0 ? round($statistic['paid_total'] / $statistic['paid_count'], 2) : 0,
|
||||
'avg_commission_amount' => $statistic['commission_count'] > 0 ? round($statistic['commission_total'] / $statistic['commission_count'], 2) : 0
|
||||
];
|
||||
$result[] = [
|
||||
'type' => '收款笔数',
|
||||
|
||||
if ($request->input('type')) {
|
||||
$dailyStats[] = [
|
||||
'date' => $date,
|
||||
'value' => $statistic['paid_count']
|
||||
'value' => $statistic[$request->input('type')],
|
||||
'type' => $this->getTypeLabel($request->input('type'))
|
||||
];
|
||||
$result[] = [
|
||||
'type' => '佣金金额(已发放)',
|
||||
'date' => $date,
|
||||
'value' => $statistic['commission_total'] / 100
|
||||
];
|
||||
$result[] = [
|
||||
'type' => '佣金笔数(已发放)',
|
||||
'date' => $date,
|
||||
'value' => $statistic['commission_count']
|
||||
} else {
|
||||
$dailyStats[] = $dailyData;
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate averages for summary
|
||||
if ($summary['paid_count'] > 0) {
|
||||
$summary['avg_paid_amount'] = round($summary['paid_total'] / $summary['paid_count'], 2);
|
||||
}
|
||||
if ($summary['commission_count'] > 0) {
|
||||
$summary['avg_commission_amount'] = round($summary['commission_total'] / $summary['commission_count'], 2);
|
||||
}
|
||||
|
||||
// Add percentage calculations to summary
|
||||
$summary['commission_rate'] = $summary['paid_total'] > 0
|
||||
? round(($summary['commission_total'] / $summary['paid_total']) * 100, 2)
|
||||
: 0;
|
||||
|
||||
return [
|
||||
'code' => 0,
|
||||
'message' => 'success',
|
||||
'data' => [
|
||||
'list' => array_reverse($dailyStats),
|
||||
'summary' => $summary,
|
||||
'pagination' => [
|
||||
'total' => $total,
|
||||
'current_page' => $page,
|
||||
'page_size' => $pageSize,
|
||||
'total_pages' => ceil($total / $pageSize)
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
$result = array_reverse($result);
|
||||
return [
|
||||
'data' => $result
|
||||
];
|
||||
|
||||
/**
|
||||
* Get human readable label for statistic type
|
||||
*
|
||||
* @param string $type
|
||||
* @return string
|
||||
*/
|
||||
private function getTypeLabel(string $type): string
|
||||
{
|
||||
return match ($type) {
|
||||
'paid_total' => '收款金额',
|
||||
'paid_count' => '收款笔数',
|
||||
'commission_total' => '佣金金额(已发放)',
|
||||
'commission_count' => '佣金笔数(已发放)',
|
||||
default => $type
|
||||
};
|
||||
}
|
||||
|
||||
// 获取当日实时流量排行
|
||||
@ -281,8 +371,8 @@ class StatController extends Controller
|
||||
$result[] = [
|
||||
'id' => (string) $data->id,
|
||||
'name' => $name,
|
||||
'value' => round($data->value / (1024 * 1024 * 1024), 2), // Convert to GB
|
||||
'previousValue' => round($previousValue / (1024 * 1024 * 1024), 2), // Convert to GB
|
||||
'value' => $data->value, // Convert to GB
|
||||
'previousValue' => $previousValue, // Convert to GB
|
||||
'change' => $change,
|
||||
'timestamp' => date('c', $endDate)
|
||||
];
|
||||
|
@ -44,6 +44,7 @@ class ConfigSave extends FormRequest
|
||||
'change_order_event_id' => '',
|
||||
'show_info_to_server_enable' => '',
|
||||
'show_protocol_to_server_enable' => '',
|
||||
'remind_mail_enable' => '',
|
||||
// server
|
||||
'server_token' => 'nullable|min:16',
|
||||
'server_pull_interval' => 'integer',
|
||||
@ -91,8 +92,8 @@ class ConfigSave extends FormRequest
|
||||
'password_limit_enable' => 'boolean',
|
||||
'password_limit_count' => 'integer',
|
||||
'password_limit_expire' => 'integer',
|
||||
'default_remind_expire' => 'integer|boolean',
|
||||
'default_remind_traffic' => 'integer|boolean'
|
||||
'default_remind_expire' => 'boolean',
|
||||
'default_remind_traffic' => 'boolean'
|
||||
];
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
|
@ -72,7 +72,8 @@ class ServerSave extends FormRequest
|
||||
'tls_settings.server_name' => 'nullable|string',
|
||||
'tls_settings.allow_insecure' => 'nullable|boolean',
|
||||
'reality_settings.allow_insecure' => 'nullable|boolean',
|
||||
'reality_settings.dest' => 'nullable|string',
|
||||
'reality_settings.server_name' => 'nullable|string',
|
||||
'reality_settings.server_port' => 'nullable|string',
|
||||
'reality_settings.public_key' => 'nullable|string',
|
||||
'reality_settings.private_key' => 'nullable|string',
|
||||
'reality_settings.short_id' => 'nullable|string',
|
||||
|
@ -88,7 +88,14 @@ class Server extends Model
|
||||
'flow' => null,
|
||||
'network' => null,
|
||||
'network_settings' => null,
|
||||
'reality_settings' => null
|
||||
'reality_settings' => [
|
||||
'allow_insecure' => false,
|
||||
'server_port' => null,
|
||||
'server_name' => null,
|
||||
'public_key' => null,
|
||||
'private_key' => null,
|
||||
'short_id' => null
|
||||
]
|
||||
],
|
||||
self::TYPE_SHADOWSOCKS => [
|
||||
'cipher' => null,
|
||||
@ -165,6 +172,8 @@ class Server extends Model
|
||||
if (strpos($this->port, '-') !== false) {
|
||||
$this->ports = $this->port;
|
||||
$this->port = Helper::randomPort($this->port);
|
||||
} else {
|
||||
$this->port = (int) $this->port;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class ServerHysteria extends Model
|
||||
{
|
||||
protected $table = 'v2_server_hysteria';
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = ['id'];
|
||||
protected $casts = [
|
||||
'created_at' => 'timestamp',
|
||||
'updated_at' => 'timestamp',
|
||||
'group_id' => 'array',
|
||||
'route_id' => 'array',
|
||||
'tags' => 'array',
|
||||
'ips' => 'array',
|
||||
'excludes' => 'array'
|
||||
];
|
||||
|
||||
// ALPN映射表
|
||||
public static $alpnMap = [
|
||||
0 => 'hysteria',
|
||||
1 => 'http/1.1',
|
||||
2 => 'h2',
|
||||
3 => 'h3'
|
||||
];
|
||||
|
||||
public function parent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(self::class, 'parent_id', 'id');
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class ServerTrojan extends Model
|
||||
{
|
||||
protected $table = 'v2_server_trojan';
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = ['id'];
|
||||
protected $casts = [
|
||||
'created_at' => 'timestamp',
|
||||
'updated_at' => 'timestamp',
|
||||
'group_id' => 'array',
|
||||
'route_id' => 'array',
|
||||
'networkSettings' => 'array',
|
||||
'tags' => 'array',
|
||||
'excludes' => 'array',
|
||||
'ips' => 'array'
|
||||
];
|
||||
|
||||
public function parent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(self::class, 'parent_id', 'id');
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class ServerVless extends Model
|
||||
{
|
||||
protected $table = 'v2_server_vless';
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = ['id'];
|
||||
protected $casts = [
|
||||
'created_at' => 'timestamp',
|
||||
'updated_at' => 'timestamp',
|
||||
'group_id' => 'array',
|
||||
'route_id' => 'array',
|
||||
'tls_settings' => 'array',
|
||||
'network_settings' => 'array',
|
||||
'tags' => 'array',
|
||||
'excludes' => 'array',
|
||||
'ips' => 'array'
|
||||
];
|
||||
|
||||
public function parent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(self::class, 'parent_id', 'id');
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class ServerVmess extends Model
|
||||
{
|
||||
protected $table = 'v2_server_vmess';
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = ['id'];
|
||||
protected $casts = [
|
||||
'created_at' => 'timestamp',
|
||||
'updated_at' => 'timestamp',
|
||||
'group_id' => 'array',
|
||||
'route_id' => 'array',
|
||||
'tlsSettings' => 'array',
|
||||
'networkSettings' => 'array',
|
||||
'dnsSettings' => 'array',
|
||||
'ruleSettings' => 'array',
|
||||
'tags' => 'array',
|
||||
'excludes' => 'array',
|
||||
'ips' => 'array'
|
||||
];
|
||||
|
||||
public function parent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(self::class, 'parent_id', 'id');
|
||||
}
|
||||
}
|
@ -152,7 +152,7 @@ class Clash implements ProtocolInterface
|
||||
|
||||
if (data_get($protocol_settings, 'tls')) {
|
||||
$array['tls'] = true;
|
||||
$array['skip-cert-verify'] = data_get($protocol_settings, 'tls_settings.allow_insecure');
|
||||
$array['skip-cert-verify'] = (bool) data_get($protocol_settings, 'tls_settings.allow_insecure');
|
||||
$array['servername'] = data_get($protocol_settings, 'tls_settings.server_name');
|
||||
}
|
||||
|
||||
@ -192,7 +192,7 @@ class Clash implements ProtocolInterface
|
||||
$array['password'] = $password;
|
||||
$array['udp'] = true;
|
||||
$array['sni'] = data_get($protocol_settings, 'server_name');
|
||||
$array['skip-cert-verify'] = data_get($protocol_settings, 'allow_insecure');
|
||||
$array['skip-cert-verify'] = (bool) data_get($protocol_settings, 'allow_insecure');
|
||||
|
||||
switch (data_get($protocol_settings, 'network')) {
|
||||
case 'tcp':
|
||||
|
@ -151,7 +151,7 @@ class ClashMeta implements ProtocolInterface
|
||||
|
||||
if (data_get($protocol_settings, 'tls')) {
|
||||
$array['tls'] = true;
|
||||
$array['skip-cert-verify'] = data_get($protocol_settings, 'tls_settings.allow_insecure', false);
|
||||
$array['skip-cert-verify'] = (bool) data_get($protocol_settings, 'tls_settings.allow_insecure', false);
|
||||
$array['servername'] = data_get($protocol_settings, 'tls_settings.server_name');
|
||||
}
|
||||
|
||||
@ -195,18 +195,18 @@ class ClashMeta implements ProtocolInterface
|
||||
'alterId' => 0,
|
||||
'cipher' => 'auto',
|
||||
'udp' => true,
|
||||
'flow' => data_get($server, 'flow')
|
||||
'flow' => data_get($protocol_settings, 'flow')
|
||||
];
|
||||
|
||||
switch (data_get($protocol_settings, 'tls')) {
|
||||
case 1:
|
||||
$array['tls'] = true;
|
||||
$array['skip-cert-verify'] = data_get($protocol_settings, 'tls_settings.allow_insecure', false);
|
||||
$array['skip-cert-verify'] = (bool) data_get($protocol_settings, 'tls_settings.allow_insecure', false);
|
||||
$array['servername'] = data_get($protocol_settings, 'tls_settings.server_name');
|
||||
break;
|
||||
case 2:
|
||||
$array['tls'] = true;
|
||||
$array['skip-cert-verify'] = data_get($protocol_settings, 'reality_settings.allow_insecure', false);
|
||||
$array['skip-cert-verify'] = (bool) data_get($protocol_settings, 'reality_settings.allow_insecure', false);
|
||||
$array['servername'] = data_get($protocol_settings, 'reality_settings.server_name');
|
||||
$array['reality-opts'] = [
|
||||
'public-key' => data_get($protocol_settings, 'reality_settings.public_key'),
|
||||
@ -257,7 +257,7 @@ class ClashMeta implements ProtocolInterface
|
||||
'password' => $password,
|
||||
'udp' => true,
|
||||
'sni' => data_get($settings, 'server_name'),
|
||||
'skip-cert-verify' => data_get($settings, 'allow_insecure', false)
|
||||
'skip-cert-verify' => (bool) data_get($settings, 'allow_insecure', false)
|
||||
];
|
||||
|
||||
switch (data_get($settings, 'network')) {
|
||||
@ -291,7 +291,7 @@ class ClashMeta implements ProtocolInterface
|
||||
'sni' => data_get($protocol_settings, 'tls.server_name'),
|
||||
'up' => data_get($protocol_settings, 'bandwidth.up'),
|
||||
'down' => data_get($protocol_settings, 'bandwidth.down'),
|
||||
'skip-cert-verify' => data_get($protocol_settings, 'tls.allow_insecure', false),
|
||||
'skip-cert-verify' => (bool) data_get($protocol_settings, 'tls.allow_insecure', false),
|
||||
];
|
||||
if (isset($server['ports'])) {
|
||||
$array['ports'] = $server['ports'];
|
||||
|
@ -127,7 +127,7 @@ class SingBox implements ProtocolInterface
|
||||
'transport' => [],
|
||||
'tls' => $protocol_settings['tls'] ? [
|
||||
'enabled' => true,
|
||||
'insecure' => data_get($protocol_settings, 'tls_settings.allow_insecure'),
|
||||
'insecure' => (bool) data_get($protocol_settings, 'tls_settings.allow_insecure'),
|
||||
'server_name' => data_get($protocol_settings, 'tls_settings.server_name')
|
||||
] : null
|
||||
];
|
||||
@ -166,14 +166,14 @@ class SingBox implements ProtocolInterface
|
||||
"server" => $server['host'],
|
||||
"server_port" => $server['port'],
|
||||
"uuid" => $password,
|
||||
"packet_encoding" => "xudp"
|
||||
"packet_encoding" => "xudp",
|
||||
'flow' => data_get($protocol_settings, 'flow', ''),
|
||||
];
|
||||
|
||||
if ($protocol_settings['tls']) {
|
||||
$tlsConfig = [
|
||||
'enabled' => true,
|
||||
'flow' => data_get($protocol_settings, 'flow', ''),
|
||||
'insecure' => data_get($protocol_settings, 'tls_settings.allow_insecure'),
|
||||
'insecure' => (bool) data_get($protocol_settings, 'tls_settings.allow_insecure'),
|
||||
'server_name' => data_get($protocol_settings, 'tls_settings.server_name'),
|
||||
'utls' => [
|
||||
'enabled' => true,
|
||||
@ -233,7 +233,7 @@ class SingBox implements ProtocolInterface
|
||||
'password' => $password,
|
||||
'tls' => [
|
||||
'enabled' => true,
|
||||
'insecure' => data_get($protocol_settings, 'allow_insecure', false),
|
||||
'insecure' => (bool) data_get($protocol_settings, 'allow_insecure', false),
|
||||
'server_name' => data_get($protocol_settings, 'server_name')
|
||||
]
|
||||
];
|
||||
@ -255,7 +255,7 @@ class SingBox implements ProtocolInterface
|
||||
return $array;
|
||||
}
|
||||
|
||||
protected function buildHysteria($password, $server, $user): array
|
||||
protected function buildHysteria($password, $server): array
|
||||
{
|
||||
$protocol_settings = $server['protocol_settings'];
|
||||
$baseConfig = [
|
||||
@ -264,7 +264,7 @@ class SingBox implements ProtocolInterface
|
||||
'tag' => $server['name'],
|
||||
'tls' => [
|
||||
'enabled' => true,
|
||||
'insecure' => $protocol_settings['tls']['allow_insecure'],
|
||||
'insecure' => (bool) $protocol_settings['tls']['allow_insecure'],
|
||||
'server_name' => $protocol_settings['tls']['server_name']
|
||||
]
|
||||
];
|
||||
@ -272,7 +272,7 @@ class SingBox implements ProtocolInterface
|
||||
'up_mbps' => $protocol_settings['bandwidth']['up'],
|
||||
'down_mbps' => $protocol_settings['bandwidth']['down'],
|
||||
];
|
||||
$versionConfig = match ($server['version'] ?? 1) {
|
||||
$versionConfig = match (data_get($protocol_settings, 'version', 1)) {
|
||||
2 => [
|
||||
'type' => 'hysteria2',
|
||||
'password' => $password,
|
||||
|
@ -119,9 +119,9 @@ class Helper
|
||||
return $subscribeUrl ? rtrim($subscribeUrl, '/') . $path : url($path);
|
||||
}
|
||||
|
||||
public static function randomPort($range) {
|
||||
public static function randomPort($range): int {
|
||||
$portRange = explode('-', $range);
|
||||
return rand($portRange[0], $portRange[1]);
|
||||
return random_int($portRange[0], $portRange[1]);
|
||||
}
|
||||
|
||||
public static function base64EncodeUrlSafe($data)
|
||||
|
@ -29,7 +29,8 @@
|
||||
"stripe/stripe-php": "^7.36.1",
|
||||
"symfony/http-client": "^6.4",
|
||||
"symfony/mailgun-mailer": "^6.4",
|
||||
"symfony/yaml": "*"
|
||||
"symfony/yaml": "*",
|
||||
"zoujingli/ip2region": "^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-debugbar": "^3.9",
|
||||
|
@ -59,8 +59,14 @@ return [
|
||||
'strict' => true,
|
||||
'engine' => null,
|
||||
'options' => (extension_loaded('pdo_mysql') ? array_filter([
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA')
|
||||
]) : []) + [ \PDO::ATTR_PERSISTENT => true ],
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
PDO::ATTR_PERSISTENT => false,
|
||||
]) : []),
|
||||
'pool' => [
|
||||
'min_connections' => 1,
|
||||
'max_connections' => 10,
|
||||
'idle_timeout' => 60,
|
||||
],
|
||||
],
|
||||
|
||||
'pgsql' => [
|
||||
|
@ -23,7 +23,7 @@ return new class extends Migration {
|
||||
$table->integer('rate')->comment('Traffic Rate');
|
||||
$table->json('tags')->nullable()->comment('Server Tags');
|
||||
$table->string('host')->comment('Server Host');
|
||||
$table->integer('port')->comment('Client Port');
|
||||
$table->string('port')->comment('Client Port');
|
||||
$table->integer('server_port')->comment('Server Port');
|
||||
$table->json('protocol_settings')->nullable();
|
||||
$table->boolean('show')->default(false)->comment('Show in List');
|
||||
@ -45,7 +45,7 @@ return new class extends Migration {
|
||||
'rate' => (int) $server->rate,
|
||||
'tags' => $server->tags ?: "[]",
|
||||
'host' => $server->host,
|
||||
'port' => (int) $server->port,
|
||||
'port' => $server->port,
|
||||
'server_port' => $server->server_port,
|
||||
'protocol_settings' => json_encode([
|
||||
'allow_insecure' => $server->allow_insecure,
|
||||
@ -73,7 +73,7 @@ return new class extends Migration {
|
||||
'rate' => (int) $server->rate,
|
||||
'tags' => $server->tags ?: "[]",
|
||||
'host' => $server->host,
|
||||
'port' => (int) $server->port,
|
||||
'port' => $server->port,
|
||||
'server_port' => $server->server_port,
|
||||
'protocol_settings' => json_encode([
|
||||
'tls' => $server->tls,
|
||||
@ -103,7 +103,7 @@ return new class extends Migration {
|
||||
'rate' => (int) $server->rate,
|
||||
'tags' => $server->tags ?: "[]",
|
||||
'host' => $server->host,
|
||||
'port' => (int) $server->port,
|
||||
'port' => $server->port,
|
||||
'server_port' => $server->server_port,
|
||||
'protocol_settings' => json_encode([
|
||||
'tls' => $server->tls,
|
||||
@ -114,7 +114,8 @@ return new class extends Migration {
|
||||
'reality_settings' => ($tlsSettings && $tlsSettings->public_key && $tlsSettings->short_id && $tlsSettings->server_name) ? [
|
||||
'public_key' => $tlsSettings->public_key,
|
||||
'short_id' => $tlsSettings->short_id,
|
||||
'dest' => $tlsSettings->server_name . ($tlsSettings->server_port ? ':' . $tlsSettings->server_port : ''),
|
||||
'server_name' => $tlsSettings->server_name,
|
||||
'server_port' => $tlsSettings->server_port,
|
||||
'private_key' => $tlsSettings->private_key,
|
||||
] : null
|
||||
]),
|
||||
@ -138,7 +139,7 @@ return new class extends Migration {
|
||||
'rate' => (int) $server->rate,
|
||||
'tags' => $server->tags ?: "[]",
|
||||
'host' => $server->host,
|
||||
'port' => (int) $server->port,
|
||||
'port' => $server->port,
|
||||
'server_port' => $server->server_port,
|
||||
'protocol_settings' => json_encode([
|
||||
'cipher' => $server->cipher,
|
||||
@ -153,7 +154,7 @@ return new class extends Migration {
|
||||
}
|
||||
|
||||
// Migrate Hysteria servers
|
||||
$hysteriaServers = DB::table('v2_server_hysteria')->get();
|
||||
$hysteriaServers = DB::table(table: 'v2_server_hysteria')->get();
|
||||
foreach ($hysteriaServers as $server) {
|
||||
DB::table('v2_server')->insert([
|
||||
'type' => 'hysteria',
|
||||
@ -445,8 +446,8 @@ return new class extends Migration {
|
||||
'rate' => (string) $server->rate,
|
||||
'show' => $server->show,
|
||||
'sort' => $server->sort,
|
||||
'up' => $settings['bandwidth']['up'],
|
||||
'down' => $settings['bandwidth']['down'],
|
||||
'up_mbps' => $settings['bandwidth']['up'],
|
||||
'down_mbps' => $settings['bandwidth']['down'],
|
||||
'server_name' => $settings['tls']['server_name'],
|
||||
'insecure' => $settings['tls']['allow_insecure'],
|
||||
'created_at' => $timestamp,
|
||||
|
2
public/assets/admin/assets/index.css
vendored
2
public/assets/admin/assets/index.css
vendored
File diff suppressed because one or more lines are too long
18
public/assets/admin/assets/index.js
vendored
18
public/assets/admin/assets/index.js
vendored
File diff suppressed because one or more lines are too long
358
public/assets/admin/assets/vendor.js
vendored
358
public/assets/admin/assets/vendor.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user