Compare commits

...

3 Commits

Author SHA1 Message Date
mercury a82147eeda update version 2024-08-26 23:23:09 +04:00
mercury 6bd21d06c0 fix list actions 2024-08-26 23:19:31 +04:00
mercury 3416cda826 qr for singbox 2024-08-25 23:30:19 +04:00
2 changed files with 36 additions and 14 deletions
+33 -14
View File
@@ -353,8 +353,8 @@ class Bot
case preg_match('~^/qrSS$~', $this->input['callback'], $m):
$this->qrSS();
break;
case preg_match('~^/qrXray (\d+)$~', $this->input['callback'], $m):
$this->qrXray($m[1]);
case preg_match('~^/qrXray (\d+)(?:_(\d+))?$~', $this->input['callback'], $m):
$this->qrXray($m[1], $m[2] ?: false);
break;
case preg_match('~^/qrMtproto$~', $this->input['callback'], $m):
$this->qrMtproto();
@@ -1604,9 +1604,9 @@ class Bot
}
}
public function qrXray($i)
public function qrXray($i, $s = false)
{
$link = $this->linkXray($i);
$link = $this->linkXray($i, $s);
$qr_file = __DIR__ . "/qr/xray.png";
exec("qrencode -t png -o $qr_file '$link'");
$r = $this->sendPhoto(
@@ -3458,11 +3458,11 @@ DNS-over-HTTPS with IP:
$data[] = [
[
'text' => $this->i18n($v ? 'on' : 'off') . ' ' . ($basename ? basename($k) . ' ' : '') . idn_to_utf8($k),
'callback_data' => "/change$type $i",
'callback_data' => "/change$type " . ($i + $page * $this->limit),
],
[
'text' => 'delete',
'callback_data' => "/delete$type $i",
'callback_data' => "/delete$type " . ($i + $page * $this->limit),
],
];
$i++;
@@ -3729,17 +3729,28 @@ DNS-over-HTTPS with IP:
}
}
public function geodb()
{
$this->answer($this->input['callback_id'], 'in developing...');
}
public function linkXray($i)
public function linkXray($i, $s = false)
{
$c = $this->getXray();
$pac = $this->getPacConf();
$domain = $pac['domain'] ?: $this->ip;
return "vless://{$c['inbounds'][0]['settings']['clients'][$i]['id']}@$domain:443?security=reality&sni={$c['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0]}&fp=chrome&pbk={$pac['xray']}&sid={$c['inbounds'][0]['streamSettings']['realitySettings']['shortIds'][0]}&type=tcp&flow=xtls-rprx-vision#{$c['inbounds'][0]['settings']['clients'][$i]['email']}";
$scheme = empty($this->nginxGetTypeCert()) ? 'http' : 'https';
$hash = substr(md5($this->key), 0, 8);
$si = "$scheme://{$domain}/pac/" . base64_encode(serialize([
'h' => $hash,
't' => 'si',
's' => $c['inbounds'][0]['settings']['clients'][$i]['id'],
]));
switch ($s) {
case 1:
return "$scheme://{$domain}/pac?h=$hash&t=s&s={$c['inbounds'][0]['settings']['clients'][$i]['id']}";
case 2:
return "sing-box://import-remote-profile/?url={$si}#{$c['inbounds'][0]['settings']['clients'][$i]['email']}";
default:
return "vless://{$c['inbounds'][0]['settings']['clients'][$i]['id']}@$domain:443?security=reality&sni={$c['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0]}&fp=chrome&pbk={$pac['xray']}&sid={$c['inbounds'][0]['streamSettings']['realitySettings']['shortIds'][0]}&type=tcp&flow=xtls-rprx-vision#{$c['inbounds'][0]['settings']['clients'][$i]['email']}";
}
}
public function dockerApi($url, $method = 'GET', $data = [])
@@ -4459,9 +4470,17 @@ DNS-over-HTTPS with IP:
];
$data[] = [
[
'text' => $this->i18n('show QR'),
'text' => $this->i18n('qr short'),
'callback_data' => "/qrXray $i",
],
[
'text' => $this->i18n('qr v2ray'),
'callback_data' => "/qrXray {$i}_1",
],
[
'text' => $this->i18n('qr singbox'),
'callback_data' => "/qrXray {$i}_2",
],
];
$data[] = [
[
+3
View File
@@ -1,3 +1,6 @@
26.08.2024 v1.44
- qr для xtls
- фикс действий на элементом списков
21.08.2024 v1.43
- singbox:поддержка кастомных outbound для ruleset
16.08.2024 v1.42.1