Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2622397542 | |||
| 702123e39c | |||
| 01ef7707c4 | |||
| 064d39d80b |
+16
-12
@@ -40,7 +40,7 @@ class Bot
|
||||
$this->reg = '~' . implode('|', [
|
||||
'GET / 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('sslocal -v -d -c /config.json', 'proxy');
|
||||
|
||||
$this->sd($c, 1);
|
||||
if (!empty($nomenu)) {
|
||||
if (empty($nomenu)) {
|
||||
$this->menu('ss');
|
||||
}
|
||||
}
|
||||
@@ -5999,7 +5998,6 @@ DNS-over-HTTPS with IP:
|
||||
|
||||
public function frequencyAnalyze($line, $pac)
|
||||
{
|
||||
preg_match('~(?<date>.+)\sfrom\s(?<ip>\d+\.\d+\.\d+\.\d+)(?=.+email:\s(?<email>.+))~', $line, $m);
|
||||
if (!empty($this->pool)) {
|
||||
foreach ($this->pool as $i => $j) {
|
||||
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'])) {
|
||||
$ip = ip2long($m['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']) {
|
||||
require __DIR__ . '/config.php';
|
||||
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']]);
|
||||
$this->switchXr($k, 1);
|
||||
$flag = 1;
|
||||
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');
|
||||
}
|
||||
|
||||
public function getHashBot()
|
||||
public function getHashBot($notset = false)
|
||||
{
|
||||
$p = $this->getPacConf();
|
||||
if (!empty($p['hashbot'])) {
|
||||
return $p['hashbot'];
|
||||
}
|
||||
$p['hashbot'] = substr(hash('sha256', $this->key), 0, 8);
|
||||
$this->setPacConf($p);
|
||||
if (empty($notset)) {
|
||||
$this->setPacConf($p);
|
||||
}
|
||||
return $p['hashbot'];
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
"uuid": "~uid~",
|
||||
"network": "tcp",
|
||||
"flow": "xtls-rprx-vision",
|
||||
"udp": true,
|
||||
"tls": true,
|
||||
"reality-opts": {
|
||||
"public-key": "~public_key~",
|
||||
|
||||
+1
-1
@@ -147,7 +147,7 @@ services:
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
service:
|
||||
image: mercurykd/vpnbot-php:1.6
|
||||
image: mercurykd/vpnbot-php:1.7
|
||||
build:
|
||||
dockerfile: dockerfile/php.dockerfile
|
||||
args:
|
||||
|
||||
@@ -41,6 +41,8 @@ xr: # консоль сервиса
|
||||
docker compose exec xr /bin/sh
|
||||
oc: # консоль сервиса
|
||||
docker compose exec oc /bin/sh
|
||||
service: # консоль сервиса
|
||||
docker compose exec service /bin/sh
|
||||
clean:
|
||||
docker image prune
|
||||
docker builder prune
|
||||
|
||||
Reference in New Issue
Block a user