mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-24 12:07:28 +08:00
feat: add Vless Encryption support
This commit is contained in:
@@ -71,6 +71,10 @@ class ServerSave extends FormRequest
|
|||||||
'network' => 'required|string',
|
'network' => 'required|string',
|
||||||
'network_settings' => 'nullable|array',
|
'network_settings' => 'nullable|array',
|
||||||
'flow' => 'nullable|string',
|
'flow' => 'nullable|string',
|
||||||
|
'encryption' => 'nullable|array',
|
||||||
|
'encryption.enabled' => 'nullable|boolean',
|
||||||
|
'encryption.encryption' => 'nullable|string',
|
||||||
|
'encryption.decryption' => 'nullable|string',
|
||||||
'tls_settings.server_name' => 'nullable|string',
|
'tls_settings.server_name' => 'nullable|string',
|
||||||
'tls_settings.allow_insecure' => 'nullable|boolean',
|
'tls_settings.allow_insecure' => 'nullable|boolean',
|
||||||
'reality_settings.allow_insecure' => 'nullable|boolean',
|
'reality_settings.allow_insecure' => 'nullable|boolean',
|
||||||
|
|||||||
@@ -203,6 +203,15 @@ class Server extends Model
|
|||||||
'tls' => ['type' => 'integer', 'default' => 0],
|
'tls' => ['type' => 'integer', 'default' => 0],
|
||||||
'tls_settings' => ['type' => 'array', 'default' => null],
|
'tls_settings' => ['type' => 'array', 'default' => null],
|
||||||
'flow' => ['type' => 'string', 'default' => null],
|
'flow' => ['type' => 'string', 'default' => null],
|
||||||
|
'encryption' => [
|
||||||
|
'type' => 'object',
|
||||||
|
'default' => null,
|
||||||
|
'fields' => [
|
||||||
|
'enabled' => ['type' => 'boolean', 'default' => false],
|
||||||
|
'encryption' => ['type' => 'string', 'default' => null], // 客户端公钥
|
||||||
|
'decryption' => ['type' => 'string', 'default' => null], // 服务端私钥
|
||||||
|
]
|
||||||
|
],
|
||||||
'network' => ['type' => 'string', 'default' => null],
|
'network' => ['type' => 'string', 'default' => null],
|
||||||
'network_settings' => ['type' => 'array', 'default' => null],
|
'network_settings' => ['type' => 'array', 'default' => null],
|
||||||
...self::REALITY_CONFIGURATION,
|
...self::REALITY_CONFIGURATION,
|
||||||
|
|||||||
@@ -332,6 +332,10 @@ class ClashMeta extends AbstractProtocol
|
|||||||
'cipher' => 'auto',
|
'cipher' => 'auto',
|
||||||
'udp' => true,
|
'udp' => true,
|
||||||
'flow' => data_get($protocol_settings, 'flow'),
|
'flow' => data_get($protocol_settings, 'flow'),
|
||||||
|
'encryption' => match (data_get($protocol_settings, 'encryption.enabled')) {
|
||||||
|
true => data_get($protocol_settings, 'encryption.encryption', 'none'),
|
||||||
|
default => 'none'
|
||||||
|
},
|
||||||
'tls' => false
|
'tls' => false
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -151,7 +151,10 @@ class General extends AbstractProtocol
|
|||||||
$config = [
|
$config = [
|
||||||
'mode' => 'multi', //grpc传输模式
|
'mode' => 'multi', //grpc传输模式
|
||||||
'security' => '', //传输层安全 tls/reality
|
'security' => '', //传输层安全 tls/reality
|
||||||
'encryption' => 'none', //加密方式
|
'encryption' => match (data_get($protocol_settings, 'encryption.enabled')) {
|
||||||
|
true => data_get($protocol_settings, 'encryption.encryption', 'none'),
|
||||||
|
default => 'none'
|
||||||
|
},
|
||||||
'type' => data_get($server, 'protocol_settings.network'), //传输协议
|
'type' => data_get($server, 'protocol_settings.network'), //传输协议
|
||||||
'flow' => data_get($protocol_settings, 'flow'),
|
'flow' => data_get($protocol_settings, 'flow'),
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -183,6 +183,7 @@ class ServerService
|
|||||||
...$baseConfig,
|
...$baseConfig,
|
||||||
'tls' => (int) $protocolSettings['tls'],
|
'tls' => (int) $protocolSettings['tls'],
|
||||||
'flow' => $protocolSettings['flow'],
|
'flow' => $protocolSettings['flow'],
|
||||||
|
'decryption' => data_get($protocolSettings, 'encryption.decryption'),
|
||||||
'tls_settings' => match ((int) $protocolSettings['tls']) {
|
'tls_settings' => match ((int) $protocolSettings['tls']) {
|
||||||
2 => $protocolSettings['reality_settings'],
|
2 => $protocolSettings['reality_settings'],
|
||||||
default => $protocolSettings['tls_settings'],
|
default => $protocolSettings['tls_settings'],
|
||||||
|
|||||||
+1
-1
Submodule public/assets/admin updated: 9b2d136d81...260390202f
Reference in New Issue
Block a user