update: vless

This commit is contained in:
v2board 2023-07-17 15:50:33 +08:00
parent 4c865d0262
commit c1097ad48f
4 changed files with 7 additions and 4 deletions

View File

@ -21,7 +21,7 @@ class VlessController extends Controller
'server_port' => 'required', 'server_port' => 'required',
'tls' => 'required|in:0,1', 'tls' => 'required|in:0,1',
'tls_settings' => 'nullable|array', 'tls_settings' => 'nullable|array',
'flow' => 'nullable', 'flow' => 'nullable|in:xtls-rprx-vision',
'network' => 'required', 'network' => 'required',
'network_settings' => 'nullable|array', 'network_settings' => 'nullable|array',
'tags' => 'nullable|array', 'tags' => 'nullable|array',
@ -30,7 +30,7 @@ class VlessController extends Controller
'sort' => 'nullable' 'sort' => 'nullable'
]); ]);
if ((int)$params['tls_settings']['reality']) { if (isset($params['tls_settings']) && (int)$params['tls_settings']['reality']) {
$keyPair = SodiumCompat::crypto_box_keypair(); $keyPair = SodiumCompat::crypto_box_keypair();
if (!isset($params['tls_settings']['public_key'])) { if (!isset($params['tls_settings']['public_key'])) {
$params['tls_settings']['public_key'] = base64_encode(SodiumCompat::crypto_box_publickey($keyPair)); $params['tls_settings']['public_key'] = base64_encode(SodiumCompat::crypto_box_publickey($keyPair));

View File

@ -306,7 +306,7 @@ CREATE TABLE `v2_server_vless` (
`server_port` int(11) NOT NULL, `server_port` int(11) NOT NULL,
`tls` tinyint(1) NOT NULL, `tls` tinyint(1) NOT NULL,
`tls_settings` text, `tls_settings` text,
`flow` varchar(11) DEFAULT NULL, `flow` varchar(64) DEFAULT NULL,
`network` varchar(11) NOT NULL, `network` varchar(11) NOT NULL,
`network_settings` text, `network_settings` text,
`tags` text, `tags` text,

View File

@ -710,3 +710,6 @@ CREATE TABLE `v2_server_vless` (
`updated_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
ALTER TABLE `v2_server_vless`
CHANGE `flow` `flow` varchar(64) COLLATE 'utf8mb4_general_ci' NULL AFTER `tls_settings`;

File diff suppressed because one or more lines are too long