Преглед изворни кода

针对VNet进行强化

1. 添加了多IP线路的兼容;
2. 强化用户信息变动 与 VNet信息更新的机制;
3. 修正了节点结构修正后,VNet重置线路异常的问题;
4. 添加VNet线路一键重启命令 `php artisan vnet:reload`。
兔姬桑 пре 3 година
родитељ
комит
3d1c1d2151

+ 28 - 0
app/Console/Commands/VNetReload.php

@@ -0,0 +1,28 @@
+<?php
+
+namespace App\Console\Commands;
+
+use App\Jobs\VNet\reloadNode;
+use App\Models\Node;
+use Illuminate\Console\Command;
+use Log;
+
+class VNetReload extends Command
+{
+    protected $signature = 'vnet:reload';
+    protected $description = 'VNet线路重置';
+
+    public function handle()
+    {
+        $startTime = microtime(true);
+
+        $nodes = Node::whereStatus(1)->whereType(4)->get();
+        if ($nodes->isNotEmpty()) {
+            reloadNode::dispatchNow($nodes);
+        }
+
+        $jobTime = round((microtime(true) - $startTime), 4);
+
+        Log::info('---【'.$this->description.'】完成---,耗时'.$jobTime.'秒');
+    }
+}

+ 8 - 2
app/Http/Controllers/Api/WebApi/SSRController.php

@@ -10,7 +10,13 @@ class SSRController extends CoreController
     // 获取节点信息
     public function getNodeInfo(Node $node): JsonResponse
     {
-        return $this->returnData('获取节点信息成功', 200, 'success', [
+        return $this->returnData('获取节点信息成功', 200, 'success', $this->nodeData($node));
+    }
+
+    // 生成节点信息
+    public function nodeData(Node $node): array
+    {
+        return [
             'id'           => $node->id,
             'method'       => $node->profile['method'] ?? '',
             'protocol'     => $node->profile['protocol'] ?? '',
@@ -25,7 +31,7 @@ class SSRController extends CoreController
             'push_port'    => $node->push_port,
             'secret'       => $node->auth->secret,
             'redirect_url' => sysConfig('redirect_url'),
-        ]);
+        ];
     }
 
     // 获取节点可用的用户列表

+ 14 - 8
app/Jobs/VNet/addUser.php

@@ -30,11 +30,11 @@ class addUser implements ShouldQueue
         $data = [];
         foreach (User::findMany($userIds) as $user) {
             $data[] = [
-                'uid' => $user->id,
-                'port' => $user->port,
-                'passwd' => $user->passwd,
+                'uid'         => $user->id,
+                'port'        => $user->port,
+                'passwd'      => $user->passwd,
                 'speed_limit' => $user->speed_limit,
-                'enable' => $user->enable,
+                'enable'      => $user->enable,
             ];
         }
 
@@ -44,19 +44,25 @@ class addUser implements ShouldQueue
     public function handle(): void
     {
         foreach ($this->nodes as $node) {
-            $this->send(($node->server ?: $node->ip).':'.$node->push_port, $node->auth->secret);
+            if ($node->is_ddns) {
+                $this->send($node->server.':'.$node->push_port, $node->auth->secret);
+            } else { // 多IP支持
+                foreach ($node->ips() as $ip) {
+                    $this->send($ip.':'.$node->push_port, $node->auth->secret);
+                }
+            }
         }
     }
 
-    private function send($host, $secret): void
+    private function send(string $host, string $secret): void
     {
         $response = Http::baseUrl($host)->timeout(20)->withHeaders(['secret' => $secret])->post('api/v2/user/add/list', $this->data);
         $message = $response->json();
         if ($message && Arr::has($message, ['success', 'content']) && $response->ok()) {
             if ($message['success'] === 'false') {
-                Log::alert('【新增用户】推送失败(推送地址:'.$host.',返回内容:'.$message['content'].')');
+                Log::alert("【新增用户】推送失败(推送地址:{$host},返回内容:".$message['content'].')');
             } else {
-                Log::notice('【新增用户】推送成功(推送地址:'.$host.',内容:'.json_encode($this->data, true).')');
+                Log::notice("【新增用户】推送成功(推送地址:{$host},内容:".json_encode($this->data, true).')');
             }
         }
     }

+ 10 - 4
app/Jobs/VNet/delUser.php

