ability to add your IPs to blocklist/whitelist

This commit is contained in:
mercury
2024-11-16 00:34:22 +04:00
parent 0d7426e785
commit c2219e3657
2 changed files with 21 additions and 3 deletions
+18 -3
View File
@@ -2584,9 +2584,9 @@ DNS-over-HTTPS with IP:
default:
$r = $this->send(
$this->input['chat'],
"@{$this->input['username']} list domains separated by commas",
"@{$this->input['username']} list separated by commas",
$this->input['message_id'],
reply: 'list domains separated by commas',
reply: 'list separated by commas',
);
break;
}
@@ -2608,7 +2608,11 @@ DNS-over-HTTPS with IP:
if (!empty($domains)) {
$conf = $this->getPacConf();
foreach ($domains as $k => $v) {
$conf[$type][in_array($type, ['rulessetlist', 'packagelist', 'processlist']) ? trim($v) : idn_to_ascii(trim($v))] = true;
if (in_array($type, ['white', 'deny'])) {
$conf[$type][] = $v;
} else {
$conf[$type][in_array($type, ['rulessetlist', 'packagelist', 'processlist']) ? trim($v) : idn_to_ascii(trim($v))] = true;
}
}
ksort($conf[$type]);
$this->setPacConf($conf);
@@ -2647,6 +2651,11 @@ DNS-over-HTTPS with IP:
$this->xrayUpdateRules();
$this->xtlsrulesset();
break;
case 'white':
case 'deny':
$this->syncDeny();
$this->denyList(0, $type == 'white' ? 1 : 0);
break;
}
}
@@ -4544,6 +4553,12 @@ DNS-over-HTTPS with IP:
$page = min($page, $all - 1);
$page = $page < 0 ? $all - 1 : $page;
$data[] = [
[
'text' => $this->i18n('add'),
'callback_data' => "/include " . ($white ? 'white' : 'deny'),
],
];
if (!empty($domains)) {
foreach (array_slice($domains, $page * $this->limit, $this->limit) as $v) {
$data[] = [
+3
View File
@@ -1,3 +1,6 @@
16.11.2024 v1.102
- переделан раздел списка ip под управление кнопками
- возможность добавить свои айпи в blocklist/whitelist
15.11.2024 v1.101
- кнопка добавления https://github.com/legiz-ru/sb-rule-sets/raw/main/ru-bundle.lst
- переделан раздел списка ip для читаемости