Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| be227f6a33 | |||
| 37d392a240 | |||
| 565573cfc2 | |||
| 3813f43b92 | |||
| f34427c13c | |||
| c2219e3657 | |||
| 0d7426e785 |
+214
-113
@@ -12,6 +12,7 @@ class Bot
|
||||
public $dns;
|
||||
public $mtu;
|
||||
public $logs;
|
||||
public $reg;
|
||||
|
||||
public function __construct($key, $i18n)
|
||||
{
|
||||
@@ -35,6 +36,22 @@ class Bot
|
||||
'upstream_access',
|
||||
'xray',
|
||||
];
|
||||
$this->reg = '~' . implode('|', [
|
||||
'GET /ws(?:.+)? HTTP',
|
||||
'GET /adguard/(?:.+)? HTTP',
|
||||
'GET /webapp(?:.+)? HTTP',
|
||||
'GET /pac(?:.+)? HTTP',
|
||||
'GET \.well-known(?:.+)? HTTP',
|
||||
'GET /v2ray(?:.+)? HTTP',
|
||||
'GET /dns-query(?:.+)? HTTP',
|
||||
'GET / HTTP',
|
||||
'GET /tlgrm(?:.+)? HTTP',
|
||||
'GET /jsoneditor.min.css HTTP',
|
||||
'GET /jsoneditor.min.js HTTP',
|
||||
'GET /jquery-3.7.1.min.js HTTP',
|
||||
'GET /img/jsoneditor-icons.svg HTTP',
|
||||
'GET /favicon.ico HTTP',
|
||||
]) . '~';
|
||||
}
|
||||
|
||||
public function input()
|
||||
@@ -150,9 +167,11 @@ class Bot
|
||||
$this->switchBanIp();
|
||||
break;
|
||||
case preg_match('~^/searchLogs (.+)$~', $this->input['message'], $m):
|
||||
case preg_match('~^/searchLogs (.+)$~', $this->input['callback'], $m):
|
||||
$this->searchLogs($m[1]);
|
||||
break;
|
||||
case preg_match('~^/searchLogs (.+?)(?:\s(.+?))?(?:\s(.+?))?(?:\s(.+?))?$~', $this->input['callback'], $m):
|
||||
$this->searchLogs($m[1], $m[2], $m[3], $m[4]);
|
||||
break;
|
||||
case preg_match('~^/switchSilence$~', $this->input['callback'], $m):
|
||||
$this->switchSilence();
|
||||
break;
|
||||
@@ -168,9 +187,8 @@ class Bot
|
||||
case preg_match('~^/ports$~', $this->input['callback'], $m):
|
||||
$this->ports();
|
||||
break;
|
||||
case preg_match('~^/ip$~', $this->input['message'], $m):
|
||||
case preg_match('~^/analysisIp$~', $this->input['callback'], $m):
|
||||
$this->analysisIp();
|
||||
case preg_match('~^/analysisIp(?:\s(\d+))?$~', $this->input['callback'], $m):
|
||||
$this->analysisIp($m[1] ?: 0);
|
||||
break;
|
||||
case preg_match('~^/ipMenu$~', $this->input['callback'], $m):
|
||||
$this->ipMenu();
|
||||
@@ -190,10 +208,13 @@ class Bot
|
||||
case preg_match('~^/searchIp (.+)$~', $this->input['callback'], $m):
|
||||
$this->searchIp($m[1]);
|
||||
break;
|
||||
case preg_match('~^/denyIp (.+?)(?:\s(\d)\s(\d+?)\s(\d))?$~', $this->input['callback'], $m):
|
||||
case preg_match('~^/searchSuspiciousIp (.+)$~', $this->input['callback'], $m):
|
||||
$this->searchSuspiciousIp($m[1]);
|
||||
break;
|
||||
case preg_match('~^/denyIp (.+?)(?:\s(.+?)\s(\d+?)\s(\d))?$~', $this->input['callback'], $m):
|
||||
$this->denyIp($m[1], $m[2], $m[3], $m[4]);
|
||||
break;
|
||||
case preg_match('~^/whiteIp (.+?)(?:\s(\d)\s(\d+?)\s(\d))?$~', $this->input['callback'], $m):
|
||||
case preg_match('~^/whiteIp (.+?)(?:\s(.+?)\s(\d+?)\s(\d))?$~', $this->input['callback'], $m):
|
||||
$this->whiteIp($m[1], $m[2], $m[3], $m[4]);
|
||||
break;
|
||||
case preg_match('~^/adgFillAllowedClients(?: (\d+))?$~', $this->input['callback'], $m):
|
||||
@@ -579,7 +600,7 @@ class Bot
|
||||
$this->addOverrideHtml();
|
||||
break;
|
||||
case preg_match('~^/export$~', $this->input['callback'], $m):
|
||||
$this->exportManual();
|
||||
$this->pinBackup();
|
||||
break;
|
||||
case preg_match('~^/import$~', $this->input['callback'], $m):
|
||||
$this->import();
|
||||
@@ -1165,27 +1186,26 @@ class Bot
|
||||
try {
|
||||
$pac = $this->getPacConf();
|
||||
if (!empty($pac['autoscan'])) {
|
||||
$r = $this->analysisIp(1);
|
||||
$r = $this->analysisIp(return: 1);
|
||||
require __DIR__ . '/config.php';
|
||||
if (!empty($c['admin']) && (empty($this->time3) || ((time() - $this->time3) > $pac['autoscan_timeout']))) {
|
||||
$this->time3 = time();
|
||||
if (!empty($r)) {
|
||||
foreach ($r as $k => $v) {
|
||||
$tmp = array_unique($v);
|
||||
foreach ($tmp as $i) {
|
||||
$t[$i]++;
|
||||
foreach ($v as $i) {
|
||||
$t[$i['title']][$k] = 1;
|
||||
}
|
||||
}
|
||||
foreach ($t as $k => $v) {
|
||||
$text .= "\n$v $k";
|
||||
$text .= "\n" . count($v) . " $k";
|
||||
}
|
||||
if (!empty($pac['autodeny'])) {
|
||||
$this->denyIp(array_keys($r));
|
||||
$ban = count(array_keys($r));
|
||||
foreach (array_keys($r) as $v) {
|
||||
$ips[] = [[
|
||||
'text' => "logs $v",
|
||||
'callback_data' => "/searchIp $v",
|
||||
'text' => $v,
|
||||
'callback_data' => "/searchLogs $v",
|
||||
]];
|
||||
}
|
||||
}
|
||||
@@ -1208,7 +1228,7 @@ class Bot
|
||||
|
||||
public function checkBackup($delta)
|
||||
{
|
||||
$c = $this->getPacConf();
|
||||
$c = $this->getPacConf();
|
||||
if (!empty($c['backup'])) {
|
||||
$now = strtotime(date('Y-m-d H:i:s'));
|
||||
[$start, $period] = explode('/', $c['backup']);
|
||||
@@ -1221,9 +1241,6 @@ class Bot
|
||||
&& $now - $start >= 0
|
||||
&& (($now - $start) % $period < $delta)
|
||||
) {
|
||||
if (!empty($c['pinbackup'])) {
|
||||
$this->pinAdmin($c['pinbackup'], 1);
|
||||
}
|
||||
$this->pinBackup();
|
||||
}
|
||||
}
|
||||
@@ -1245,12 +1262,19 @@ class Bot
|
||||
}
|
||||
}
|
||||
|
||||
public function pinBackup()
|
||||
public function pinBackup($file = false)
|
||||
{
|
||||
require __DIR__ . '/config.php';
|
||||
$conf = $this->getPacConf();
|
||||
$bot = preg_replace('~[\W]~iu', '_', $this->request('getMyName', [])['result']['name']);
|
||||
$conf['pinbackup'] = $this->upload("{$bot}_export_" . date('d_m_Y_H_i') . '.json', $this->export(), $c['admin'][0])['result']['message_id'];
|
||||
$conf = $this->getPacConf();
|
||||
$bot = preg_replace('~[\W]~iu', '_', $this->request('getMyName', [])['result']['name']);
|
||||
$json = $this->export();
|
||||
if (!empty($file)) {
|
||||
file_put_contents($file, $json);
|
||||
}
|
||||
if (!empty($conf['pinbackup'])) {
|
||||
$this->pinAdmin($conf['pinbackup'], 1);
|
||||
}
|
||||
$conf['pinbackup'] = $this->upload("{$bot}_export_" . date('d_m_Y_H_i') . '.json', $json, $c['admin'][0])['result']['message_id'];
|
||||
$this->setPacConf($conf);
|
||||
$this->pinAdmin($conf['pinbackup']);
|
||||
}
|
||||
@@ -1273,9 +1297,13 @@ class Bot
|
||||
$this->send($v, implode("\n", $diff), 0, [
|
||||
[
|
||||
[
|
||||
'text' => 'changelog',
|
||||
'text' => 'changelog',
|
||||
'web_app' => ['url' => "https://raw.githubusercontent.com/mercurykd/vpnbot/$b/version"],
|
||||
]
|
||||
],
|
||||
[
|
||||
'text' => $this->i18n('update bot'),
|
||||
'callback_data' => "/applyupdatebot",
|
||||
],
|
||||
]
|
||||
]);
|
||||
}
|
||||
@@ -1434,16 +1462,6 @@ class Bot
|
||||
return json_encode($conf, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
||||
}
|
||||
|
||||
public function exportManual($file = false)
|
||||
{
|
||||
$json = $this->export();
|
||||
if (!empty($file)) {
|
||||
file_put_contents($file, $json);
|
||||
}
|
||||
$bot = preg_replace('~[\W]~iu', '_', $this->request('getMyName', [])['result']['name']);
|
||||
return $this->upload("{$bot}_export_" . date('d_m_Y_H_i') . '.json', $json);
|
||||
}
|
||||
|
||||
public function import()
|
||||
{
|
||||
$r = $this->send(
|
||||
@@ -2564,9 +2582,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;
|
||||
}
|
||||
@@ -2588,7 +2606,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);
|
||||
@@ -2627,6 +2649,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4281,7 +4308,37 @@ DNS-over-HTTPS with IP:
|
||||
);
|
||||
}
|
||||
|
||||
public function analysisIp($return = false)
|
||||
public function suspicious($regexp, $file, $ip, $title, $reverse = false)
|
||||
{
|
||||
if ($r = fopen($file, 'r')) {
|
||||
while (feof($r) === false) {
|
||||
$l = fgets($r);
|
||||
if (preg_match('~(\d+\.\d+\.\d+\.\d+)~', $l, $m)) {
|
||||
if ($reverse xor preg_match($regexp, $l)) {
|
||||
if (is_array($ip)) {
|
||||
if (empty($ip[$m[1]])) {
|
||||
$ret[$m[1]][] = [
|
||||
'title' => $title,
|
||||
'log' => $l,
|
||||
];
|
||||
}
|
||||
} else {
|
||||
if ($ip == $m[1]) {
|
||||
$ret[$m[1]][] = [
|
||||
'title' => $title,
|
||||
'log' => $l,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose($r);
|
||||
}
|
||||
return $ret ?: [];
|
||||
}
|
||||
|
||||
public function analysisIp(int $page = 0, $return = false)
|
||||
{
|
||||
$pac = $this->getPacConf();
|
||||
foreach (array_merge($pac['white'] ?: [], $pac['deny'] ?: [], [
|
||||
@@ -4322,98 +4379,102 @@ DNS-over-HTTPS with IP:
|
||||
fclose($r);
|
||||
}
|
||||
|
||||
if ($r = fopen('/logs/upstream_access', 'r')) {
|
||||
while (feof($r) === false) {
|
||||
$l = fgets($r);
|
||||
if (preg_match('~(\d+\.\d+\.\d+\.\d+).+200\s\d+\s0$~', $l, $m)) {
|
||||
if (empty($xr[$m[1]])) {
|
||||
$ip[$m[1]][] = 'possibly a Reality Degenerate';
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose($r);
|
||||
}
|
||||
|
||||
$reg = [
|
||||
'GET /ws(?:.+)? HTTP',
|
||||
'GET /adguard/(?:.+)? HTTP',
|
||||
'GET /webapp(?:.+)? HTTP',
|
||||
'GET /pac(?:.+)? HTTP',
|
||||
'GET \.well-known(?:.+)? HTTP',
|
||||
'GET /v2ray(?:.+)? HTTP',
|
||||
'GET /dns-query(?:.+)? HTTP',
|
||||
'GET / HTTP',
|
||||
'GET /tlgrm(?:.+)? HTTP',
|
||||
'GET /jsoneditor.min.css HTTP',
|
||||
'GET /jsoneditor.min.js HTTP',
|
||||
'GET /jquery-3.7.1.min.js HTTP',
|
||||
'GET /img/jsoneditor-icons.svg HTTP',
|
||||
'GET /favicon.ico HTTP',
|
||||
$t = [
|
||||
$this->suspicious('~\d+\.\d+\.\d+\.\d+.+200\s\d+\s0$~', '/logs/upstream_access', $xr, 'possibly a Reality Degenerate'),
|
||||
$this->suspicious($this->reg, '/logs/nginx_default_access', $xr, 'possibly a scanner', true),
|
||||
$this->suspicious($this->reg, '/logs/nginx_domain_access', $xr, 'possibly a scanner', true),
|
||||
];
|
||||
|
||||
if ($r = fopen('/logs/nginx_default_access', 'r')) {
|
||||
while (feof($r) === false) {
|
||||
$l = fgets($r);
|
||||
if (!preg_match('~' . implode('|', $reg) . '~', $l)) {
|
||||
if (preg_match('~(\d+\.\d+\.\d+\.\d+)~', $l, $m)) {
|
||||
if (empty($xr[$m[1]])) {
|
||||
$ip[$m[1]][] = 'possibly a scanner';
|
||||
}
|
||||
}
|
||||
}
|
||||
$ip = [];
|
||||
foreach ($t as $r) {
|
||||
foreach ($r as $k => $v) {
|
||||
$ip[$k] = $v;
|
||||
}
|
||||
fclose($r);
|
||||
}
|
||||
|
||||
if ($r = fopen('/logs/nginx_domain_access', 'r')) {
|
||||
while (feof($r) === false) {
|
||||
$l = fgets($r);
|
||||
if (!preg_match('~' . implode('|', $reg) . '~', $l)) {
|
||||
if (preg_match('~(\d+\.\d+\.\d+\.\d+)~', $l, $m)) {
|
||||
if (empty($xr[$m[1]])) {
|
||||
$ip[$m[1]][] = 'possibly a scanner';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose($r);
|
||||
if (!empty($return)) {
|
||||
return $ip;
|
||||
}
|
||||
|
||||
if (!empty($ip)) {
|
||||
if (!empty($return)) {
|
||||
return $ip;
|
||||
}
|
||||
foreach ($ip as $k => $v) {
|
||||
$file .= "/searchLogs $k\n";
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $k,
|
||||
'callback_data' => "/searchLogs $k analysisIp $page 0",
|
||||
]
|
||||
];
|
||||
}
|
||||
$all = (int) ceil(count($data) / $this->limit);
|
||||
$page = min($page, $all - 1);
|
||||
$page = $page < 0 ? $all - 1 : $page;
|
||||
$data = array_slice($data ?: [], $page * $this->limit, $this->limit);
|
||||
if ($all > 1) {
|
||||
$data[] = [
|
||||
[
|
||||
'text' => '<<',
|
||||
'callback_data' => "/analysisIp " . ($page - 1 >= 0 ? $page - 1 : $all - 1),
|
||||
],
|
||||
[
|
||||
'text' => '>>',
|
||||
'callback_data' => "/analysisIp " . ($page < $all - 1 ? $page + 1 : 0),
|
||||
]
|
||||
];
|
||||
}
|
||||
$this->sendFile($this->input['from'], new CURLStringFile($file, 'analyze_ip_' . date('Y_m_d_H_i_s')));
|
||||
} else {
|
||||
$this->answer($this->input['callback_id'], 'empty');
|
||||
}
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('back'),
|
||||
'callback_data' => "/ipMenu",
|
||||
],
|
||||
];
|
||||
$this->update($this->input['from'], $this->input['message_id'], count($ip) ?: 'empty', $data);
|
||||
}
|
||||
|
||||
public function searchLogs($search)
|
||||
public function searchLogs($search, $fun = false, $page = 0, $white = 0)
|
||||
{
|
||||
if (preg_match('~^\d+\.\d+\.\d+\.\d+$~', $search)) {
|
||||
$info = file_get_contents("https://ipinfo.io/$search/json", context: stream_context_create(['http' => ['timeout' => 2]]));
|
||||
$this->send($this->input['from'], "$search\n<pre>$info</pre>", button: [[
|
||||
$text = "$search\n<pre>$info</pre>";
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('block'),
|
||||
'callback_data' => "/denyIp $search",
|
||||
'callback_data' => "/denyIp $search" . ($fun ? " $fun $page $white" : ''),
|
||||
],
|
||||
[
|
||||
'text' => $this->i18n('ignore'),
|
||||
'callback_data' => "/whiteIp $search",
|
||||
'callback_data' => "/whiteIp $search" . ($fun ? " $fun $page $white" : ''),
|
||||
],
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('logs'),
|
||||
'text' => $this->i18n('all logs'),
|
||||
'callback_data' => "/searchIp $search",
|
||||
],
|
||||
[
|
||||
'text' => $this->i18n('clean logs'),
|
||||
'text' => $this->i18n('suspicious log'),
|
||||
'callback_data' => "/searchSuspiciousIp $search",
|
||||
],
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n("clean logs $search"),
|
||||
'callback_data' => "/cleanLogs $search",
|
||||
],
|
||||
]]);
|
||||
];
|
||||
if (!empty($fun)) {
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('back'),
|
||||
'callback_data' => "/$fun $page" . ($white ? " $white" : ''),
|
||||
],
|
||||
];
|
||||
$this->update($this->input['from'], $this->input['message_id'], $text, button: $data);
|
||||
} else {
|
||||
if (empty($this->input['callback_id'])) {
|
||||
$this->delete($this->input['from'], $this->input['message_id']);
|
||||
}
|
||||
$this->send($this->input['from'], $text, button: $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4448,6 +4509,40 @@ DNS-over-HTTPS with IP:
|
||||
}
|
||||
}
|
||||
|
||||
public function searchSuspiciousIp($ip)
|
||||
{
|
||||
$t = [
|
||||
$this->suspicious('~\d+\.\d+\.\d+\.\d+.+200\s\d+\s0$~', '/logs/upstream_access', $ip, 'possibly a Reality Degenerate'),
|
||||
$this->suspicious($this->reg, '/logs/nginx_default_access', $ip, 'possibly a scanner', true),
|
||||
$this->suspicious($this->reg, '/logs/nginx_domain_access', $ip, 'possibly a scanner', true),
|
||||
];
|
||||
foreach ($t as $r) {
|
||||
if (!empty($r)) {
|
||||
foreach ($r as $v) {
|
||||
foreach ($v as $k) {
|
||||
$logs[$k['title']][] = $k['log'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($logs)) {
|
||||
foreach ($logs as $k => $v) {
|
||||
$head= "$k:\n";
|
||||
$t = array_chunk($v, 10);
|
||||
foreach ($t as $j) {
|
||||
$text = "$head<pre>";
|
||||
foreach ($j as $i) {
|
||||
$text .= htmlspecialchars($i, ENT_HTML5, 'UTF-8');
|
||||
}
|
||||
$text .= '</pre>';
|
||||
$this->send($this->input['from'], $text, $this->input['message_id']);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->answer($this->input['callback_id'], 'empty');
|
||||
}
|
||||
}
|
||||
|
||||
public function denyList($page = 0, $white = 0)
|
||||
{
|
||||
$text = 'Menu -> IP -> ' . ($white ? 'white' : 'deny') . ' list';
|
||||
@@ -4456,12 +4551,18 @@ 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[] = [
|
||||
[
|
||||
'text' => $v,
|
||||
'callback_data' => "/searchLogs $v",
|
||||
'callback_data' => "/searchLogs $v denyList $page $white",
|
||||
],
|
||||
[
|
||||
'text' => $this->i18n('delete'),
|
||||
@@ -4512,7 +4613,7 @@ DNS-over-HTTPS with IP:
|
||||
$this->ipMenu();
|
||||
}
|
||||
|
||||
public function denyIp($ip, $nodelete = false, $page = 0, $white = 0)
|
||||
public function denyIp($ip, $fun = false, $page = 0, $white = 0)
|
||||
{
|
||||
$pac = $this->getPacConf();
|
||||
if (is_array($ip)) {
|
||||
@@ -4529,16 +4630,16 @@ DNS-over-HTTPS with IP:
|
||||
}
|
||||
}
|
||||
$this->setPacConf($pac);
|
||||
if (empty($nodelete)) {
|
||||
if (empty($fun)) {
|
||||
$this->delete($this->input['from'], $this->input['message_id']);
|
||||
}
|
||||
$this->syncDeny();
|
||||
if (!empty($nodelete)) {
|
||||
$this->denyList($page, $white);
|
||||
if (!empty($fun)) {
|
||||
$this->{$fun}($page, $white);
|
||||
}
|
||||
}
|
||||
|
||||
public function whiteIp($ip, $nodelete = false, $page = 0, $white = 0)
|
||||
public function whiteIp($ip, $fun = false, $page = 0, $white = 0)
|
||||
{
|
||||
$pac = $this->getPacConf();
|
||||
if (is_array($ip)) {
|
||||
@@ -4555,12 +4656,12 @@ DNS-over-HTTPS with IP:
|
||||
}
|
||||
}
|
||||
$this->setPacConf($pac);
|
||||
if (empty($nodelete)) {
|
||||
if (empty($fun)) {
|
||||
$this->delete($this->input['from'], $this->input['message_id']);
|
||||
}
|
||||
$this->syncDeny();
|
||||
if (!empty($nodelete)) {
|
||||
$this->denyList($page, $white);
|
||||
if (!empty($fun)) {
|
||||
$this->{$fun}($page, $white);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6265,7 +6366,7 @@ DNS-over-HTTPS with IP:
|
||||
|
||||
public function applyupdatebot()
|
||||
{
|
||||
$this->exportManual($this->update);
|
||||
$this->pinBackup($this->update);
|
||||
$r = $this->send($this->input['from'], 'update...');
|
||||
file_put_contents('/update/reload_message', "{$this->input['from']}:{$r['result']['message_id']}");
|
||||
file_put_contents('/update/key', $this->key);
|
||||
|
||||
@@ -160,7 +160,9 @@ services:
|
||||
- ./ssh:/ssh
|
||||
- ./app:/app
|
||||
- ./logs/:/logs/
|
||||
- ./version:/version
|
||||
- ./update:/update
|
||||
- ./.git:/.git
|
||||
- ./scripts/start_service.sh:/start_service.sh
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
environment:
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
make d
|
||||
rm /etc/systemd/resolved.conf.d/adguardhome.conf
|
||||
mv /etc/resolv.conf.backup /etc/resolv.conf
|
||||
systemctl reload-or-restart systemd-resolved
|
||||
make u
|
||||
@@ -1,8 +0,0 @@
|
||||
mkdir /etc/systemd/resolved.conf.d
|
||||
echo "[Resolve]
|
||||
DNS=127.0.0.1
|
||||
DNSStubListener=no" > /etc/systemd/resolved.conf.d/adguardhome.conf
|
||||
mv /etc/resolv.conf /etc/resolv.conf.backup
|
||||
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
|
||||
systemctl reload-or-restart systemd-resolved
|
||||
make d u
|
||||
@@ -1,3 +1,11 @@
|
||||
16.11.2024 v1.104
|
||||
- единая механика закрепления бэкапа
|
||||
- фикс текста уведомления о новой версии
|
||||
16.11.2024 v1.103
|
||||
- фикс уведомления о новой версии
|
||||
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 для читаемости
|
||||
|
||||
Reference in New Issue
Block a user