Compare commits

...

4 Commits

Author SHA1 Message Date
mercury 2622397542 mihomo: udp true 2025-04-18 23:40:33 +04:00
mercury 702123e39c vless: ip limit only notifies 2025-04-17 00:58:13 +04:00
mercury 01ef7707c4 fix first start 2025-04-14 11:36:26 +04:00
mercury 064d39d80b Excess image php 2025-04-09 18:12:18 +04:00
5 changed files with 25 additions and 13 deletions
+16 -12
View File
@@ -40,7 +40,7 @@ class Bot
$this->reg = '~' . implode('|', [ $this->reg = '~' . implode('|', [
'GET / HTTP', 'GET / HTTP',
'GET /favicon.ico HTTP', 'GET /favicon.ico HTTP',
preg_quote($this->getHashBot()) preg_quote($this->getHashBot(1))
]) . '~'; ]) . '~';
} }
@@ -1188,8 +1188,7 @@ class Bot
$this->ssh('ssserver -v -d -c /config.json', 'ss'); $this->ssh('ssserver -v -d -c /config.json', 'ss');
$this->ssh('sslocal -v -d -c /config.json', 'proxy'); $this->ssh('sslocal -v -d -c /config.json', 'proxy');
$this->sd($c, 1); if (empty($nomenu)) {
if (!empty($nomenu)) {
$this->menu('ss'); $this->menu('ss');
} }
} }
@@ -5999,7 +5998,6 @@ DNS-over-HTTPS with IP:
public function frequencyAnalyze($line, $pac) public function frequencyAnalyze($line, $pac)
{ {
preg_match('~(?<date>.+)\sfrom\s(?<ip>\d+\.\d+\.\d+\.\d+)(?=.+email:\s(?<email>.+))~', $line, $m);
if (!empty($this->pool)) { if (!empty($this->pool)) {
foreach ($this->pool as $i => $j) { foreach ($this->pool as $i => $j) {
if (!empty($j['ips'])) { if (!empty($j['ips'])) {
@@ -6011,6 +6009,9 @@ DNS-over-HTTPS with IP:
} }
} }
} }
if (empty(preg_match('~(?<date>.+)\sfrom\s(?<ip>\d+\.\d+\.\d+\.\d+)(?=.+email:\s(?<email>.+))~', $line, $m))) {
return;
}
if (!empty($m['ip']) && !empty($m['email'])) { if (!empty($m['ip']) && !empty($m['email'])) {
$ip = ip2long($m['ip']); $ip = ip2long($m['ip']);
if (!empty($this->pool[$m['email']]['ip']) && $this->pool[$m['email']]['ip'] != $ip) { if (!empty($this->pool[$m['email']]['ip']) && $this->pool[$m['email']]['ip'] != $ip) {
@@ -6022,18 +6023,19 @@ DNS-over-HTTPS with IP:
if (empty($v['off']) && $v['email'] == $m['email']) { if (empty($v['off']) && $v['email'] == $m['email']) {
require __DIR__ . '/config.php'; require __DIR__ . '/config.php';
foreach ($c['admin'] as $admin) { foreach ($c['admin'] as $admin) {
$this->send($admin, "vless: {$m['email']} is turned off (limit by one IP)"); $this->send($admin, "vless: {$m['email']} limit ip " . count($this->pool[$m['email']]['ips']) . ' > ' . ($pac['ip_count'] ?: 1), button: [[
[
'text' => $this->i18n($c['off'] ? 'off' : 'on'),
'callback_data' => "/switchXr $k",
],
]]);
} }
unset($this->pool[$m['email']]); unset($this->pool[$m['email']]);
$this->switchXr($k, 1);
$flag = 1;
break; break;
} }
} }
} }
if (empty($flag)) { $this->pool[$m['email']]['ip'] = $ip;
$this->pool[$m['email']]['ip'] = $ip;
}
} }
} }
@@ -6805,14 +6807,16 @@ DNS-over-HTTPS with IP:
$this->ssh("nginx -s reload 2>&1", 'up'); $this->ssh("nginx -s reload 2>&1", 'up');
} }
public function getHashBot() public function getHashBot($notset = false)
{ {
$p = $this->getPacConf(); $p = $this->getPacConf();
if (!empty($p['hashbot'])) { if (!empty($p['hashbot'])) {
return $p['hashbot']; return $p['hashbot'];
} }
$p['hashbot'] = substr(hash('sha256', $this->key), 0, 8); $p['hashbot'] = substr(hash('sha256', $this->key), 0, 8);
$this->setPacConf($p); if (empty($notset)) {
$this->setPacConf($p);
}
return $p['hashbot']; return $p['hashbot'];
} }
+1
View File
@@ -72,6 +72,7 @@
"uuid": "~uid~", "uuid": "~uid~",
"network": "tcp", "network": "tcp",
"flow": "xtls-rprx-vision", "flow": "xtls-rprx-vision",
"udp": true,
"tls": true, "tls": true,
"reality-opts": { "reality-opts": {
"public-key": "~public_key~", "public-key": "~public_key~",
+1 -1
View File
@@ -147,7 +147,7 @@ services:
timeout: 5s timeout: 5s
retries: 5 retries: 5
service: service:
image: mercurykd/vpnbot-php:1.6 image: mercurykd/vpnbot-php:1.7
build: build:
dockerfile: dockerfile/php.dockerfile dockerfile: dockerfile/php.dockerfile
args: args:
+2
View File
@@ -41,6 +41,8 @@ xr: # консоль сервиса
docker compose exec xr /bin/sh docker compose exec xr /bin/sh
oc: # консоль сервиса oc: # консоль сервиса
docker compose exec oc /bin/sh docker compose exec oc /bin/sh
service: # консоль сервиса
docker compose exec service /bin/sh
clean: clean:
docker image prune docker image prune
docker builder prune docker builder prune
+5
View File
@@ -1,3 +1,8 @@
18.04.2025 v2.18
- фикс отсутствия ssl при первом старте
- iplimit уведомляет без отключения пользователя
- включение udp в mihomo-шаблоне
- удаление лишнего образа пхп
07.04.2025 v2.17 07.04.2025 v2.17
- фикс циклической перезагрузки панели adguardHome - фикс циклической перезагрузки панели adguardHome
07.04.2025 v2.16 07.04.2025 v2.16