Compare commits

..

8 Commits

Author SHA1 Message Date
mercury 24aaa8756c update version 2025-02-02 00:05:02 +04:00
mercury 07e2beff9b xray stats improve 2025-01-31 18:15:48 +04:00
mercury 86261e6b76 fix singbox template 2025-01-31 12:30:45 +04:00
Konstantin d816582e6f Merge pull request #34 from legiz-ru/dev
Migrate to sing-box 1.11
2025-01-30 19:04:30 +04:00
legiz-ru 6d1ab0cb3a Migrate to sing-box 1.11 2025-01-30 17:55:27 +03:00
legiz-ru 284b025881 update singbox 1.11 windows x64 2025-01-30 17:51:19 +03:00
mercury 0ca93b56a3 vless: ~email~ tag in subscription 2025-01-29 18:18:28 +04:00
mercury 7bcd8de007 vless: reset stats user 2025-01-29 11:04:06 +04:00
4 changed files with 47 additions and 19 deletions
+29 -2
View File
@@ -378,6 +378,9 @@ class Bot
case preg_match('~^/renameXrUser (\d+)$~', $this->input['callback'], $m):
$this->renameXrUser($m[1]);
break;
case preg_match('~^/resetXrUser (\d+)$~', $this->input['callback'], $m):
$this->resetXrUser($m[1]);
break;
case preg_match('~^/v2ray$~', $this->input['callback'], $m):
$this->v2ray();
break;
@@ -735,7 +738,9 @@ class Bot
public function collectSession($c) {
foreach ($c['inbounds'][0]['settings']['clients'] as $k => $v) {
$c['inbounds'][0]['settings']['clients'][$k]['global']['download'] += $v['session']['download'];
$c['inbounds'][0]['settings']['clients'][$k]['session']['download'] = 0;
$c['inbounds'][0]['settings']['clients'][$k]['global']['upload'] += $v['session']['upload'];
$c['inbounds'][0]['settings']['clients'][$k]['session']['upload'] = 0;
}
return $c;
}
@@ -5312,6 +5317,17 @@ DNS-over-HTTPS with IP:
$this->userXr($i);
}
public function resetXrUser($i)
{
$c = $this->getXray();
$c['inbounds'][0]['settings']['clients'][$i]['global'] = [
'download' => 0,
'upload' => 0,
];
$this->restartXray($c);
$this->userXr($i);
}
public function listXr($i)
{
$c = $this->getPacConf();
@@ -5478,6 +5494,7 @@ DNS-over-HTTPS with IP:
<code>~pac~</code>
<code>~package~</code>
<code>~process~</code>
<code>~subnet~</code>
<code>~block~</code>
<code>~warp~</code>
<code>~dns~</code>
@@ -5486,6 +5503,7 @@ DNS-over-HTTPS with IP:
<code>~directdomain~</code>
<code>~cdndomain~</code>
<code>~short_id~</code>
<code>~email~</code>
<code>~public_key~</code>
<code>~server_name~</code>
<code>~ip~</code>
@@ -6030,6 +6048,14 @@ DNS-over-HTTPS with IP:
'callback_data' => "/qrXray {$i}_2",
],
];
$download = $this->getBytes($c['global']['download'] + $c['session']['download']);
$upload = $this->getBytes($c['global']['upload'] + $c['session']['upload']);
$data[] = [
[
'text' => $this->i18n('reset stats') . ": ↓$download$upload",
'callback_data' => "/resetXrUser $i",
],
];
$data[] = [
[
'text' => $this->i18n('rename'),
@@ -6277,6 +6303,7 @@ DNS-over-HTTPS with IP:
'~directdomain~' => $pac['domain'],
'~cdndomain~' => $pac['linkdomain'],
'~short_id~' => $xr['inbounds'][0]['streamSettings']['realitySettings']['shortIds'][0],
'~email~' => $email,
'~public_key~' => $pac['xray'],
'~server_name~' => $xr['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0],
'~ip~' => $this->ip,
@@ -6297,11 +6324,11 @@ DNS-over-HTTPS with IP:
$c['route'] = $this->addRuleSet($c['route']);
$c['route'] = $this->createRuleSet($c['route'], $uid, $domain);
if (!empty($c['route']['rules'])) {
foreach ($c['route']['rules'] as $k => $v) {
/* foreach ($c['route']['rules'] as $k => $v) {
if (count($v) < 2) {
unset($c['route']['rules'][$k]);
}
}
} */
$c['route']['rules'] = array_values($c['route']['rules']);
}
break;
+13 -17
View File
@@ -9,9 +9,10 @@
"tag": "tun-in",
"domain_strategy": "prefer_ipv4",
"interface_name": "sing-tun",
"address": ["172.19.0.1\/30"],
"address": [
"172.19.0.1/30"
],
"mtu": 1400,
"gso": true,
"auto_route": true,
"strict_route": true,
"sniff": true,
@@ -48,7 +49,7 @@
},
{
"tag": "dns-remote",
"address": "tcp:\/\/8.8.8.8",
"address": "tcp://8.8.8.8",
"address_strategy": "prefer_ipv4",
"strategy": "prefer_ipv4",
"detour": "direct"
@@ -92,28 +93,23 @@
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
}
],
"route": {
"auto_detect_interface": true,
"override_android_vpn": true,
"rules": [
{
"protocol": "dns",
"outbound": "dns-out"
},
{
"addruleset": true,
"outbound": "direct"
},
{
"action": "sniff"
},
{
"protocol": "dns",
"action": "hijack-dns"
},
{
"addruleset": true,
"createruleset": [
@@ -187,7 +183,7 @@
]
}
],
"outbound": "block"
"action": "reject"
},
{
"addruleset": true,
@@ -207,4 +203,4 @@
],
"final": "direct"
}
}
}
Binary file not shown.
+5
View File
@@ -1,3 +1,8 @@
02.02.2025 v2.8
- vless: корректировка статы юзера
- sing-box 1.11
29.01.2025 v2.7
- vless: сброс статистики юзера
24.01.2025 v2.6
- правки меню
- vless:добавлена возможность маршрутизировать список ip-сетей