mirror of
				https://github.com/v2board/v2board.git
				synced 2025-11-04 19:31:45 +08:00 
			
		
		
		
	修改shortId为short_id以适配V2bX
This commit is contained in:
		@@ -40,8 +40,11 @@ class VlessController extends Controller
 | 
			
		||||
            if (!isset($params['tls_settings']['private_key'])) {
 | 
			
		||||
                $params['tls_settings']['private_key'] = Helper::base64EncodeUrlSafe(SodiumCompat::crypto_box_secretkey($keyPair));
 | 
			
		||||
            }
 | 
			
		||||
            if (!isset($params['tls_settings']['shortId'])) {
 | 
			
		||||
                $params['tls_settings']['shortId'] = substr(sha1($params['tls_settings']['private_key']), 0, 8);
 | 
			
		||||
            if (!isset($params['tls_settings']['short_id'])) {
 | 
			
		||||
                $params['tls_settings']['short_id'] = substr(sha1($params['tls_settings']['private_key']), 0, 8);
 | 
			
		||||
            }
 | 
			
		||||
            if (!isset($params['tls_settings']['server_port'])) {
 | 
			
		||||
                $params['tls_settings']['server_port'] = "443";
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -180,7 +180,7 @@ class Clash
 | 
			
		||||
                if ($server['tls'] == 2) {
 | 
			
		||||
                   $array['reality-opts'] = [];
 | 
			
		||||
                   $array['reality-opts']['public-key'] = $tlsSettings['public_key'];
 | 
			
		||||
                   $array['reality-opts']['short-id'] = $tlsSettings['shortId'];
 | 
			
		||||
                   $array['reality-opts']['short-id'] = $tlsSettings['short_id'];
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -185,7 +185,7 @@ class ClashMeta
 | 
			
		||||
                if ($server['tls'] == 2) {
 | 
			
		||||
                   $array['reality-opts'] = [];
 | 
			
		||||
                   $array['reality-opts']['public-key'] = $tlsSettings['public_key'];
 | 
			
		||||
                   $array['reality-opts']['short-id'] = $tlsSettings['shortId'];
 | 
			
		||||
                   $array['reality-opts']['short-id'] = $tlsSettings['short_id'];
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -185,7 +185,7 @@ class ClashVerge
 | 
			
		||||
                if ($server['tls'] == 2) {
 | 
			
		||||
                   $array['reality-opts'] = [];
 | 
			
		||||
                   $array['reality-opts']['public-key'] = $tlsSettings['public_key'];
 | 
			
		||||
                   $array['reality-opts']['short-id'] = $tlsSettings['shortId'];
 | 
			
		||||
                   $array['reality-opts']['short-id'] = $tlsSettings['short_id'];
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -120,10 +120,10 @@ class General
 | 
			
		||||
            "pbk" => "",
 | 
			
		||||
            "sid" =>"",
 | 
			
		||||
        ];
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        $output = "vless://" . $uuid . "@" . $config['add'] . ":" . $config['port'];
 | 
			
		||||
        $output .= "?" . "type={$config['type']}" . "&encryption={$config['encryption']}" . "&security={$config['security']}";
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        if ($server['tls']) {
 | 
			
		||||
            if ($config['flow'] !="") $output .= "&flow={$config['flow']}";
 | 
			
		||||
            if ($server['tls_settings']) {
 | 
			
		||||
@@ -132,7 +132,7 @@ class General
 | 
			
		||||
                $output .= "&sni={$config['sni']}";
 | 
			
		||||
                if ($server['tls'] == 2) {
 | 
			
		||||
                    $config['pbk'] = $tlsSettings['public_key'];
 | 
			
		||||
                    $config['sid'] = $tlsSettings['shortId'];
 | 
			
		||||
                    $config['sid'] = $tlsSettings['short_id'];
 | 
			
		||||
                    $output .= "&pbk={$config['pbk']}" . "&sid={$config['sid']}";
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
@@ -109,10 +109,10 @@ class Passwall
 | 
			
		||||
            "pbk" => "",
 | 
			
		||||
            "sid" =>"",
 | 
			
		||||
        ];
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        $output = "vless://" . $uuid . "@" . $config['add'] . ":" . $config['port'];
 | 
			
		||||
        $output .= "?" . "type={$config['type']}" . "&encryption={$config['encryption']}" . "&security={$config['security']}";
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        if ($server['tls']) {
 | 
			
		||||
            if ($config['flow'] !="") $output .= "&flow={$config['flow']}";
 | 
			
		||||
            if ($server['tls_settings']) {
 | 
			
		||||
@@ -121,7 +121,7 @@ class Passwall
 | 
			
		||||
                $output .= "&sni={$config['sni']}";
 | 
			
		||||
                if ($server['tls'] == 2) {
 | 
			
		||||
                    $config['pbk'] = $tlsSettings['public_key'];
 | 
			
		||||
                    $config['sid'] = $tlsSettings['shortId'];
 | 
			
		||||
                    $config['sid'] = $tlsSettings['short_id'];
 | 
			
		||||
                    $output .= "&pbk={$config['pbk']}" . "&sid={$config['sid']}";
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
@@ -136,7 +136,7 @@ class Passwall
 | 
			
		||||
            if (isset($kcpSettings['header']['type'])) $config['headerType'] = $kcpSettings['header']['type'];
 | 
			
		||||
            if (isset($kcpSettings['seed'])) $config['path'] = Helper::encodeURIComponent($kcpSettings['seed']);
 | 
			
		||||
            $output .= "&headerType={$config['headerType']}" . "&seed={$config['path']}";
 | 
			
		||||
        }        
 | 
			
		||||
        }
 | 
			
		||||
        if ((string)$server['network'] === 'ws') {
 | 
			
		||||
            $wsSettings = $server['network_settings'];
 | 
			
		||||
            if (isset($wsSettings['path'])) $config['path'] = Helper::encodeURIComponent($wsSettings['path']);
 | 
			
		||||
@@ -153,11 +153,11 @@ class Passwall
 | 
			
		||||
            $quicSettings = $server['network_settings'];
 | 
			
		||||
            if (isset($quicSettings['security'])) $config['quicSecurity'] = $quicSettings['security'];
 | 
			
		||||
            if (isset($quicSettings['header']['type'])) $config['headerType'] = $quicSettings['header']['type'];
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            $output .= "&quicSecurity={$config['quicSecurity']}" . "&headerType={$config['headerType']}";
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            if ((string)$quicSettings['security'] !== 'none' && isset($quicSettings['key'])) $config['path'] = Helper::encodeURIComponent($quicSettings['key']);
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            $output .= "&key={$config['path']}";
 | 
			
		||||
        }
 | 
			
		||||
        if ((string)$server['network'] === 'grpc') {
 | 
			
		||||
 
 | 
			
		||||
@@ -103,10 +103,10 @@ class SSRPlus
 | 
			
		||||
            "pbk" => "",
 | 
			
		||||
            "sid" =>"",
 | 
			
		||||
        ];
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        $output = "vless://" . $uuid . "@" . $config['add'] . ":" . $config['port'];
 | 
			
		||||
        $output .= "?" . "type={$config['type']}" . "&encryption={$config['encryption']}" . "&security={$config['security']}";
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        if ($server['tls']) {
 | 
			
		||||
            if ($config['flow'] !="") $output .= "&flow={$config['flow']}";
 | 
			
		||||
            if ($server['tls_settings']) {
 | 
			
		||||
@@ -115,7 +115,7 @@ class SSRPlus
 | 
			
		||||
                $output .= "&sni={$config['sni']}";
 | 
			
		||||
                if ($server['tls'] == 2) {
 | 
			
		||||
                    $config['pbk'] = $tlsSettings['public_key'];
 | 
			
		||||
                    $config['sid'] = $tlsSettings['shortId'];
 | 
			
		||||
                    $config['sid'] = $tlsSettings['short_id'];
 | 
			
		||||
                    $output .= "&pbk={$config['pbk']}" . "&sid={$config['sid']}";
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
@@ -115,10 +115,10 @@ class SagerNet
 | 
			
		||||
            "pbk" => "",
 | 
			
		||||
            "sid" =>"",
 | 
			
		||||
        ];
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        $output = "vless://" . $uuid . "@" . $config['add'] . ":" . $config['port'];
 | 
			
		||||
        $output .= "?" . "type={$config['type']}" . "&encryption={$config['encryption']}" . "&security={$config['security']}";
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        if ($server['tls']) {
 | 
			
		||||
            if ($config['flow'] !="") $output .= "&flow={$config['flow']}";
 | 
			
		||||
            if ($server['tls_settings']) {
 | 
			
		||||
@@ -127,7 +127,7 @@ class SagerNet
 | 
			
		||||
                $output .= "&sni={$config['sni']}";
 | 
			
		||||
                if ($server['tls'] == 2) {
 | 
			
		||||
                    $config['pbk'] = $tlsSettings['public_key'];
 | 
			
		||||
                    $config['sid'] = $tlsSettings['shortId'];
 | 
			
		||||
                    $config['sid'] = $tlsSettings['short_id'];
 | 
			
		||||
                    $output .= "&pbk={$config['pbk']}" . "&sid={$config['sid']}";
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
@@ -142,7 +142,7 @@ class SagerNet
 | 
			
		||||
            if (isset($kcpSettings['header']['type'])) $config['headerType'] = $kcpSettings['header']['type'];
 | 
			
		||||
            if (isset($kcpSettings['seed'])) $config['path'] = Helper::encodeURIComponent($kcpSettings['seed']);
 | 
			
		||||
            $output .= "&headerType={$config['headerType']}" . "&seed={$config['path']}";
 | 
			
		||||
        }        
 | 
			
		||||
        }
 | 
			
		||||
        if ((string)$server['network'] === 'ws') {
 | 
			
		||||
            $wsSettings = $server['network_settings'];
 | 
			
		||||
            if (isset($wsSettings['path'])) $config['path'] = Helper::encodeURIComponent($wsSettings['path']);
 | 
			
		||||
@@ -159,11 +159,11 @@ class SagerNet
 | 
			
		||||
            $quicSettings = $server['network_settings'];
 | 
			
		||||
            if (isset($quicSettings['security'])) $config['quicSecurity'] = $quicSettings['security'];
 | 
			
		||||
            if (isset($quicSettings['header']['type'])) $config['headerType'] = $quicSettings['header']['type'];
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            $output .= "&quicSecurity={$config['quicSecurity']}" . "&headerType={$config['headerType']}";
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            if ((string)$quicSettings['security'] !== 'none' && isset($quicSettings['key'])) $config['path'] = Helper::encodeURIComponent($quicSettings['key']);
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            $output .= "&key={$config['path']}";
 | 
			
		||||
        }
 | 
			
		||||
        if ((string)$server['network'] === 'grpc') {
 | 
			
		||||
 
 | 
			
		||||
@@ -143,10 +143,10 @@ class Shadowrocket
 | 
			
		||||
            "pbk" => "",
 | 
			
		||||
            "sid" =>"",
 | 
			
		||||
        ];
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        $output = "vless://" . $uuid . "@" . $config['add'] . ":" . $config['port'];
 | 
			
		||||
        $output .= "?" . "type={$config['type']}" . "&encryption={$config['encryption']}" . "&security={$config['security']}";
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        if ($server['tls']) {
 | 
			
		||||
            if ($config['flow'] !="") $output .= "&flow={$config['flow']}";
 | 
			
		||||
            if ($server['tls_settings']) {
 | 
			
		||||
@@ -155,7 +155,7 @@ class Shadowrocket
 | 
			
		||||
                $output .= "&sni={$config['sni']}";
 | 
			
		||||
                if ($server['tls'] == 2) {
 | 
			
		||||
                    $config['pbk'] = $tlsSettings['public_key'];
 | 
			
		||||
                    $config['sid'] = $tlsSettings['shortId'];
 | 
			
		||||
                    $config['sid'] = $tlsSettings['short_id'];
 | 
			
		||||
                    $output .= "&pbk={$config['pbk']}" . "&sid={$config['sid']}";
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
@@ -170,7 +170,7 @@ class Shadowrocket
 | 
			
		||||
            if (isset($kcpSettings['header']['type'])) $config['headerType'] = $kcpSettings['header']['type'];
 | 
			
		||||
            if (isset($kcpSettings['seed'])) $config['path'] = Helper::encodeURIComponent($kcpSettings['seed']);
 | 
			
		||||
            $output .= "&headerType={$config['headerType']}" . "&seed={$config['path']}";
 | 
			
		||||
        }        
 | 
			
		||||
        }
 | 
			
		||||
        if ((string)$server['network'] === 'ws') {
 | 
			
		||||
            $wsSettings = $server['network_settings'];
 | 
			
		||||
            if (isset($wsSettings['path'])) $config['path'] = Helper::encodeURIComponent($wsSettings['path']);
 | 
			
		||||
@@ -187,11 +187,11 @@ class Shadowrocket
 | 
			
		||||
            $quicSettings = $server['network_settings'];
 | 
			
		||||
            if (isset($quicSettings['security'])) $config['quicSecurity'] = $quicSettings['security'];
 | 
			
		||||
            if (isset($quicSettings['header']['type'])) $config['headerType'] = $quicSettings['header']['type'];
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            $output .= "&quicSecurity={$config['quicSecurity']}" . "&headerType={$config['headerType']}";
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            if ((string)$quicSettings['security'] !== 'none' && isset($quicSettings['key'])) $config['path'] = Helper::encodeURIComponent($quicSettings['key']);
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            $output .= "&key={$config['path']}";
 | 
			
		||||
        }
 | 
			
		||||
        if ((string)$server['network'] === 'grpc') {
 | 
			
		||||
 
 | 
			
		||||
@@ -184,7 +184,7 @@ class Stash
 | 
			
		||||
                if ($server['tls'] == 2) {
 | 
			
		||||
                   $array['reality-opts'] = [];
 | 
			
		||||
                   $array['reality-opts']['public-key'] = $tlsSettings['public_key'];
 | 
			
		||||
                   $array['reality-opts']['short-id'] = $tlsSettings['shortId'];
 | 
			
		||||
                   $array['reality-opts']['short-id'] = $tlsSettings['short_id'];
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -120,10 +120,10 @@ class V2rayN
 | 
			
		||||
            "pbk" => "",
 | 
			
		||||
            "sid" =>"",
 | 
			
		||||
        ];
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        $output = "vless://" . $uuid . "@" . $config['add'] . ":" . $config['port'];
 | 
			
		||||
        $output .= "?" . "type={$config['type']}" . "&encryption={$config['encryption']}" . "&security={$config['security']}";
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        if ($server['tls']) {
 | 
			
		||||
            if ($config['flow'] !="") $output .= "&flow={$config['flow']}";
 | 
			
		||||
            if ($server['tls_settings']) {
 | 
			
		||||
@@ -132,7 +132,7 @@ class V2rayN
 | 
			
		||||
                $output .= "&sni={$config['sni']}";
 | 
			
		||||
                if ($server['tls'] == 2) {
 | 
			
		||||
                    $config['pbk'] = $tlsSettings['public_key'];
 | 
			
		||||
                    $config['sid'] = $tlsSettings['shortId'];
 | 
			
		||||
                    $config['sid'] = $tlsSettings['short_id'];
 | 
			
		||||
                    $output .= "&pbk={$config['pbk']}" . "&sid={$config['sid']}";
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
@@ -109,10 +109,10 @@ class V2rayNG
 | 
			
		||||
            "pbk" => "",
 | 
			
		||||
            "sid" =>"",
 | 
			
		||||
        ];
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        $output = "vless://" . $uuid . "@" . $config['add'] . ":" . $config['port'];
 | 
			
		||||
        $output .= "?" . "type={$config['type']}" . "&encryption={$config['encryption']}" . "&security={$config['security']}";
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        if ($server['tls']) {
 | 
			
		||||
            if ($config['flow'] !="") $output .= "&flow={$config['flow']}";
 | 
			
		||||
            if ($server['tls_settings']) {
 | 
			
		||||
@@ -121,7 +121,7 @@ class V2rayNG
 | 
			
		||||
                $output .= "&sni={$config['sni']}";
 | 
			
		||||
                if ($server['tls'] == 2) {
 | 
			
		||||
                    $config['pbk'] = $tlsSettings['public_key'];
 | 
			
		||||
                    $config['sid'] = $tlsSettings['shortId'];
 | 
			
		||||
                    $config['sid'] = $tlsSettings['short_id'];
 | 
			
		||||
                    $output .= "&pbk={$config['pbk']}" . "&sid={$config['sid']}";
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
@@ -136,7 +136,7 @@ class V2rayNG
 | 
			
		||||
            if (isset($kcpSettings['header']['type'])) $config['headerType'] = $kcpSettings['header']['type'];
 | 
			
		||||
            if (isset($kcpSettings['seed'])) $config['path'] = Helper::encodeURIComponent($kcpSettings['seed']);
 | 
			
		||||
            $output .= "&headerType={$config['headerType']}" . "&seed={$config['path']}";
 | 
			
		||||
        }        
 | 
			
		||||
        }
 | 
			
		||||
        if ((string)$server['network'] === 'ws') {
 | 
			
		||||
            $wsSettings = $server['network_settings'];
 | 
			
		||||
            if (isset($wsSettings['path'])) $config['path'] = Helper::encodeURIComponent($wsSettings['path']);
 | 
			
		||||
@@ -153,11 +153,11 @@ class V2rayNG
 | 
			
		||||
            $quicSettings = $server['network_settings'];
 | 
			
		||||
            if (isset($quicSettings['security'])) $config['quicSecurity'] = $quicSettings['security'];
 | 
			
		||||
            if (isset($quicSettings['header']['type'])) $config['headerType'] = $quicSettings['header']['type'];
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            $output .= "&quicSecurity={$config['quicSecurity']}" . "&headerType={$config['headerType']}";
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            if ((string)$quicSettings['security'] !== 'none' && isset($quicSettings['key'])) $config['path'] = Helper::encodeURIComponent($quicSettings['key']);
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            $output .= "&key={$config['path']}";
 | 
			
		||||
        }
 | 
			
		||||
        if ((string)$server['network'] === 'grpc') {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										11
									
								
								public/assets/admin/umi.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								public/assets/admin/umi.js
									
									
									
									
										vendored
									
									
								
							@@ -102231,7 +102231,8 @@
 | 
			
		||||
                  , n = e.allow_insecure
 | 
			
		||||
                  , pv = e.private_key
 | 
			
		||||
                  , pb = e.public_key
 | 
			
		||||
                  , sd = e.shortId;
 | 
			
		||||
                  , sd = e.short_id
 | 
			
		||||
                  , pt = e.server_port;
 | 
			
		||||
                return y.a.createElement(y.a.Fragment, null, y.a.createElement("div", null, y.a.createElement("div", {
 | 
			
		||||
                    className: "form-group"
 | 
			
		||||
                }, y.a.createElement("label", null, "Server Name"), y.a.createElement(s["a"], {
 | 
			
		||||
@@ -102240,6 +102241,12 @@
 | 
			
		||||
                    placeholder: "REALITY\u5fc5\u586b\uff0c\u4e0e\u540e\u7aef\u4fdd\u6301\u4e00\u81f4"
 | 
			
		||||
                })), y.a.createElement("div", {
 | 
			
		||||
                    className: "form-group"
 | 
			
		||||
                }, y.a.createElement("label", null, "Server Port"), y.a.createElement(s["a"], {
 | 
			
		||||
                    value: pt,
 | 
			
		||||
                    onChange: e=>this.change("server_port", e.target.value),
 | 
			
		||||
                    placeholder: "REALITY\u76ee\u6807\u7aef\u53e3,\u9ed8\u8ba4443"
 | 
			
		||||
                })), y.a.createElement("div", {
 | 
			
		||||
                    className: "form-group"
 | 
			
		||||
                }, y.a.createElement("label", null, "Private Key"), y.a.createElement(s["a"], {
 | 
			
		||||
                    value: pv,
 | 
			
		||||
                    onChange: e=>this.change("private_key", e.target.value),
 | 
			
		||||
@@ -102254,7 +102261,7 @@
 | 
			
		||||
                    className: "form-group"
 | 
			
		||||
                }, y.a.createElement("label", null, "ShortId"), y.a.createElement(s["a"], {
 | 
			
		||||
                    value: sd,
 | 
			
		||||
                    onChange: e=>this.change("shortId", e.target.value),
 | 
			
		||||
                    onChange: e=>this.change("short_id", e.target.value),
 | 
			
		||||
                    placeholder: "\u7559\u7a7a\u81ea\u52a8\u751f\u6210"
 | 
			
		||||
                })), y.a.createElement("div", {
 | 
			
		||||
                    className: "form-group"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user