@@ -31,11 +31,17 @@ class delUser implements ShouldQueue
     public function handle(): void
     {
         foreach ($this->nodes as $node) {
-            $this->send(($node->server ?: $node->ip).':'.$node->push_port, $node->auth->secret);
+            if ($node->is_ddns) {
+                $this->send($node->server.':'.$node->push_port, $node->auth->secret);
+            } else { // 多IP支持
+                foreach ($node->ips() as $ip) {
+                    $this->send($ip.':'.$node->push_port, $node->auth->secret);
+                }
+            }
         }
     }
 
-    private function send($host, $secret): void
+    private function send(string $host, string $secret): void
     {
         $request = Http::baseUrl($host)->timeout(15)->withHeaders(['secret' => $secret]);
 
@@ -48,9 +54,9 @@ class delUser implements ShouldQueue
         $message = $response->json();
         if ($message && Arr::has($message, ['success', 'content']) && $response->ok()) {
             if ($message['success'] === 'false') {
-                Log::alert('【删除用户】推送失败(推送地址:'.$host.',返回内容:'.$message['content'].')');
+                Log::alert("【删除用户】推送失败(推送地址:{$host},返回内容:".$message['content'].')');
             } else {
-                Log::notice('【删除用户】推送成功(推送地址:'.$host.',内容:'.json_encode($this->userIds, true).')');
+                Log::notice("【删除用户】推送成功(推送地址:{$host},内容:".json_encode($this->userIds, true).')');
             }
         }
     }

+ 17 - 15
app/Jobs/VNet/editUser.php

