Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6074d40643 | |||
| 4b1df94325 | |||
| 232c75d5bf | |||
| 5e860a4896 | |||
| 5b05486b98 | |||
| fb22744fa7 | |||
| af812b7c93 | |||
| 3302ca8871 | |||
| 2c5eff03d5 | |||
| a8a203041f |
+27
-17
@@ -755,11 +755,11 @@ class Bot
|
|||||||
'download' => 0,
|
'download' => 0,
|
||||||
'upload' => 0,
|
'upload' => 0,
|
||||||
];
|
];
|
||||||
foreach ($p['clients'] as $k => $v) {
|
foreach ($p['users'] as $k => $v) {
|
||||||
$p['clients'][$k]['global']['download'] += $v['session']['download'];
|
$p['users'][$k]['global']['download'] += $v['session']['download'];
|
||||||
$p['clients'][$k]['session']['download'] = 0;
|
$p['users'][$k]['session']['download'] = 0;
|
||||||
$p['clients'][$k]['global']['upload'] += $v['session']['upload'];
|
$p['users'][$k]['global']['upload'] += $v['session']['upload'];
|
||||||
$p['clients'][$k]['session']['upload'] = 0;
|
$p['users'][$k]['session']['upload'] = 0;
|
||||||
}
|
}
|
||||||
$this->setXrayStats($p);
|
$this->setXrayStats($p);
|
||||||
}
|
}
|
||||||
@@ -993,7 +993,7 @@ class Bot
|
|||||||
{
|
{
|
||||||
$r = $this->send(
|
$r = $this->send(
|
||||||
$this->input['chat'],
|
$this->input['chat'],
|
||||||
"@{$this->input['username']} enter pass",
|
"@{$this->input['username']} enter password",
|
||||||
$this->input['message_id'],
|
$this->input['message_id'],
|
||||||
reply: 'enter password',
|
reply: 'enter password',
|
||||||
);
|
);
|
||||||
@@ -1011,7 +1011,7 @@ class Bot
|
|||||||
$this->input['chat'],
|
$this->input['chat'],
|
||||||
"@{$this->input['username']} enter name",
|
"@{$this->input['username']} enter name",
|
||||||
$this->input['message_id'],
|
$this->input['message_id'],
|
||||||
reply: 'enter password',
|
reply: 'enter name',
|
||||||
);
|
);
|
||||||
$_SESSION['reply'][$r['result']['message_id']] = [
|
$_SESSION['reply'][$r['result']['message_id']] = [
|
||||||
'start_message' => $this->input['message_id'],
|
'start_message' => $this->input['message_id'],
|
||||||
@@ -1357,14 +1357,22 @@ class Bot
|
|||||||
'upload' => $tu,
|
'upload' => $tu,
|
||||||
];
|
];
|
||||||
if (!empty($users = $x['inbounds'][0]['settings']['clients'])) {
|
if (!empty($users = $x['inbounds'][0]['settings']['clients'])) {
|
||||||
|
$tmp = [];
|
||||||
foreach ($users as $k => $v) {
|
foreach ($users as $k => $v) {
|
||||||
$d = json_decode($this->ssh('xray api stats --server=127.0.0.1:8080 -name "user>>>' . $v['email'] . '>>>traffic>>>downlink" 2>&1', 'xr'), true)['stat']['value'] ?: 0;
|
$d = json_decode($this->ssh('xray api stats --server=127.0.0.1:8080 -name "user>>>' . $v['email'] . '>>>traffic>>>downlink" 2>&1', 'xr'), true)['stat']['value'] ?: 0;
|
||||||
$u = json_decode($this->ssh('xray api stats --server=127.0.0.1:8080 -name "user>>>' . $v['email'] . '>>>traffic>>>uplink" 2>&1', 'xr'), true)['stat']['value'] ?: 0;
|
$u = json_decode($this->ssh('xray api stats --server=127.0.0.1:8080 -name "user>>>' . $v['email'] . '>>>traffic>>>uplink" 2>&1', 'xr'), true)['stat']['value'] ?: 0;
|
||||||
$p['users'][$k]['session'] = [
|
$tmp[$k] = [
|
||||||
'download' => $d,
|
'session' => [
|
||||||
'upload' => $u,
|
'download' => $d,
|
||||||
|
'upload' => $u,
|
||||||
|
],
|
||||||
|
'global' => [
|
||||||
|
'download' => $p['users'][$k]['global']['download'],
|
||||||
|
'upload' => $p['users'][$k]['global']['upload'],
|
||||||
|
]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
$p['users'] = $tmp;
|
||||||
}
|
}
|
||||||
$this->setXrayStats($p);
|
$this->setXrayStats($p);
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
@@ -5304,10 +5312,13 @@ DNS-over-HTTPS with IP:
|
|||||||
|
|
||||||
public function delxr($i)
|
public function delxr($i)
|
||||||
{
|
{
|
||||||
$r = $this->getXray();
|
$r = $this->getXray();
|
||||||
|
$st = $this->getXrayStats();
|
||||||
foreach ($r['inbounds'][0]['settings']['clients'] as $k => $v) {
|
foreach ($r['inbounds'][0]['settings']['clients'] as $k => $v) {
|
||||||
if ($i == $k) {
|
if ($i == $k) {
|
||||||
unset($r['inbounds'][0]['settings']['clients'][$k]);
|
unset($r['inbounds'][0]['settings']['clients'][$k]);
|
||||||
|
unset($st['users'][$k]);
|
||||||
|
$this->setXrayStats($st);
|
||||||
$this->restartXray($r);
|
$this->restartXray($r);
|
||||||
$this->adguardXrayClients();
|
$this->adguardXrayClients();
|
||||||
break;
|
break;
|
||||||
@@ -5415,10 +5426,7 @@ DNS-over-HTTPS with IP:
|
|||||||
public function resetXrUser($i)
|
public function resetXrUser($i)
|
||||||
{
|
{
|
||||||
$c = $this->getXrayStats();
|
$c = $this->getXrayStats();
|
||||||
$c['clients'][$i]['global'] = [
|
unset($c['users'][$i]);
|
||||||
'download' => 0,
|
|
||||||
'upload' => 0,
|
|
||||||
];
|
|
||||||
$this->restartXray($this->getXray());
|
$this->restartXray($this->getXray());
|
||||||
$this->userXr($i);
|
$this->userXr($i);
|
||||||
}
|
}
|
||||||
@@ -5751,7 +5759,6 @@ DNS-over-HTTPS with IP:
|
|||||||
'callback_data' => '/addLinkDomain',
|
'callback_data' => '/addLinkDomain',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
$ip_count = $p['ip_count'] ?: 1;
|
|
||||||
$data[] = [
|
$data[] = [
|
||||||
[
|
[
|
||||||
'text' => $this->i18n('Reality') . ' ' . ($p['transport'] == 'Reality' ? $this->i18n('on') : $this->i18n('off')),
|
'text' => $this->i18n('Reality') . ' ' . ($p['transport'] == 'Reality' ? $this->i18n('on') : $this->i18n('off')),
|
||||||
@@ -5761,6 +5768,9 @@ DNS-over-HTTPS with IP:
|
|||||||
'text' => $this->i18n('Websocket') . ' ' . ($p['transport'] != 'Reality' ? $this->i18n('on') : $this->i18n('off')),
|
'text' => $this->i18n('Websocket') . ' ' . ($p['transport'] != 'Reality' ? $this->i18n('on') : $this->i18n('off')),
|
||||||
'callback_data' => "/changeTransport 1",
|
'callback_data' => "/changeTransport 1",
|
||||||
],
|
],
|
||||||
|
];
|
||||||
|
$ip_count = $p['ip_count'] ?: 1;
|
||||||
|
$data[] = [
|
||||||
[
|
[
|
||||||
'text' => $this->i18n('ip limit') . ' ' . ($p['ip_limit'] ? ": {$p['ip_limit']} sec & $ip_count" : $this->i18n('off')),
|
'text' => $this->i18n('ip limit') . ' ' . ($p['ip_limit'] ? ": {$p['ip_limit']} sec & $ip_count" : $this->i18n('off')),
|
||||||
'callback_data' => "/setIpLimit",
|
'callback_data' => "/setIpLimit",
|
||||||
@@ -6644,7 +6654,7 @@ DNS-over-HTTPS with IP:
|
|||||||
if (!empty($route['rules'])) {
|
if (!empty($route['rules'])) {
|
||||||
foreach ($route['rules'] as $k => $v) {
|
foreach ($route['rules'] as $k => $v) {
|
||||||
if (!empty($v['addruleset'])) {
|
if (!empty($v['addruleset'])) {
|
||||||
$t[$v['outbound']] = $k;
|
$t[$v['outbound'] ?: 'block'] = $k;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$p = $this->getPacConf();
|
$p = $this->getPacConf();
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
22.02.2025 v2.13
|
||||||
|
- vless: улучшение сбора статы
|
||||||
|
- vless: фикс добавлениея правил srs для block outbound
|
||||||
11.02.2025 v2.12
|
11.02.2025 v2.12
|
||||||
- vless: хранение статы в отдельном файле
|
- vless: хранение статы в отдельном файле
|
||||||
- vless ip limit: возможность указать кол-во айпи
|
- vless ip limit: возможность указать кол-во айпи
|
||||||
|
|||||||
Reference in New Issue
Block a user