mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 09:21:46 +08:00 
			
		
		
		
	update: shadowsocks obfs pre support
This commit is contained in:
		| @@ -53,7 +53,7 @@ class VProxyController extends Controller | |||||||
|     public function user(Request $request) |     public function user(Request $request) | ||||||
|     { |     { | ||||||
|         ini_set('memory_limit', -1); |         ini_set('memory_limit', -1); | ||||||
|         Cache::put(CacheKey::get('SERVER_V2RAY_LAST_CHECK_AT', $this->nodeInfo->id), time(), 3600); |         Cache::put(CacheKey::get('SERVER_' . strtoupper($this->nodeType) . '_LAST_CHECK_AT', $this->nodeInfo->id), time(), 3600); | ||||||
|         $serverService = new ServerService(); |         $serverService = new ServerService(); | ||||||
|         $users = $serverService->getAvailableUsers($this->nodeInfo->group_id); |         $users = $serverService->getAvailableUsers($this->nodeInfo->group_id); | ||||||
|         $users = $users->toArray(); |         $users = $users->toArray(); | ||||||
| @@ -82,8 +82,8 @@ class VProxyController extends Controller | |||||||
|     { |     { | ||||||
|         $data = file_get_contents('php://input'); |         $data = file_get_contents('php://input'); | ||||||
|         $data = json_decode($data, true); |         $data = json_decode($data, true); | ||||||
|         Cache::put(CacheKey::get('SERVER_V2RAY_ONLINE_USER', $this->nodeInfo->id), count($data), 3600); |         Cache::put(CacheKey::get('SERVER_' . strtoupper($this->nodeType) . '_ONLINE_USER', $this->nodeInfo->id), count($data), 3600); | ||||||
|         Cache::put(CacheKey::get('SERVER_V2RAY_LAST_PUSH_AT', $this->nodeInfo->id), time(), 3600); |         Cache::put(CacheKey::get('SERVER_' . strtoupper($this->nodeType) . '_LAST_PUSH_AT', $this->nodeInfo->id), time(), 3600); | ||||||
|         $userService = new UserService(); |         $userService = new UserService(); | ||||||
|         foreach ($data as $item) { |         foreach ($data as $item) { | ||||||
|             $u = $item['u'] * $this->nodeInfo->rate; |             $u = $item['u'] * $this->nodeInfo->rate; | ||||||
| @@ -103,7 +103,9 @@ class VProxyController extends Controller | |||||||
|             case 'shadowsocks': |             case 'shadowsocks': | ||||||
|                 die(json_encode([ |                 die(json_encode([ | ||||||
|                     'server_port' => $this->nodeInfo->server_port, |                     'server_port' => $this->nodeInfo->server_port, | ||||||
|                     'cipher' => $this->nodeInfo->cipher |                     'cipher' => $this->nodeInfo->cipher, | ||||||
|  |                     'obfs' => $this->nodeInfo->obfs, | ||||||
|  |                     'obfs_settings' => $this->nodeInfo->obfs_settings | ||||||
|                 ], JSON_UNESCAPED_UNICODE)); |                 ], JSON_UNESCAPED_UNICODE)); | ||||||
|                 break; |                 break; | ||||||
|             case 'v2ray': |             case 'v2ray': | ||||||
|   | |||||||
| @@ -22,6 +22,8 @@ class ServerShadowsocksSave extends FormRequest | |||||||
|             'port' => 'required', |             'port' => 'required', | ||||||
|             'server_port' => 'required', |             'server_port' => 'required', | ||||||
|             'cipher' => 'required|in:aes-128-gcm,aes-256-gcm,chacha20-ietf-poly1305', |             'cipher' => 'required|in:aes-128-gcm,aes-256-gcm,chacha20-ietf-poly1305', | ||||||
|  |             'obfs' => 'nullable|in:http', | ||||||
|  |             'obfs_settings' => 'nullable|array', | ||||||
|             'tags' => 'nullable|array', |             'tags' => 'nullable|array', | ||||||
|             'rate' => 'required|numeric' |             'rate' => 'required|numeric' | ||||||
|         ]; |         ]; | ||||||
| @@ -40,7 +42,9 @@ class ServerShadowsocksSave extends FormRequest | |||||||
|             'cipher.required' => '加密方式不能为空', |             'cipher.required' => '加密方式不能为空', | ||||||
|             'tags.array' => '标签格式不正确', |             'tags.array' => '标签格式不正确', | ||||||
|             'rate.required' => '倍率不能为空', |             'rate.required' => '倍率不能为空', | ||||||
|             'rate.numeric' => '倍率格式不正确' |             'rate.numeric' => '倍率格式不正确', | ||||||
|  |             'obfs.in' => '混淆格式不正确', | ||||||
|  |             'obfs_settings.array' => '混淆设置格式不正确' | ||||||
|         ]; |         ]; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -13,6 +13,7 @@ class ServerShadowsocks extends Model | |||||||
|         'created_at' => 'timestamp', |         'created_at' => 'timestamp', | ||||||
|         'updated_at' => 'timestamp', |         'updated_at' => 'timestamp', | ||||||
|         'group_id' => 'array', |         'group_id' => 'array', | ||||||
|         'tags' => 'array' |         'tags' => 'array', | ||||||
|  |         'obfs_settings' => 'array' | ||||||
|     ]; |     ]; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -204,6 +204,8 @@ CREATE TABLE `v2_server_shadowsocks` ( | |||||||
|                                          `port` int(11) NOT NULL, |                                          `port` int(11) NOT NULL, | ||||||
|                                          `server_port` int(11) NOT NULL, |                                          `server_port` int(11) NOT NULL, | ||||||
|                                          `cipher` varchar(255) NOT NULL, |                                          `cipher` varchar(255) NOT NULL, | ||||||
|  |                                          `obfs` char(11) DEFAULT NULL, | ||||||
|  |                                          `obfs_settings` varchar(255) DEFAULT NULL, | ||||||
|                                          `show` tinyint(4) NOT NULL DEFAULT '0', |                                          `show` tinyint(4) NOT NULL DEFAULT '0', | ||||||
|                                          `sort` int(11) DEFAULT NULL, |                                          `sort` int(11) DEFAULT NULL, | ||||||
|                                          `created_at` int(11) NOT NULL, |                                          `created_at` int(11) NOT NULL, | ||||||
| @@ -376,4 +378,4 @@ CREATE TABLE `v2_user` ( | |||||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||||||
|  |  | ||||||
|  |  | ||||||
| -- 2022-05-01 17:06:46 | -- 2022-05-10 17:13:24 | ||||||
|   | |||||||
| @@ -569,3 +569,7 @@ DROP `settings`; | |||||||
|  |  | ||||||
| ALTER TABLE `v2_ticket` | ALTER TABLE `v2_ticket` | ||||||
| DROP `last_reply_user_id`; | DROP `last_reply_user_id`; | ||||||
|  |  | ||||||
|  | ALTER TABLE `v2_server_shadowsocks` | ||||||
|  |     ADD `obfs` char(11) NULL AFTER `cipher`, | ||||||
|  | ADD `obfs_settings` varchar(255) NULL AFTER `obfs`; | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								public/assets/admin/umi.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								public/assets/admin/umi.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Reference in New Issue
	
	Block a user