Compare commits

..

3 Commits

Author SHA1 Message Date
mercury 9eb15b9b45 update version 2024-11-14 15:37:06 +04:00
mercury 954cfe0346 improve ip ban 2024-11-14 14:32:49 +04:00
mercury 0d21eadcaa fix input timer autoscan 2024-11-14 02:35:51 +04:00
2 changed files with 38 additions and 15 deletions
+36 -15
View File
@@ -149,6 +149,9 @@ class Bot
case preg_match('~^/switchBanIp$~', $this->input['callback'], $m):
$this->switchBanIp();
break;
case preg_match('~^/switchSilence$~', $this->input['callback'], $m):
$this->switchSilence();
break;
case preg_match('~^/switchScanIp$~', $this->input['callback'], $m):
$this->switchScanIp();
break;
@@ -1179,13 +1182,15 @@ class Bot
]];
}
}
foreach ($c['admin'] as $k => $v) {
$this->send($v, "suspicious ips found: $text" . ($ban ? "\nbanned:$ban" : ''), button: $ips ?: [[
[
'text' => $this->i18n('analyze'),
'callback_data' => '/analysisIp',
],
]]);
if (empty($pac['silence'])) {
foreach ($c['admin'] as $k => $v) {
$this->send($v, "suspicious ips found: $text" . ($ban ? "\nbanned:$ban" : ''), button: $ips ?: [[
[
'text' => $this->i18n('analyze'),
'callback_data' => '/analysisIp',
],
]]);
}
}
}
}
@@ -4173,6 +4178,14 @@ DNS-over-HTTPS with IP:
$this->ipMenu();
}
public function switchSilence()
{
$c = $this->getPacConf();
$c['silence'] = $c['silence'] ? 0 : 1;
$this->setPacConf($c);
$this->ipMenu();
}
public function ipMenu()
{
$text = 'Menu -> IP';
@@ -4188,20 +4201,26 @@ DNS-over-HTTPS with IP:
if (!empty($pac['autoscan'])) {
$data[] = [
[
'text' => $this->i18n('autodeny') . ': ' . $this->i18n($pac['autodeny'] ? 'on' : 'off'),
'text' => $this->i18n('autoblock') . ': ' . $this->i18n($pac['autodeny'] ? 'on' : 'off'),
'callback_data' => '/switchBanIp',
],
];
$data[] = [
[
'text' => $this->i18n('silence') . ': ' . $this->i18n($pac['silence'] ? 'on' : 'off'),
'callback_data' => '/switchSilence',
],
];
}
$data[] = [
[
'text' => $this->i18n('allow list') . ": $w",
'text' => $this->i18n('ignorelist') . ": $w",
'callback_data' => '/denyList 0 1',
],
];
$data[] = [
[
'text' => $this->i18n('deny list') . ": $d",
'text' => $this->i18n('blocklist') . ": $d",
'callback_data' => '/denyList 0 0',
],
];
@@ -4319,11 +4338,11 @@ DNS-over-HTTPS with IP:
} else {
$this->send($this->input['from'], "$k $comment\n", button: [[
[
'text' => $this->i18n('deny'),
'text' => $this->i18n('block'),
'callback_data' => "/denyIp $k",
],
[
'text' => $this->i18n('allow'),
'text' => $this->i18n('ignore'),
'callback_data' => "/whiteIp $k",
],
[
@@ -4393,7 +4412,7 @@ DNS-over-HTTPS with IP:
'callback_data' => "/allowIp $v $page" . ($white ? " 1" : ''),
],
[
'text' => $this->i18n($white ? 'deny' : 'allow'),
'text' => $this->i18n($white ? 'block' : 'ignore'),
'callback_data' => ($white ? "/denyIp" : "/whiteIp") . " $v 1 $page $white",
],
[
@@ -4934,9 +4953,11 @@ DNS-over-HTTPS with IP:
if (empty($time)) {
unset($pac['autoscan_timeout']);
unset($pac['autoscan']);
} else {
$pac['autoscan_timeout'] = strtotime($time, 0);
} elseif ($t = strtotime($time, 0)) {
$pac['autoscan_timeout'] = $t;
$pac['autoscan'] = 1;
} else {
$this->send($this->input['from'], "$time - wrong format", $this->input['message_id']);
}
$this->setPacConf($pac);
$this->ipMenu();
+2
View File
@@ -1,3 +1,5 @@
14.11.2024 v1.99.1
- анализ логов и бан айпишников, фиксы
14.11.2024 v1.99
- анализ логов и бан айпишников
11.11.2024 v1.98