Compare commits

...

6 Commits

Author SHA1 Message Date
mercury ef3d40c098 update version 2024-08-09 23:59:48 +04:00
mercury ded85fb79f fix "delete all" 2024-08-09 23:56:57 +04:00
mercury b5ca5fbf93 mirror 2024-08-08 17:11:26 +04:00
mercury 570420274e improve updatepac 2024-08-08 12:45:44 +04:00
mercury baaf0e2d01 clear pac list button 2024-08-06 21:58:08 +04:00
mercury be8bec6a7d fix ocserv pass 2024-08-04 11:51:01 +04:00
3 changed files with 108 additions and 8 deletions
+92 -2
View File
@@ -133,6 +133,9 @@ class Bot
case preg_match('~^/changeWG (\d+)$~', $this->input['callback'], $m):
$this->changeWG($m[1]);
break;
case preg_match('~^/mirror$~', $this->input['message'], $m):
$this->menu('mirror');
break;
case preg_match('~^/id$~', $this->input['message'], $m):
$this->send($this->input['chat'], $this->input['from'], $this->input['message_id']);
break;
@@ -142,6 +145,12 @@ class Bot
case preg_match('~^/mtproto$~', $this->input['callback'], $m):
$this->mtproto();
break;
case preg_match('~^/deleteAll (\w+)$~', $this->input['callback'], $m):
$this->deleteAll($m[1]);
break;
case preg_match('~^/deleteYes (\w+)$~', $this->input['callback'], $m):
$this->deleteYes($m[1]);
break;
case preg_match('~^/addCommunityFilter$~', $this->input['callback'], $m):
$this->addCommunityFilter();
break;
@@ -3139,6 +3148,80 @@ DNS-over-HTTPS with IP:
);
}
public function deleteYes($type)
{
$c = $this->getPacConf();
unset($c[$type]);
$this->setPacConf($c);
switch ($type) {
case 'includelist':
$this->pacUpdate();
break;
case 'blocklist':
$this->xtlsblock();
break;
case 'warplist':
$this->xtlswarp();
break;
}
}
public function deleteAll($type)
{
switch ($type) {
case 'includelist':
$dir = 'PAC';
break;
case 'warplist':
$dir = 'WARP';
break;
case 'blocklist':
$dir = 'BLOCK';
break;
}
$text = <<<text
Menu -> $dir -> delete all
text;
$data[] = [
[
'text' => $this->i18n('yes'),
'callback_data' => "/deleteYes $type",
],
];
switch ($type) {
case 'includelist':
$data[] = [
[
'text' => $this->i18n('back'),
'callback_data' => "/pacMenu 0",
],
];
break;
case 'warplist':
$data[] = [
[
'text' => $this->i18n('back'),
'callback_data' => "/xtlswarp",
],
];
break;
case 'blocklist':
$data[] = [
[
'text' => $this->i18n('back'),
'callback_data' => "/xtlsblock",
],
];
break;
}
$this->update(
$this->input['chat'],
$this->input['message_id'],
$text,
$data ?: false,
);
}
public function xtlsblock($page = 0)
{
$text[] = "Menu -> " . $this->i18n('xray') . ' -> block list';
@@ -3216,6 +3299,12 @@ DNS-over-HTTPS with IP:
]
];
}
$data[] = [
[
'text' => $this->i18n('delete all'),
'callback_data' => "/deleteAll $type",
],
];
}
return $data;
}
@@ -3595,12 +3684,13 @@ DNS-over-HTTPS with IP:
preg_match('~^camouflage_secret[^\n]+?"([^"]+)*"~sm', $ocserv, $m);
$cs = $m[1];
preg_match('~^dns = ([^\n]+)~sm', $ocserv, $m);
$dns = $m[1];
$dns = $m[1];
$pass = htmlspecialchars($pac['ocserv']);
$text[] = "Menu -> OpenConnect";
if (!empty($m[1])) {
$text[] = "<code>https://oc.{$pac['domain']}/?$cs</code>";
}
$text[] = "password: <span class='tg-spoiler'>{$pac['ocserv']}</span>";
$text[] = "password: <span class='tg-spoiler'>$pass</span>";
$data[] = [
[
'text' => $this->i18n('change secret'),
+12 -6
View File
@@ -89,11 +89,14 @@ function start()
$conf = $bot->getPacConf();
$subzones = array_keys(array_filter($conf['subzoneslist'], fn($x) => $x == true));
if (!empty($conf['subzoneslist'])) {
$subzones = array_keys(array_filter($conf['subzoneslist'], fn($x) => $x == true));
}
// check && exclude
$include = array_filter($conf['includelist'], fn($x) => $x == true);
$domains = $include;
if (!empty($conf['includelist'])) {
$domains = array_filter($conf['includelist'], fn($x) => $x == true);
}
if (empty($domains)) {
$text = "Empty domains. Delete pac files";
unlink(__DIR__ . '/zapretlists/mpac');
@@ -146,10 +149,13 @@ function start()
file_put_contents(__DIR__ . '/zapretlists/pac', $pac);
$text .= "Create minified pac 100%\n";
}
// create reverse PAC
$domains = array_filter($conf['reverselist'], fn($x) => $x == true);
unset($domains);
if (!empty($conf['reverselist'])) {
$domains = array_filter($conf['reverselist'], fn($x) => $x == true);
}
if (empty($domains)) {
// $text .= "Empty reverse domains. Delete reverse pac files";
unlink(__DIR__ . '/zapretlists/rmpac');
unlink(__DIR__ . '/zapretlists/rpac');
@@ -197,6 +203,7 @@ function start()
file_put_contents(__DIR__ . '/zapretlists/rpac', $pac);
$text .= 'Create minified reverse pac 100%';
}
endScript($text);
}
@@ -242,7 +249,6 @@ $load = [
'-',
'\\',
];
switch ($_SERVER['argv'][1]) {
case 'start':
$bot = new Bot($c['key'], $i);
+4
View File
@@ -1,3 +1,7 @@
09.08.2024 v1.41.1
- фикс для "удалить все" в списках доменов
06.08.2024 v1.41
- возможность очистить РАС лист
03.08.2024 v1.40
- возможность менять MTU для Wireguard/Amnezia
- раздельный qr для AmneziaWG + AmneziaVPN