Compare commits

...

3 Commits

Author SHA1 Message Date
mercury 34eb950852 ip-cidr route 2025-01-24 22:09:05 +04:00
mercury 46021855a5 improve wg client menu 2025-01-23 00:55:44 +04:00
mercury 29c18ceb9d update readme 2025-01-20 01:04:24 +04:00
7 changed files with 107 additions and 19 deletions
+65 -17
View File
@@ -541,6 +541,9 @@ class Bot
case preg_match('~^/xtlsprocess(?: (\d+))?$~', $this->input['callback'], $m):
$this->xtlsprocess($m[1] ?: 0);
break;
case preg_match('~^/xtlssubnet(?: (\d+))?$~', $this->input['callback'], $m):
$this->xtlssubnet($m[1] ?: 0);
break;
case preg_match('~^/xtlsrulesset(?: (\d+))?$~', $this->input['callback'], $m):
$this->xtlsrulesset($m[1] ?: 0);
break;
@@ -2693,15 +2696,15 @@ DNS-over-HTTPS with IP:
$this->xtlswarp();
break;
case 'processlist':
$this->xrayUpdateRules();
$this->xtlsprocess();
break;
case 'packagelist':
$this->xrayUpdateRules();
$this->xtlsapp();
break;
case 'subnetlist':
$this->xtlssubnet();
break;
case 'rulessetlist':
$this->xrayUpdateRules();
$this->xtlsrulesset();
break;
case 'white':
@@ -3516,8 +3519,6 @@ DNS-over-HTTPS with IP:
'text' => $this->i18n('delete'),
'callback_data' => "/delete {$client}_$page",
],
],
[
[
'text' => $this->i18n('back'),
'callback_data' => "/menu wg $page",
@@ -3751,6 +3752,12 @@ DNS-over-HTTPS with IP:
case 'packagelist':
$dir = 'PACKAGE';
break;
case 'processlist':
$dir = 'PROCESS';
break;
case 'subnetlist':
$dir = 'SUBNET';
break;
case 'rulessetlist':
$dir = 'rulesset';
break;
@@ -3797,6 +3804,22 @@ DNS-over-HTTPS with IP:
],
];
break;
case 'processlist':
$data[] = [
[
'text' => $this->i18n('back'),
'callback_data' => "/xtlsprocess",
],
];
break;
case 'subnetlist':
$data[] = [
[
'text' => $this->i18n('back'),
'callback_data' => "/xtlssubnet",
],
];
break;
case 'rulessetlist':
$data[] = [
[
@@ -3944,7 +3967,25 @@ DNS-over-HTTPS with IP:
$text[] = "Menu -> " . $this->i18n('xray') . ' -> ' . $this->i18n('routes') . ' -> process list';
[$data] = $this->listPac('processlist', $page, 'xtlsprocess');
$p = $this->getPacConf();
$data[] = [
[
'text' => $this->i18n('back'),
'callback_data' => "/routes",
],
];
$this->update(
$this->input['chat'],
$this->input['message_id'],
implode("\n", $text ?: ['...']),
$data ?: false,
);
}
public function xtlssubnet($page = 0)
{
$text[] = "Menu -> " . $this->i18n('xray') . ' -> ' . $this->i18n('routes') . ' -> subnet';
[$data] = $this->listPac('subnetlist', $page, 'xtlssubnet');
$data[] = [
[
'text' => $this->i18n('back'),
@@ -4000,7 +4041,7 @@ DNS-over-HTTPS with IP:
}
$data[] = [
[
'text' => $this->i18n($v ? 'on' : 'off') . ' ' . ($basename ? basename($k) . ' ' : '') . (in_array($type, ['rulessetlist', 'packagelist', 'processlist']) ? $k : idn_to_utf8($k)),
'text' => $this->i18n($v ? 'on' : 'off') . ' ' . ($basename ? basename($k) . ' ' : '') . (in_array($type, ['rulessetlist', 'packagelist', 'processlist', 'subnetlist']) ? $k : idn_to_utf8($k)),
'callback_data' => "/change$type " . ($i + $page * $this->limit),
],
[
@@ -4200,12 +4241,6 @@ DNS-over-HTTPS with IP:
'main' => [
'text' => implode("\n", $main ?: []),
'data' => [
[
[
'text' => $this->i18n('config'),
'callback_data' => "/menu config",
],
],
[
[
'text' => $this->i18n($this->getPacConf()['amnezia'] ? 'amnezia' : 'wg_title'),
@@ -4256,10 +4291,16 @@ DNS-over-HTTPS with IP:
'callback_data' => "/pacMenu 0",
],
],
[
[
'text' => $this->i18n('config'),
'callback_data' => "/menu config",
],
],
[
[
'text' => $this->i18n('chat'),
'url' => "https://t.me/+Wfxg6-nrokBlMmYy",
'url' => base64_decode('aHR0cHM6Ly90Lm1lLytXZnhnNi1ucm9rQmxNbVl5'),
],
[
'text' => $this->i18n('donate'),
@@ -5694,9 +5735,6 @@ DNS-over-HTTPS with IP:
{
$text[] = "Menu -> " . $this->i18n('xray') . ' -> routes';
$p = $this->getPacConf();
$outbound = $p['outbound'] ?: 'proxy';
$data = [
[[
'text' => $this->i18n('block'),
@@ -5710,6 +5748,10 @@ DNS-over-HTTPS with IP:
'text' => 'domains',
'callback_data' => "/xtlsproxy",
]],
[[
'text' => "subnet",
'callback_data' => "/xtlssubnet",
]],
[[
'text' => 'process',
'callback_data' => "/xtlsprocess",
@@ -6228,6 +6270,7 @@ DNS-over-HTTPS with IP:
'"~warp~"' => json_encode(array_keys(array_filter($pac['warplist'] ?: []))),
'"~process~"' => json_encode(array_keys(array_filter($pac['processlist'] ?: []))),
'"~package~"' => json_encode(array_keys(array_filter($pac['packagelist'] ?: []))),
'"~subnet~"' => json_encode(array_keys(array_filter($pac['subnetlist'] ?: []))),
'~dns~' => "https://$domain/dns-query$hash/$uid",
'~uid~' => $uid,
'~domain~' => $domain,
@@ -6337,6 +6380,9 @@ DNS-over-HTTPS with IP:
case 'domain':
echo yaml_emit(['payload' => array_map(fn($e) => "+.$e", $v['list'])]);
break;
case 'ipcidr':
echo yaml_emit(['payload' => array_map(fn($e) => $e, $v['list'])]);
break;
default:
echo yaml_emit(['payload' => array_map(fn($e) => "PROCESS-NAME,$e", $v['list'])]);
@@ -6932,6 +6978,8 @@ DNS-over-HTTPS with IP:
'text' => $this->i18n('Ports'),
'callback_data' => "/ports",
],
];
$data[] = [
[
'text' => $this->i18n('IP ban & Logs'),
'callback_data' => "/ipMenu",
+1 -1
View File
@@ -30,7 +30,7 @@ $i = [
'ru' => 'PAC',
],
'chat' => [
'en' => 'discussion group',
'en' => 'chat',
'ru' => 'чат поддержки',
],
'back' => [
+8
View File
@@ -133,6 +133,14 @@
"behavior": "domain",
"name": "pac"
},
{
"type": "RULE-SET",
"list": "~subnet~",
"action": "PROXY",
"interval": 30,
"behavior": "ipcidr",
"name": "subnet"
},
{
"type": "MATCH",
"action": "DIRECT"
+15
View File
@@ -129,6 +129,21 @@
],
"outbound": "~outbound~"
},
{
"addruleset": true,
"createruleset": [
{
"name": "subnet",
"interval": "30s",
"rules": [
{
"ip_cidr": "~subnet~"
}
]
}
],
"outbound": "~outbound~"
},
{
"addruleset": true,
"createruleset": [
+5
View File
@@ -110,6 +110,11 @@
"outboundTag": "~outbound~",
"domain": "~pac~"
},
{
"type": "field",
"outboundTag": "~outbound~",
"ip": "~subnet~"
},
{
"type": "field",
"outboundTag": "~outbound~",
+10 -1
View File
@@ -13,8 +13,17 @@ telegram bot to manage servers (inside the bot)
---
environment: ubuntu 22.04/24.04, debian 11/12
### Install:
## Install:
```shell
wget -O- https://raw.githubusercontent.com/mercurykd/vpnbot/master/scripts/init.sh | sh -s YOUR_TELEGRAM_BOT_KEY master
```
#### Restart:
```shell
make r
```
#### autoload:
```shell
crontab -e
```
add `@reboot cd /root/vpnbot && make r` and save
+3
View File
@@ -1,3 +1,6 @@
24.01.2025 v2.6
- правки меню
- vless:добавлена возможность маршрутизировать список ip-сетей
18.01.2025 v2.5
- фикс скачивания шаблона михомо
- обновлен singbox.exe