mirror of
https://github.com/v2board/v2board.git
synced 2025-01-30 18:19:12 +08:00
update
This commit is contained in:
parent
1bb88780b5
commit
8bf727055b
@ -31,7 +31,7 @@ class ServerController extends Controller
|
||||
$server->name = $request->input('name');
|
||||
$server->host = $request->input('host');
|
||||
$server->port = $request->input('port');
|
||||
$server->local_port = $request->input('local_port');
|
||||
$server->server_port = $request->input('server_port');
|
||||
$server->tls = $request->input('tls');
|
||||
$server->tags = json_encode($request->input('tags'));
|
||||
$server->rate = $request->input('rate');
|
||||
|
@ -89,9 +89,10 @@ class DeepbworkController extends Controller
|
||||
// 后端获取配置
|
||||
public function config (Request $request) {
|
||||
$nodeId = $request->input('node_id');
|
||||
$localPort = $request->input('local_port');
|
||||
$server = Server::find($nodeId);
|
||||
$jsonData = json_decode(self::SERVER_CONFIG);
|
||||
$jsonData->inboundDetour[0]->port = (int)$server->local_port;
|
||||
$jsonData->inboundDetour[0]->port = (int)$localPort;
|
||||
$jsonData->inbound->port = (int)$server->port;
|
||||
if ((int)$server->tls) {
|
||||
$jsonData->inbound->streamSettings->security = "tls";
|
||||
|
@ -18,7 +18,7 @@ class ServerSave extends FormRequest
|
||||
'group_id' => 'required|array',
|
||||
'host' => 'required',
|
||||
'port' => 'required',
|
||||
'local_port' => 'required',
|
||||
'server_port' => 'required',
|
||||
'tls' => 'required',
|
||||
'tags' => 'array',
|
||||
'rate' => 'required|numeric'
|
||||
@ -33,7 +33,7 @@ class ServerSave extends FormRequest
|
||||
'group_id.array' => '权限组格式不正确',
|
||||
'host.required' => '节点地址不能为空',
|
||||
'port.required' => '连接端口不能为空',
|
||||
'local_port.required' => '后端服务端口不能为空',
|
||||
'server_port.required' => '后端服务端口不能为空',
|
||||
'tls.required' => 'TLS不能为空',
|
||||
'tags.array' => '标签格式不正确',
|
||||
'rate.required' => '倍率不能为空',
|
||||
|
Loading…
Reference in New Issue
Block a user