Compare commits

...

6 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
mercury db6a18f498 update version 2025-06-18 00:56:49 +04:00
mercury 6954a16fa2 get ip from host 2025-06-18 00:47:48 +04:00
6 changed files with 61 additions and 5 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
+1 -1
View File
@@ -1,7 +1,7 @@
b:
docker compose build
u: # запуск контейнеров
$(eval IP := $(shell curl -s -t 1 2ip.io || curl -s -t 1 ipinfo.io/ip || curl -s -t 1 ifconfig.me))
$(eval IP := $(shell hostname -I | awk '{print $$1}'))
bash ./update/update.sh &
touch ./override.env ./docker-compose.override.yml
IP=$(IP) VER=$(shell git describe --tags) docker compose --env-file ./.env --env-file ./override.env up -d --force-recreate
+1 -1
View File
@@ -38,7 +38,7 @@ do
curl -H "Content-Type: application/json" -X POST https://api.telegram.org/bot$key/editMessageText -d "$(cat $pwd/update/curl | sed 's/"text":"~t~"/"text": "launching the bot"/')"
> $pwd/update/key
> $pwd/update/curl
IP=$(curl -s -t 1 2ip.io || curl -s -t 1 ipinfo.io/ip || curl -s -t 1 ifconfig.me) VER=$(git describe --tags) docker compose --env-file ./.env --env-file ./override.env up -d --force-recreate
IP=$(hostname -I | awk '{print $1}') VER=$(git describe --tags) docker compose --env-file ./.env --env-file ./override.env up -d --force-recreate
bash $pwd/update/update.sh &
exit 0
fi
+6
View File
@@ -1,3 +1,9 @@
04.07.2025 v2.23
- фикс двойного /id
- фикс отображения статы vless на мобилке
- страница подписок app/subscription.php
18.06.2025 v2.22
- фикс определения айпи при запуске
11.06.2025 v2.21
- пагинация в списках
20.05.2025 v2.20