mirror of
https://github.com/v2board/v2board.git
synced 2025-01-27 00:19:10 +08:00
update
This commit is contained in:
parent
4b4d777a4e
commit
dfdf995ddb
@ -42,6 +42,12 @@ class ServerController extends Controller
|
|||||||
$params['tags'] = json_encode($params['tags']);
|
$params['tags'] = json_encode($params['tags']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($params['dnsSettings'])) {
|
||||||
|
if (!is_object(json_decode($params['dnsSettings']))) {
|
||||||
|
abort(500, 'DNS规则配置格式不正确');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($params['ruleSettings'])) {
|
if (isset($params['ruleSettings'])) {
|
||||||
if (!is_object(json_decode($params['ruleSettings']))) {
|
if (!is_object(json_decode($params['ruleSettings']))) {
|
||||||
abort(500, '审计规则配置格式不正确');
|
abort(500, '审计规则配置格式不正确');
|
||||||
|
@ -20,7 +20,8 @@ class ServerSave extends FormRequest
|
|||||||
'network' => 'required|in:tcp,kcp,ws,http,domainsocket,quic',
|
'network' => 'required|in:tcp,kcp,ws,http,domainsocket,quic',
|
||||||
'networkSettings' => '',
|
'networkSettings' => '',
|
||||||
'ruleSettings' => '',
|
'ruleSettings' => '',
|
||||||
'tlsSettings' => ''
|
'tlsSettings' => '',
|
||||||
|
'dnsSettings' => ''
|
||||||
];
|
];
|
||||||
/**
|
/**
|
||||||
* Get the validation rules that apply to the request.
|
* Get the validation rules that apply to the request.
|
||||||
|
@ -8,7 +8,7 @@ use App\Models\Server;
|
|||||||
class ServerService
|
class ServerService
|
||||||
{
|
{
|
||||||
|
|
||||||
CONST SERVER_CONFIG = '{"api":{"services":["HandlerService","StatsService"],"tag":"api"},"stats":{},"inbound":{"port":443,"protocol":"vmess","settings":{"clients":[]},"sniffing":{"enabled": true,"destOverride": ["http","tls"]},"streamSettings":{"network":"tcp"},"tag":"proxy"},"inboundDetour":[{"listen":"0.0.0.0","port":23333,"protocol":"dokodemo-door","settings":{"address":"0.0.0.0"},"tag":"api"}],"log":{"loglevel":"debug","access":"access.log","error":"error.log"},"outbound":{"protocol":"freedom","settings":{}},"outboundDetour":[{"protocol":"blackhole","settings":{},"tag":"block"}],"routing":{"rules":[{"inboundTag":"api","outboundTag":"api","type":"field"}]},"policy":{"levels":{"0":{"handshake":4,"connIdle":300,"uplinkOnly":5,"downlinkOnly":30,"statsUserUplink":true,"statsUserDownlink":true}}}}';
|
CONST SERVER_CONFIG = '{"api":{"services":["HandlerService","StatsService"],"tag":"api"},"dns":{},"stats":{},"inbound":{"port":443,"protocol":"vmess","settings":{"clients":[]},"sniffing":{"enabled":true,"destOverride":["http","tls"]},"streamSettings":{"network":"tcp"},"tag":"proxy"},"inboundDetour":[{"listen":"0.0.0.0","port":23333,"protocol":"dokodemo-door","settings":{"address":"0.0.0.0"},"tag":"api"}],"log":{"loglevel":"debug","access":"access.log","error":"error.log"},"outbound":{"protocol":"freedom","settings":{}},"outboundDetour":[{"protocol":"blackhole","settings":{},"tag":"block"}],"routing":{"rules":[{"inboundTag":"api","outboundTag":"api","type":"field"}]},"policy":{"levels":{"0":{"handshake":4,"connIdle":300,"uplinkOnly":5,"downlinkOnly":30,"statsUserUplink":true,"statsUserDownlink":true}}}}';
|
||||||
|
|
||||||
public function getAvailableUsers($groupId)
|
public function getAvailableUsers($groupId)
|
||||||
{
|
{
|
||||||
@ -53,6 +53,7 @@ class ServerService
|
|||||||
private function setDns(Server $server, object $json)
|
private function setDns(Server $server, object $json)
|
||||||
{
|
{
|
||||||
if ($server->dnsSettings) {
|
if ($server->dnsSettings) {
|
||||||
|
$dns = json_decode($server->dnsSettings);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user