Compare commits

...

4 Commits

Author SHA1 Message Date
mercury 54fa8d35b1 update version 2025-07-04 17:48:15 +04:00
mercury ffe6bb4ba8 subscription page 2025-07-04 17:45:50 +04:00
mercury 6be95533c4 improve vless menu 2025-07-04 16:42:47 +04:00
mercury 8d13bee021 improve /id 2025-07-04 16:38:39 +04:00
4 changed files with 57 additions and 3 deletions
+2
View File
@@ -26,3 +26,5 @@ docker-compose.override.yml
backup.json
app/webapp/override/
.rest
subscription.php
+47 -3
View File
@@ -244,8 +244,7 @@ class Bot
$this->addLinkDomain();
break;
case preg_match('~^/id$~', $this->input['message'], $m):
$this->send($this->input['chat'], $this->input['from'], $this->input['message_id']);
$this->send($this->input['chat'], $this->input['chat'], $this->input['message_id']);
$this->send($this->input['chat'], "your id: {$this->input['from']}\nchat id: {$this->input['chat']}", $this->input['message_id']);
break;
case preg_match('~^/adguardChBr$~', $this->input['callback'], $m):
$this->adguardChBr();
@@ -5885,9 +5884,10 @@ DNS-over-HTTPS with IP:
$st = $this->getXrayStats();
$td = $this->getBytes($st['global']['download'] + $st['session']['download']);
$tu = $this->getBytes($st['global']['upload'] + $st['session']['upload']);
$text[] = "$td$tu";
$data[] = [
[
'text' => $this->i18n('reset stats') . ": ↓$td$tu",
'text' => $this->i18n('reset stats'),
'callback_data' => '/resetXrStats',
],
[
@@ -6316,6 +6316,9 @@ DNS-over-HTTPS with IP:
$hash = $this->getHashBot();
$text[] = "Menu -> " . $this->i18n('xray') . " -> {$c['email']}\n";
if (file_exists(__DIR__ . '/subscription.php')) {
$text[] = "<a href='$scheme://{$domain}/pac$hash/sub?id={$c['id']}'>subscription</a>";
}
$text[] = "<pre><code>{$this->linkXray($i)}</code></pre>\n";
$text[] = "<a href='$scheme://{$domain}/pac$hash?t=s&r=v&s={$c['id']}#{$c['email']}'>import://v2rayng</a>";
@@ -6443,6 +6446,47 @@ DNS-over-HTTPS with IP:
return $c['domain'] ?: $this->ip;
}
public function sub()
{
$xr = $this->getXray();
$pac = $this->getPacConf();
$st = $this->getXrayStats();
$domain = $_GET['cdn'] ?: ($_SERVER['SERVER_NAME'] ?: $this->getDomain($pac['transport'] != 'Reality'));
$scheme = empty($this->nginxGetTypeCert()) ? 'http' : 'https';
$hash = $this->getHashBot();
$flag = true;
foreach ($xr['inbounds'][0]['settings']['clients'] as $k => $v) {
if ($v['id'] == $_GET['id']) {
if (empty($v['off'])) {
$flag = false;
}
$uid = $v['id'];
$email = $v['email'];
break;
}
}
$download = $this->getBytes($st['users'][$k]['global']['download'] + $st['users'][$k]['session']['download']);
$upload = $this->getBytes($st['users'][$k]['global']['upload'] + $st['users'][$k]['session']['upload']);
$singbox = "$scheme://{$domain}/pac$hash/" . base64_encode(serialize([
'h' => $hash,
't' => 'si',
's' => $uid,
]));
$xray = "$scheme://{$domain}/pac$hash/" . base64_encode(serialize([
'h' => $hash,
't' => 's',
's' => $uid,
]));
$clash = "$scheme://{$domain}/pac$hash/" . base64_encode(serialize([
'h' => $hash,
't' => 'cl',
's' => $uid,
]));
$vless = $this->linkXray($k);
$windows = "$scheme://{$domain}/pac$hash?t=si&r=w&s=$uid";
require __DIR__ . '/subscription.php';
}
public function subscription()
{
switch ($_GET['t']) {
+4
View File
@@ -42,6 +42,10 @@ switch (true) {
echo "/adguard$hash/";
break;
case preg_match('~^' . preg_quote("/pac$hash/sub") . '~', $_SERVER['REQUEST_URI']) && file_exists(__DIR__ . '/subscription.php'):
$bot->sub();
exit;
// subs & pac
case preg_match('~^' . preg_quote("/pac$hash") . '~', $_SERVER['REQUEST_URI']):
if (!empty($t = unserialize(base64_decode(explode('/', $_SERVER['REQUEST_URI'])[2])))) { // fix sing-box import
+4
View File
@@ -1,3 +1,7 @@
04.07.2025 v2.23
- фикс двойного /id
- фикс отображения статы vless на мобилке
- страница подписок app/subscription.php
18.06.2025 v2.22
- фикс определения айпи при запуске
11.06.2025 v2.21