From 2ed3dfb6dd4bdac324a62431ac14a8c61094b21f Mon Sep 17 00:00:00 2001 From: mercury Date: Wed, 24 Apr 2024 12:32:19 +0400 Subject: [PATCH] fix links --- app/bot.php | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/app/bot.php b/app/bot.php index a011114..ba376e3 100644 --- a/app/bot.php +++ b/app/bot.php @@ -3344,7 +3344,7 @@ DNS-over-HTTPS with IP: $c = $this->getXray(); $pac = $this->getPacConf(); $domain = $pac['domain'] ?: $this->ip; - return "vless://{$c['inbounds'][0]['users'][$i]['id']}@$domain:443?security=reality&sni={$c['inbounds'][0]['tls']['reality']['handshake']['server']}&fp=chrome&pbk={$pac['xray']}&sid={$c['inbounds'][0]['tls']['reality']['short_id'][0]}&type=tcp&flow=xtls-rprx-vision#vpnbot"; + return "vless://{$c['inbounds'][0]['users'][$i]['uuid']}@$domain:443?security=reality&sni={$c['inbounds'][0]['tls']['reality']['handshake']['server']}&fp=chrome&pbk={$pac['xray']}&sid={$c['inbounds'][0]['tls']['reality']['short_id'][0]}&type=tcp&flow=xtls-rprx-vision#vpnbot"; } public function dockerApi($url, $method = 'GET', $data = []) @@ -3580,9 +3580,9 @@ DNS-over-HTTPS with IP: $c = $this->getXray(); $uuid = trim($this->ssh('sing-box generate uuid', 'si')); $c['inbounds'][0]['users'][] = [ - 'id' => $uuid, - 'flow' => 'xtls-rprx-vision', - 'email' => $user, + 'uuid' => $uuid, + 'flow' => 'xtls-rprx-vision', + 'name' => $user, ]; $this->restartXray($c); $this->userXr(count($c['inbounds'][0]['users']) - 1); @@ -3614,10 +3614,10 @@ DNS-over-HTTPS with IP: $c = $this->getXray(); unset($c['inbounds'][0]['users'][$i]['time']); if (empty($c['inbounds'][0]['users'][$i]['off'])) { - $c['inbounds'][0]['users'][$i]['off'] = $c['inbounds'][0]['users'][$i]['id']; - $c['inbounds'][0]['users'][$i]['id'] = trim($this->ssh('sing-box generate uuid', 'si')); + $c['inbounds'][0]['users'][$i]['off'] = $c['inbounds'][0]['users'][$i]['uuid']; + $c['inbounds'][0]['users'][$i]['uuid'] = trim($this->ssh('sing-box generate uuid', 'si')); } else { - $c['inbounds'][0]['users'][$i]['id'] = $c['inbounds'][0]['users'][$i]['off']; + $c['inbounds'][0]['users'][$i]['uuid'] = $c['inbounds'][0]['users'][$i]['off']; unset($c['inbounds'][0]['users'][$i]['off']); } $this->restartXray($c); @@ -3800,8 +3800,6 @@ DNS-over-HTTPS with IP: 'callback_data' => "/xtlswarp", ], ]; - $data[] = [ - ]; foreach ($c['inbounds'][0]['users'] as $k => $v) { if (!empty($v['off'])) { $off++; @@ -3821,7 +3819,7 @@ DNS-over-HTTPS with IP: $time = $v['time'] ? $this->getTime($v['time']) : ''; $data[] = [ [ - 'text' => "{$v['email']}" . ($time ? ": $time" : ''), + 'text' => "{$v['name']}" . ($time ? ": $time" : ''), 'callback_data' => "/userXr $k", ], ]; @@ -3986,27 +3984,27 @@ DNS-over-HTTPS with IP: $scheme = empty($this->nginxGetTypeCert()) ? 'http' : 'https'; $hash = substr(md5($this->key), 0, 8); - $text[] = "Menu -> " . $this->i18n('xray') . " -> {$c['email']}\n"; + $text[] = "Menu -> " . $this->i18n('xray') . " -> {$c['name']}\n"; $text[] = "{$this->linkXray($i)}\n"; $text[] = "import subscribe:"; - $text[] = "v2rayng"; - $text[] = "sing-box"; - $text[] = "streisand"; - $text[] = "hiddify"; + $text[] = "v2rayng"; + $text[] = "sing-box"; + $text[] = "streisand"; + $text[] = "hiddify"; - $text[] = "\nv2ray config: $scheme://{$domain}/pac?h=$hash&t=s&s={$c['id']}"; - $text[] = "sing-box config: $scheme://{$domain}/pac?h=$hash&t=si&s={$c['id']}"; - $text[] = "sing-box windows: windows service"; + $text[] = "\nv2ray config: $scheme://{$domain}/pac?h=$hash&t=s&s={$c['uuid']}"; + $text[] = "sing-box config: $scheme://{$domain}/pac?h=$hash&t=si&s={$c['uuid']}"; + $text[] = "sing-box windows: windows service"; $data[] = [ [ 'text' => 'v2ray', - 'web_app' => ['url' => "https://{$domain}/pac?h=$hash&t=s&s={$c['id']}"], + 'web_app' => ['url' => "https://{$domain}/pac?h=$hash&t=s&s={$c['uuid']}"], ], [ 'text' => 'sing-box', - 'web_app' => ['url' => "https://{$domain}/pac?h=$hash&t=si&s={$c['id']}"], + 'web_app' => ['url' => "https://{$domain}/pac?h=$hash&t=si&s={$c['uuid']}"], ], ]; $data[] = [ @@ -4069,7 +4067,7 @@ DNS-over-HTTPS with IP: $flag = true; foreach ($xr['inbounds'][0]['users'] as $k => $v) { - if ($v['id'] == $key) { + if ($v['uuid'] == $key) { if (!empty($fs)) { return $this->userXr($k); } @@ -4110,12 +4108,12 @@ DNS-over-HTTPS with IP: $flag = true; foreach ($xr['inbounds'][0]['users'] as $k => $v) { - if ($v['id'] == $_GET['s']) { + if ($v['uuid'] == $_GET['s']) { if (empty($v['off'])) { $flag = false; } $template = base64_decode($_GET['t'] == 's' ? $v['v2raytemplate'] : $v['singtemplate']); - $uid = $v['id']; + $uid = $v['uuid']; break; } }