@@ -27,31 +27,33 @@ class editUser implements ShouldQueue
     {
         $this->nodes = $nodes;
         $this->data = [
-            'uid' => $user->id,
-            'port' => (int) $user->port,
-            'passwd' => $user->passwd,
+            'uid'         => $user->id,
+            'port'        => (int) $user->port,
+            'passwd'      => $user->passwd,
             'speed_limit' => $user->speed_limit,
-            'enable' => (int) $user->enable,
+            'enable'      => (int) $user->enable,
         ];
     }
 
     public function handle(): void
     {
         foreach ($this->nodes as $node) {
-            $host = ($node->server ?: $node->ip).':'.$node->push_port;
-            $secret = $node->auth->secret;
-
-            // 如果用户已存在节点内,则执行修改;否则为添加
-            $list = $this->list($host, $secret);
-            if ($list && in_array($this->data['uid'], $list)) {
-                $this->send($host, $secret);
+            $list = $this->list(($node->server ?: $node->ips()[0]).':'.$node->push_port, $node->auth->secret);
+            if ($list && in_array($this->data['uid'], $list, true)) { // 如果用户已存在节点内,则执行修改;否则为添加
+                if ($node->is_ddns) {
+                    $this->send($node->server.':'.$node->push_port, $node->auth->secret);
+                } else { // 多IP支持
+                    foreach ($node->ips() as $ip) {
+                        $this->send($ip.':'.$node->push_port, $node->auth->secret);
+                    }
+                }
             } else {
                 addUser::dispatch($this->data['uid'], $node->id);
             }
         }
     }
 
-    private function list($host, $secret)
+    private function list(string $host, string $secret)
     {
         $response = Http::baseUrl($host)->timeout(20)->withHeaders(['secret' => $secret])->get('api/user/list');
         $message = $response->json();
@@ -64,15 +66,15 @@ class editUser implements ShouldQueue
         return false;
     }
 
-    private function send($host, $secret): void
+    private function send(string $host, string $secret): void
     {
         $response = Http::baseUrl($host)->timeout(20)->withHeaders(['secret' => $secret])->post('api/user/edit', $this->data);
         $message = $response->json();
         if ($message && Arr::has($message, ['success', 'content']) && $response->ok()) {
             if ($message['success'] === 'false') {
-                Log::warning('【编辑用户】推送失败(推送地址:'.$host.',返回内容:'.$message['content'].')');
+                Log::warning("【编辑用户】推送失败(推送地址:{$host},返回内容:".$message['content'].')');
             } else {
-                Log::info('【编辑用户】推送成功(推送地址:'.$host.',内容:'.json_encode($this->data, true).')');
+                Log::info("【编辑用户】推送成功(推送地址:{$host},内容:".json_encode($this->data, true).')');
             }
         }
     }

+ 17 - 25
app/Jobs/VNet/reloadNode.php

@@ -2,6 +2,7 @@
 
 namespace App\Jobs\VNet;
 
+use App\Http\Controllers\Api\WebApi\SSRController;
 use Arr;
 use Http;
 use Illuminate\Bus\Queueable;
@@ -32,50 +33,41 @@ class reloadNode implements ShouldQueue
 
     public function handle(): bool
     {
-        $allSuccess = true;
         foreach ($this->nodes as $node) {
-            $ret = $this->send(($node->server ?: $node->ip).':'.$node->push_port, $node->auth->secret, [
-                'id'             => $node->id,
-                'port'           => (string) $node->port,
-                'passwd'         => $node->passwd ?: '',
-                'method'         => $node->method,
-                'protocol'       => $node->protocol,
-                'obfs'           => $node->obfs,
-                'protocol_param' => $node->protocol_param,
-                'obfs_param'     => $node->obfs_param ?: '',
-                'push_port'      => $node->push_port,
-                'single'         => $node->profile['passwd'] ? 1 : 0,
-                'secret'         => $node->auth->secret,
-                'speed_limit'    => $node->getRawOriginal('speed_limit'),
-                'is_udp'         => $node->is_udp,
-                'client_limit'   => $node->client_limit,
-                // 'redirect_url' => (string) sysConfig('redirect_url'),
-            ]);
+            $data = (new SSRController())->nodeData($node);
 
-            if (! $ret) {
-                $allSuccess = false;
+            if ($node->is_ddns) {
+                if (! $this->send($node->server.':'.$node->push_port, $node->auth->secret, $data)) {
+                    $result = false;
+                }
+            } else { // 多IP支持
+                foreach ($node->ips() as $ip) {
+                    if (! $this->send($ip.':'.$node->push_port, $node->auth->secret, $data)) {
+                        $result = false;
+                    }
+                }
             }
         }
 
-        return $allSuccess;
+        return $result ?? true;
     }
 
-    public function send($host, $secret, $data): bool
+    public function send(string $host, string $secret, array $data): bool
     {
         $response = Http::baseUrl($host)->timeout(15)->withHeaders(['secret' => $secret])->post('api/v2/node/reload', $data);
         $message = $response->json();
         if ($message && Arr::has($message, ['success', 'content']) && $response->ok()) {
             if ($message['success'] === 'false') {
-                Log::warning('【重载节点】失败:'.$host.' 反馈:'.$message['content']);
+                Log::warning("【重载节点】失败:{$host} 反馈:".$message['content']);
 
                 return false;
             }
 
-            Log::notice('【重载节点】成功:'.$host.' 反馈:'.$message['content']);
+            Log::notice("【重载节点】成功:{$host} 反馈:".$message['content']);
 
             return true;
         }
-        Log::warning('【重载节点】失败:'.$host);
+        Log::warning("【重载节点】失败:{$host}");
 
         return false;
     }

+ 5 - 3
app/Models/User.php

@@ -240,15 +240,17 @@ class User extends Authenticatable implements JWTSubject
         return $query->where('status', '>=', 0)->whereEnable(0);
     }
 
-    public function nodes()
+    public function nodes($userLevel = -1, $userGroupId = -1)
     {
-        if ($this->attributes['user_group_id']) {
+        if ($userGroupId === -1 && $this->attributes['user_group_id']) {
             $query = $this->userGroup->nodes();
+        } elseif ($userGroupId !== -1 && $userGroupId) {
+            $query = UserGroup::findOrFail($userGroupId)->nodes();
         } else {
             $query = Node::query();
         }
 
-        return $query->whereStatus(1)->where('level', '<=', $this->attributes['level'] ?? 0);
+        return $query->whereStatus(1)->where('level', '<=', $userLevel !== -1 && $userLevel !== null ? $userLevel : $this->attributes['level'] ?? 0);
     }
 
     public function userGroup(): BelongsTo

+ 21 - 3
app/Observers/UserObserver.php

@@ -7,7 +7,6 @@ use App\Jobs\VNet\addUser;
 use App\Jobs\VNet\delUser;
 use App\Jobs\VNet\editUser;
 use App\Models\User;
-use App\Models\UserSubscribe;
 use Arr;
 
 class UserObserver
@@ -26,8 +25,27 @@ class UserObserver
     {
         $changes = $user->getChanges();
         $allowNodes = $user->nodes()->whereType(4)->get();
-        if ($allowNodes->isNotEmpty() && Arr::hasAny($changes, ['level', 'group_id', 'port', 'passwd', 'speed_limit', 'enable'])) {
-            editUser::dispatch($user, $allowNodes);
+        $oldAllowNodes = $user->nodes($user->getOriginal('level'), $user->getOriginal('user_group_id'))->whereType(4)->get();
+        if ($allowNodes->isNotEmpty() || $oldAllowNodes->isNotEmpty()) {
+            if (Arr::hasAny($changes, ['level', 'user_group_id', 'enable'])) {
+                if (Arr::has($changes, 'enable')) {
+                    if ($user->enable) { // TODO: 由于vnet未正确使用enable字段,临时解决方案
+                        addUser::dispatch($user->id, $allowNodes);
+                    } else {
+                        delUser::dispatch($user->id, $allowNodes);
+                    }
+                } else {
+                    // 权限修改,消除重叠的部分
+                    if ($oldAllowNodes->isNotEmpty() && $oldAllowNodes->diff($allowNodes)->isNotEmpty()) {
+                        delUser::dispatch($user->id, $oldAllowNodes->diff($allowNodes));
+                    }
+                    if ($allowNodes->diff($oldAllowNodes)->isNotEmpty()) {
+                        addUser::dispatch($user->id, $allowNodes->diff($oldAllowNodes));
+                    }
+                }
+            } elseif (Arr::hasAny($changes, ['port', 'passwd', 'speed_limit'])) {
+                editUser::dispatch($user, $allowNodes);
+            }
         }
     }
 

+ 102 - 104
composer.lock

@@ -280,16 +280,16 @@
         },
         {
             "name": "composer/ca-bundle",
-            "version": "1.3.1",
+            "version": "1.3.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/composer/ca-bundle.git",
-                "reference": "4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b"
+                "reference": "fd5dd441932a7e10ca6e5b490e272d34c8430640"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/composer/ca-bundle/zipball/4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b",
-                "reference": "4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b",
+                "url": "https://api.github.com/repos/composer/ca-bundle/zipball/fd5dd441932a7e10ca6e5b490e272d34c8430640",
+                "reference": "fd5dd441932a7e10ca6e5b490e272d34c8430640",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -342,7 +342,7 @@
             "support": {
                 "irc": "irc://irc.freenode.org/composer",
                 "issues": "https://github.com/composer/ca-bundle/issues",
-                "source": "https://github.com/composer/ca-bundle/tree/1.3.1"
+                "source": "https://github.com/composer/ca-bundle/tree/1.3.2"
             },
             "funding": [
                 {
@@ -358,20 +358,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2021-10-28T20:44:15+00:00"
+            "time": "2022-05-24T11:56:16+00:00"
         },
         {
             "name": "doctrine/cache",
-            "version": "2.1.1",
+            "version": "2.2.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/doctrine/cache.git",
-                "reference": "331b4d5dbaeab3827976273e9356b3b453c300ce"
+                "reference": "1ca8f21980e770095a31456042471a57bc4c68fb"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/doctrine/cache/zipball/331b4d5dbaeab3827976273e9356b3b453c300ce",
-                "reference": "331b4d5dbaeab3827976273e9356b3b453c300ce",
+                "url": "https://api.github.com/repos/doctrine/cache/zipball/1ca8f21980e770095a31456042471a57bc4c68fb",
+                "reference": "1ca8f21980e770095a31456042471a57bc4c68fb",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -387,18 +387,12 @@
                 "doctrine/common": ">2.2,<2.4"
             },
             "require-dev": {
-                "alcaeus/mongo-php-adapter": "^1.1",
                 "cache/integration-tests": "dev-master",
-                "doctrine/coding-standard": "^8.0",
-                "mongodb/mongodb": "^1.1",
-                "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
-                "predis/predis": "~1.0",
+                "doctrine/coding-standard": "^9",
+                "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
                 "psr/cache": "^1.0 || ^2.0 || ^3.0",
-                "symfony/cache": "^4.4 || ^5.2 || ^6.0@dev",
-                "symfony/var-exporter": "^4.4 || ^5.2 || ^6.0@dev"
-            },
-            "suggest": {
-                "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver"
+                "symfony/cache": "^4.4 || ^5.4 || ^6",
+                "symfony/var-exporter": "^4.4 || ^5.4 || ^6"
             },
             "type": "library",
             "autoload": {
@@ -447,7 +441,7 @@
             ],
             "support": {
                 "issues": "https://github.com/doctrine/cache/issues",
-                "source": "https://github.com/doctrine/cache/tree/2.1.1"
+                "source": "https://github.com/doctrine/cache/tree/2.2.0"
             },
             "funding": [
                 {
@@ -463,20 +457,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2021-07-17T14:49:29+00:00"
+            "time": "2022-05-20T20:07:39+00:00"
         },
         {
             "name": "doctrine/dbal",
-            "version": "2.13.8",
+            "version": "2.13.9",
             "source": {
                 "type": "git",
                 "url": "https://github.com/doctrine/dbal.git",
-                "reference": "dc9b3c3c8592c935a6e590441f9abc0f9eba335b"
+                "reference": "c480849ca3ad6706a39c970cdfe6888fa8a058b8"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/doctrine/dbal/zipball/dc9b3c3c8592c935a6e590441f9abc0f9eba335b",
-                "reference": "dc9b3c3c8592c935a6e590441f9abc0f9eba335b",
+                "url": "https://api.github.com/repos/doctrine/dbal/zipball/c480849ca3ad6706a39c970cdfe6888fa8a058b8",
+                "reference": "c480849ca3ad6706a39c970cdfe6888fa8a058b8",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -487,7 +481,7 @@
             },
             "require": {
                 "doctrine/cache": "^1.0|^2.0",
-                "doctrine/deprecations": "^0.5.3",
+                "doctrine/deprecations": "^0.5.3|^1",
                 "doctrine/event-manager": "^1.0",
                 "ext-pdo": "*",
                 "php": "^7.1 || ^8"
@@ -562,7 +556,7 @@
             ],
             "support": {
                 "issues": "https://github.com/doctrine/dbal/issues",
-                "source": "https://github.com/doctrine/dbal/tree/2.13.8"
+                "source": "https://github.com/doctrine/dbal/tree/2.13.9"
             },
             "funding": [
                 {
@@ -578,7 +572,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-03-09T15:25:46+00:00"
+            "time": "2022-05-02T20:28:55+00:00"
         },
         {
             "name": "doctrine/deprecations",
@@ -1470,16 +1464,16 @@
         },
         {
             "name": "guzzlehttp/guzzle",
-            "version": "6.5.7",
+            "version": "6.5.8",
             "source": {
                 "type": "git",
                 "url": "https://github.com/guzzle/guzzle.git",
-                "reference": "724562fa861e21a4071c652c8a159934e4f05592"
+                "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/724562fa861e21a4071c652c8a159934e4f05592",
-                "reference": "724562fa861e21a4071c652c8a159934e4f05592",
+                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a52f0440530b54fa079ce76e8c5d196a42cad981",
+                "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -1491,9 +1485,9 @@
             "require": {
                 "ext-json": "*",
                 "guzzlehttp/promises": "^1.0",
-                "guzzlehttp/psr7": "^1.6.1",
+                "guzzlehttp/psr7": "^1.9",
                 "php": ">=5.5",
-                "symfony/polyfill-intl-idn": "^1.17.0"
+                "symfony/polyfill-intl-idn": "^1.17"
             },
             "require-dev": {
                 "ext-curl": "*",
@@ -1571,7 +1565,7 @@
             ],
             "support": {
                 "issues": "https://github.com/guzzle/guzzle/issues",
-                "source": "https://github.com/guzzle/guzzle/tree/6.5.7"
+                "source": "https://github.com/guzzle/guzzle/tree/6.5.8"
             },
             "funding": [
                 {
@@ -1587,7 +1581,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-06-09T21:36:50+00:00"
+            "time": "2022-06-20T22:16:07+00:00"
         },
         {
             "name": "guzzlehttp/promises",
@@ -1681,16 +1675,16 @@
         },
         {
             "name": "guzzlehttp/psr7",
-            "version": "1.8.5",
+            "version": "1.9.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/guzzle/psr7.git",
-                "reference": "337e3ad8e5716c15f9657bd214d16cc5e69df268"
+                "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/guzzle/psr7/zipball/337e3ad8e5716c15f9657bd214d16cc5e69df268",
-                "reference": "337e3ad8e5716c15f9657bd214d16cc5e69df268",
+                "url": "https://api.github.com/repos/guzzle/psr7/zipball/e98e3e6d4f86621a9b75f623996e6bbdeb4b9318",
+                "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -1717,7 +1711,7 @@
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "1.7-dev"
+                    "dev-master": "1.9-dev"
                 }
             },
             "autoload": {
@@ -1777,7 +1771,7 @@
             ],
             "support": {
                 "issues": "https://github.com/guzzle/psr7/issues",
-                "source": "https://github.com/guzzle/psr7/tree/1.8.5"
+                "source": "https://github.com/guzzle/psr7/tree/1.9.0"
             },
             "funding": [
                 {
@@ -1793,7 +1787,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-03-20T21:51:18+00:00"
+            "time": "2022-06-20T21:43:03+00:00"
         },
         {
             "name": "hashids/hashids",
@@ -2337,16 +2331,16 @@
         },
         {
             "name": "laravel-lang/lang",
-            "version": "10.9.1",
+            "version": "10.9.4",
             "source": {
                 "type": "git",
                 "url": "https://github.com/Laravel-Lang/lang.git",
-                "reference": "07e100bbe05a876baed68b2dab12742e4f705ec8"
+                "reference": "eeb4b38ef7aba493f3915c89b99c803ce096e996"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/Laravel-Lang/lang/zipball/07e100bbe05a876baed68b2dab12742e4f705ec8",
-                "reference": "07e100bbe05a876baed68b2dab12742e4f705ec8",
+                "url": "https://api.github.com/repos/Laravel-Lang/lang/zipball/eeb4b38ef7aba493f3915c89b99c803ce096e996",
+                "reference": "eeb4b38ef7aba493f3915c89b99c803ce096e996",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -2359,7 +2353,7 @@
                 "ext-json": "*"
             },
             "conflict": {
-                "laravel-lang/publisher": "<12.0"
+                "laravel-lang/publisher": "<12.0 >=14.0"
             },
             "require-dev": {
                 "dragon-code/pretty-array": "^4.0",
@@ -2417,7 +2411,7 @@
                     "type": "open_collective"
                 }
             ],
-            "time": "2022-05-26T13:57:11+00:00"
+            "time": "2022-06-22T09:43:06+00:00"
         },
         {
             "name": "laravel-notification-channels/bearychat",
@@ -2715,16 +2709,16 @@
         },
         {
             "name": "laravel/socialite",
-            "version": "v5.5.1",
+            "version": "v5.5.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/laravel/socialite.git",
-                "reference": "9b96dfd69e9c1de69c23205cb390550bc71c357e"
+                "reference": "68afb03259b82d898c68196cbcacd48596a9dd72"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/laravel/socialite/zipball/9b96dfd69e9c1de69c23205cb390550bc71c357e",
-                "reference": "9b96dfd69e9c1de69c23205cb390550bc71c357e",
+                "url": "https://api.github.com/repos/laravel/socialite/zipball/68afb03259b82d898c68196cbcacd48596a9dd72",
+                "reference": "68afb03259b82d898c68196cbcacd48596a9dd72",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -2786,7 +2780,7 @@
                 "issues": "https://github.com/laravel/socialite/issues",
                 "source": "https://github.com/laravel/socialite"
             },
-            "time": "2022-02-07T16:08:19+00:00"
+            "time": "2022-03-10T15:26:19+00:00"
         },
         {
             "name": "laravel/tinker",
@@ -5796,16 +5790,16 @@
         },
         {
             "name": "symfony/console",
-            "version": "v5.4.9",
+            "version": "v5.4.10",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/console.git",
-                "reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb"
+                "reference": "4d671ab4ddac94ee439ea73649c69d9d200b5000"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/console/zipball/829d5d1bf60b2efeb0887b7436873becc71a45eb",
-                "reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb",
+                "url": "https://api.github.com/repos/symfony/console/zipball/4d671ab4ddac94ee439ea73649c69d9d200b5000",
+                "reference": "4d671ab4ddac94ee439ea73649c69d9d200b5000",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -5881,7 +5875,7 @@
                 "terminal"
             ],
             "support": {
-                "source": "https://github.com/symfony/console/tree/v5.4.9"
+                "source": "https://github.com/symfony/console/tree/v5.4.10"
             },
             "funding": [
                 {
@@ -5897,7 +5891,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-05-18T06:17:34+00:00"
+            "time": "2022-06-26T13:00:04+00:00"
         },
         {
             "name": "symfony/css-selector",
@@ -6368,16 +6362,16 @@
         },
         {
             "name": "symfony/http-foundation",
-            "version": "v5.4.9",
+            "version": "v5.4.10",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/http-foundation.git",
-                "reference": "6b0d0e4aca38d57605dcd11e2416994b38774522"
+                "reference": "e7793b7906f72a8cc51054fbca9dcff7a8af1c1e"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/http-foundation/zipball/6b0d0e4aca38d57605dcd11e2416994b38774522",
-                "reference": "6b0d0e4aca38d57605dcd11e2416994b38774522",
+                "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e7793b7906f72a8cc51054fbca9dcff7a8af1c1e",
+                "reference": "e7793b7906f72a8cc51054fbca9dcff7a8af1c1e",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -6427,7 +6421,7 @@
             "description": "Defines an object-oriented layer for the HTTP specification",
             "homepage": "https://symfony.com",
             "support": {
-                "source": "https://github.com/symfony/http-foundation/tree/v5.4.9"
+                "source": "https://github.com/symfony/http-foundation/tree/v5.4.10"
             },
             "funding": [
                 {
@@ -6443,20 +6437,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-05-17T15:07:29+00:00"
+            "time": "2022-06-19T13:13:40+00:00"
         },
         {
             "name": "symfony/http-kernel",
-            "version": "v5.4.9",
+            "version": "v5.4.10",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/http-kernel.git",
-                "reference": "34b121ad3dc761f35fe1346d2f15618f8cbf77f8"
+                "reference": "255ae3b0a488d78fbb34da23d3e0c059874b5948"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/http-kernel/zipball/34b121ad3dc761f35fe1346d2f15618f8cbf77f8",
-                "reference": "34b121ad3dc761f35fe1346d2f15618f8cbf77f8",
+                "url": "https://api.github.com/repos/symfony/http-kernel/zipball/255ae3b0a488d78fbb34da23d3e0c059874b5948",
+                "reference": "255ae3b0a488d78fbb34da23d3e0c059874b5948",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -6545,7 +6539,7 @@
             "description": "Provides a structured process for converting a Request into a Response",
             "homepage": "https://symfony.com",
             "support": {
-                "source": "https://github.com/symfony/http-kernel/tree/v5.4.9"
+                "source": "https://github.com/symfony/http-kernel/tree/v5.4.10"
             },
             "funding": [
                 {
@@ -6561,20 +6555,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-05-27T07:09:08+00:00"
+            "time": "2022-06-26T16:57:59+00:00"
         },
         {
             "name": "symfony/mime",
-            "version": "v5.4.9",
+            "version": "v5.4.10",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/mime.git",
-                "reference": "2b3802a24e48d0cfccf885173d2aac91e73df92e"
+                "reference": "02265e1e5111c3cd7480387af25e82378b7ab9cc"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/mime/zipball/2b3802a24e48d0cfccf885173d2aac91e73df92e",
-                "reference": "2b3802a24e48d0cfccf885173d2aac91e73df92e",
+                "url": "https://api.github.com/repos/symfony/mime/zipball/02265e1e5111c3cd7480387af25e82378b7ab9cc",
+                "reference": "02265e1e5111c3cd7480387af25e82378b7ab9cc",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -6634,7 +6628,7 @@
                 "mime-type"
             ],
             "support": {
-                "source": "https://github.com/symfony/mime/tree/v5.4.9"
+                "source": "https://github.com/symfony/mime/tree/v5.4.10"
             },
             "funding": [
                 {
@@ -6650,7 +6644,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-05-21T10:24:18+00:00"
+            "time": "2022-06-09T12:22:40+00:00"
         },
         {
             "name": "symfony/polyfill-ctype",
@@ -7858,16 +7852,16 @@
         },
         {
             "name": "symfony/string",
-            "version": "v5.4.9",
+            "version": "v5.4.10",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/string.git",
-                "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99"
+                "reference": "4432bc7df82a554b3e413a8570ce2fea90e94097"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/string/zipball/985e6a9703ef5ce32ba617c9c7d97873bb7b2a99",
-                "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99",
+                "url": "https://api.github.com/repos/symfony/string/zipball/4432bc7df82a554b3e413a8570ce2fea90e94097",
+                "reference": "4432bc7df82a554b3e413a8570ce2fea90e94097",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -7930,7 +7924,7 @@
                 "utf8"
             ],
             "support": {
-                "source": "https://github.com/symfony/string/tree/v5.4.9"
+                "source": "https://github.com/symfony/string/tree/v5.4.10"
             },
             "funding": [
                 {
@@ -7946,7 +7940,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-04-19T10:40:37+00:00"
+            "time": "2022-06-26T15:57:47+00:00"
         },
         {
             "name": "symfony/translation",
@@ -8232,16 +8226,16 @@
         },
         {
             "name": "symfony/yaml",
-            "version": "v5.4.3",
+            "version": "v5.4.10",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/yaml.git",
-                "reference": "e80f87d2c9495966768310fc531b487ce64237a2"
+                "reference": "04e42926429d9e8b39c174387ab990bf7817f7a2"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/yaml/zipball/e80f87d2c9495966768310fc531b487ce64237a2",
-                "reference": "e80f87d2c9495966768310fc531b487ce64237a2",
+                "url": "https://api.github.com/repos/symfony/yaml/zipball/04e42926429d9e8b39c174387ab990bf7817f7a2",
+                "reference": "04e42926429d9e8b39c174387ab990bf7817f7a2",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -8293,7 +8287,7 @@
             "description": "Loads and dumps YAML files",
             "homepage": "https://symfony.com",
             "support": {
-                "source": "https://github.com/symfony/yaml/tree/v5.4.3"
+                "source": "https://github.com/symfony/yaml/tree/v5.4.10"
             },
             "funding": [
                 {
@@ -8309,7 +8303,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-01-26T16:32:32+00:00"
+            "time": "2022-06-20T11:50:59+00:00"
         },
         {
             "name": "tijsverkoyen/css-to-inline-styles",
@@ -9296,16 +9290,16 @@
         },
         {
             "name": "composer/composer",
-            "version": "2.3.6",
+            "version": "2.3.7",
             "source": {
                 "type": "git",
                 "url": "https://github.com/composer/composer.git",
-                "reference": "0f43aa1652c447a6bc7c9217ec133313b1d32e72"
+                "reference": "10cd375cf85dede2ff417ceab517ef9a0dc55407"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/composer/composer/zipball/0f43aa1652c447a6bc7c9217ec133313b1d32e72",
-                "reference": "0f43aa1652c447a6bc7c9217ec133313b1d32e72",
+                "url": "https://api.github.com/repos/composer/composer/zipball/10cd375cf85dede2ff417ceab517ef9a0dc55407",
+                "reference": "10cd375cf85dede2ff417ceab517ef9a0dc55407",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -9354,6 +9348,11 @@
             "extra": {
                 "branch-alias": {
                     "dev-main": "2.3-dev"
+                },
+                "phpstan": {
+                    "includes": [
+                        "phpstan/rules.neon"
+                    ]
                 }
             },
             "autoload": {
@@ -9387,7 +9386,7 @@
             "support": {
                 "irc": "ircs://irc.libera.chat:6697/composer",
                 "issues": "https://github.com/composer/composer/issues",
-                "source": "https://github.com/composer/composer/tree/2.3.6"
+                "source": "https://github.com/composer/composer/tree/2.3.7"
             },
             "funding": [
                 {
@@ -9403,7 +9402,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-06-01T19:57:13+00:00"
+            "time": "2022-06-06T14:43:28+00:00"
         },
         {
             "name": "composer/metadata-minifier",
@@ -11854,16 +11853,16 @@
         },
         {
             "name": "phpunit/phpunit",
-            "version": "9.5.20",
+            "version": "9.5.21",
             "source": {
                 "type": "git",
                 "url": "https://github.com/sebastianbergmann/phpunit.git",
-                "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba"
+                "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/12bc8879fb65aef2138b26fc633cb1e3620cffba",
-                "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba",
+                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0e32b76be457de00e83213528f6bb37e2a38fcb1",
+                "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -11903,7 +11902,6 @@
                 "sebastian/version": "^3.0.2"
             },
             "require-dev": {
-                "ext-pdo": "*",
                 "phpspec/prophecy-phpunit": "^2.0.1"
             },
             "suggest": {
@@ -11947,7 +11945,7 @@
             ],
             "support": {
                 "issues": "https://github.com/sebastianbergmann/phpunit/issues",
-                "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.20"
+                "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.21"
             },
             "funding": [
                 {
@@ -11959,7 +11957,7 @@
                     "type": "github"
                 }
             ],
-            "time": "2022-04-01T12:37:26+00:00"
+            "time": "2022-06-19T12:14:25+00:00"
         },
         {
             "name": "react/promise",

+ 2 - 2
resources/views/user/nodeList.blade.php

@@ -30,14 +30,14 @@
                             </div>
                         </div>
                     </div>
-                    @if(Auth::getUser()->group_id)
+                    @if(Auth::getUser()->user_group_id)
                         <div class="col-md-12">
                             <div class="card card-block p-20 bg-indigo-500">
                                 <div class="counter counter-lg counter-inverse">
                                     <div class="counter-label text-uppercase font-size-16">{{trans('user.account.group')}}</div>
                                     <div class="counter-number-group">
                                         <span class="counter-icon"><i class="icon wb-globe" aria-hidden="true"></i></span>
-                                        <span class="counter-number ml-10">{{Auth::getUser()->group->name}}</span>
+                                        <span class="counter-number ml-10">{{Auth::getUser()->userGroup->name}}</span>
                                     </div>
                                 </div>
                             </div>