mirror of
https://github.com/v2board/v2board.git
synced 2025-01-25 15:39:10 +08:00
update
This commit is contained in:
parent
4831c9f194
commit
39fadd8a63
@ -44,7 +44,7 @@ class ConfigSave extends FormRequest
|
|||||||
'stripe_sk_live' => '',
|
'stripe_sk_live' => '',
|
||||||
'stripe_pk_live' => '',
|
'stripe_pk_live' => '',
|
||||||
'stripe_webhook_key' => '',
|
'stripe_webhook_key' => '',
|
||||||
'stripe_currency' => 'in:hkd,usd,sgd',
|
'stripe_currency' => 'in:hkd,usd,sgd,eur',
|
||||||
// bitpayx
|
// bitpayx
|
||||||
'bitpayx_enable' => 'in:0,1',
|
'bitpayx_enable' => 'in:0,1',
|
||||||
'bitpayx_appsecret' => '',
|
'bitpayx_appsecret' => '',
|
||||||
|
@ -43,6 +43,22 @@ class ServerService
|
|||||||
$json->inboundDetour[0]->port = (int)$localPort;
|
$json->inboundDetour[0]->port = (int)$localPort;
|
||||||
$json->inbound->port = (int)$server->server_port;
|
$json->inbound->port = (int)$server->server_port;
|
||||||
$json->inbound->streamSettings->network = $server->network;
|
$json->inbound->streamSettings->network = $server->network;
|
||||||
|
$json = $this->setNetwork($server, $json);
|
||||||
|
$json = $this->setRule($server, $json);
|
||||||
|
$json = $this->setTls($server, $json);
|
||||||
|
|
||||||
|
return $json;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setDns(Server $server, object $json)
|
||||||
|
{
|
||||||
|
if ($server->dnsSettings) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setNetwork(Server $server, object $json)
|
||||||
|
{
|
||||||
if ($server->networkSettings) {
|
if ($server->networkSettings) {
|
||||||
switch ($server->network) {
|
switch ($server->network) {
|
||||||
case 'tcp':
|
case 'tcp':
|
||||||
@ -64,8 +80,12 @@ class ServerService
|
|||||||
$json->inbound->streamSettings->quicSettings = json_decode($server->networkSettings);
|
$json->inbound->streamSettings->quicSettings = json_decode($server->networkSettings);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
return $json;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setRule(Server $server, object $json)
|
||||||
|
{
|
||||||
if ($server->ruleSettings) {
|
if ($server->ruleSettings) {
|
||||||
$rules = json_decode($server->ruleSettings);
|
$rules = json_decode($server->ruleSettings);
|
||||||
// domain
|
// domain
|
||||||
@ -84,8 +104,12 @@ class ServerService
|
|||||||
$protocolObj->outboundTag = 'block';
|
$protocolObj->outboundTag = 'block';
|
||||||
array_push($json->routing->rules, $protocolObj);
|
array_push($json->routing->rules, $protocolObj);
|
||||||
}
|
}
|
||||||
|
return $json;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setTls(Server $server, object $json)
|
||||||
|
{
|
||||||
if ((int)$server->tls) {
|
if ((int)$server->tls) {
|
||||||
$tlsSettings = json_decode($server->tlsSettings);
|
$tlsSettings = json_decode($server->tlsSettings);
|
||||||
$json->inbound->streamSettings->security = 'tls';
|
$json->inbound->streamSettings->security = 'tls';
|
||||||
@ -101,8 +125,7 @@ class ServerService
|
|||||||
$json->inbound->streamSettings->tlsSettings->allowInsecure = (int)$tlsSettings->allowInsecure ? true : false;
|
$json->inbound->streamSettings->tlsSettings->allowInsecure = (int)$tlsSettings->allowInsecure ? true : false;
|
||||||
}
|
}
|
||||||
$json->inbound->streamSettings->tlsSettings->certificates[0] = $tls;
|
$json->inbound->streamSettings->tlsSettings->certificates[0] = $tls;
|
||||||
|
return $json;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $json;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,12 +129,13 @@ CREATE TABLE `v2_server` (
|
|||||||
`tls` tinyint(4) NOT NULL DEFAULT '0',
|
`tls` tinyint(4) NOT NULL DEFAULT '0',
|
||||||
`tags` varchar(255) DEFAULT NULL,
|
`tags` varchar(255) DEFAULT NULL,
|
||||||
`rate` varchar(11) NOT NULL,
|
`rate` varchar(11) NOT NULL,
|
||||||
`network` varchar(11) NOT NULL,
|
`network` text NOT NULL,
|
||||||
`settings` text,
|
`settings` text,
|
||||||
`rules` text,
|
`rules` text,
|
||||||
`networkSettings` text,
|
`networkSettings` text,
|
||||||
`tlsSettings` text,
|
`tlsSettings` text,
|
||||||
`ruleSettings` text,
|
`ruleSettings` text,
|
||||||
|
`dnsSettings` text,
|
||||||
`show` tinyint(1) NOT NULL DEFAULT '0',
|
`show` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
`created_at` int(11) NOT NULL,
|
`created_at` int(11) NOT NULL,
|
||||||
`updated_at` int(11) NOT NULL,
|
`updated_at` int(11) NOT NULL,
|
||||||
@ -243,4 +244,4 @@ CREATE TABLE `v2_user` (
|
|||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
|
||||||
-- 2020-03-17 14:16:01
|
-- 2020-03-30 09:56:24
|
||||||
|
Loading…
Reference in New Issue
Block a user