Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ca37736cd5 | |||
| 1c4fff50d1 | |||
| 6ffb4d0a79 | |||
| 394062cbe0 | |||
| dd8897575f | |||
| 9ab05de320 | |||
| 71f7db5bac | |||
| 237da68f14 | |||
| 961ebf3423 |
+56
-16
@@ -437,6 +437,9 @@ class Bot
|
||||
case preg_match('~^/xtlswarp(?: (\d+))?$~', $this->input['callback'], $m):
|
||||
$this->xtlswarp($m[1] ?: 0);
|
||||
break;
|
||||
case preg_match('~^/xtlsproxy(?: (\d+))?$~', $this->input['callback'], $m):
|
||||
$this->xtlsproxy($m[1] ?: 0);
|
||||
break;
|
||||
case preg_match('~^/xtlsapp(?: (\d+))?$~', $this->input['callback'], $m):
|
||||
$this->xtlsapp($m[1] ?: 0);
|
||||
break;
|
||||
@@ -2470,7 +2473,10 @@ DNS-over-HTTPS with IP:
|
||||
{
|
||||
switch ($type) {
|
||||
case 'includelist':
|
||||
$this->pacUpdate();
|
||||
$this->pacUpdate($_SESSION['proxylistentry']);
|
||||
if (!empty($_SESSION['proxylistentry'])) {
|
||||
$this->xtlsproxy();
|
||||
}
|
||||
break;
|
||||
case 'blocklist':
|
||||
$this->xrayUpdateRules();
|
||||
@@ -3350,6 +3356,7 @@ DNS-over-HTTPS with IP:
|
||||
|
||||
public function pacMenu($page = 0)
|
||||
{
|
||||
unset($_SESSION['proxylistentry']);
|
||||
$rmpac = stat(__DIR__ . '/zapretlists/rmpac');
|
||||
$rpac = stat(__DIR__ . '/zapretlists/rpac');
|
||||
$mpac = stat(__DIR__ . '/zapretlists/mpac');
|
||||
@@ -3430,7 +3437,7 @@ DNS-over-HTTPS with IP:
|
||||
'callback_data' => "/addCommunityFilter",
|
||||
],
|
||||
];
|
||||
$data = array_merge($data, $this->listPac('includelist', $page, 'pacMenu'));
|
||||
$data = array_merge($data, $this->listPac('includelist', $page, 'pacMenu')[0]);
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('back'),
|
||||
@@ -3569,7 +3576,7 @@ DNS-over-HTTPS with IP:
|
||||
{
|
||||
$text[] = "Menu -> " . $this->i18n('xray') . ' -> ' . $this->i18n('routes') . ' -> block list';
|
||||
|
||||
$data = $this->listPac('blocklist', $page, 'xtlsblock');
|
||||
[$data] = $this->listPac('blocklist', $page, 'xtlsblock');
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('back'),
|
||||
@@ -3588,7 +3595,26 @@ DNS-over-HTTPS with IP:
|
||||
{
|
||||
$text[] = "Menu -> " . $this->i18n('xray') . ' -> ' . $this->i18n('routes') . ' -> warp list';
|
||||
|
||||
$data = $this->listPac('warplist', $page, 'xtlswarp');
|
||||
[$data] = $this->listPac('warplist', $page, 'xtlswarp');
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('back'),
|
||||
'callback_data' => "/routes",
|
||||
],
|
||||
];
|
||||
$this->update(
|
||||
$this->input['chat'],
|
||||
$this->input['message_id'],
|
||||
implode("\n", $text ?: ['...']),
|
||||
$data ?: false,
|
||||
);
|
||||
}
|
||||
|
||||
public function xtlsproxy($page = 0)
|
||||
{
|
||||
$_SESSION['proxylistentry'] = 1;
|
||||
$text[] = "Menu -> " . $this->i18n('xray') . ' -> ' . $this->i18n('routes') . ' -> proxy list';
|
||||
[$data] = $this->listPac('includelist', $page, 'xtlsproxy');
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('back'),
|
||||
@@ -3623,7 +3649,7 @@ DNS-over-HTTPS with IP:
|
||||
{
|
||||
$text[] = "Menu -> " . $this->i18n('xray') . ' -> ' . $this->i18n('routes') . ' -> package list';
|
||||
|
||||
$data = $this->listPac('packagelist', $page, 'xtlsapp');
|
||||
[$data] = $this->listPac('packagelist', $page, 'xtlsapp');
|
||||
$p = $this->getPacConf();
|
||||
$data[] = [
|
||||
[
|
||||
@@ -3649,7 +3675,7 @@ DNS-over-HTTPS with IP:
|
||||
{
|
||||
$text[] = "Menu -> " . $this->i18n('xray') . ' -> ' . $this->i18n('routes') . ' -> process list';
|
||||
|
||||
$data = $this->listPac('processlist', $page, 'xtlsprocess');
|
||||
[$data] = $this->listPac('processlist', $page, 'xtlsprocess');
|
||||
$p = $this->getPacConf();
|
||||
$data[] = [
|
||||
[
|
||||
@@ -3675,7 +3701,8 @@ DNS-over-HTTPS with IP:
|
||||
{
|
||||
$text[] = "Menu -> " . $this->i18n('xray') . ' -> ' . $this->i18n('routes') . ' -> rulesset list';
|
||||
|
||||
$data = $this->listPac('rulessetlist', $page, 'xtlsrulesset', 1);
|
||||
[$data, $tmp] = $this->listPac('rulessetlist', $page, 'xtlsrulesset', 1);
|
||||
$text = array_merge($text, $tmp ?: []);
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('back'),
|
||||
@@ -3706,6 +3733,9 @@ DNS-over-HTTPS with IP:
|
||||
$domains = array_slice($domains, $page * $this->limit, $this->limit, true);
|
||||
$i = 0;
|
||||
foreach ($domains as $k => $v) {
|
||||
if ($type == 'rulessetlist') {
|
||||
$text[] = "<blockquote><code>$k</code></blockquote>";
|
||||
}
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n($v ? 'on' : 'off') . ' ' . ($basename ? basename($k) . ' ' : '') . (in_array($type, ['rulessetlist', 'packagelist', 'processlist']) ? $k : idn_to_utf8($k)),
|
||||
@@ -3752,7 +3782,7 @@ DNS-over-HTTPS with IP:
|
||||
],
|
||||
];
|
||||
}
|
||||
return $data;
|
||||
return [$data, $text];
|
||||
}
|
||||
|
||||
public function listPacChange($type, $action, $key)
|
||||
@@ -4589,6 +4619,10 @@ DNS-over-HTTPS with IP:
|
||||
'text' => $this->i18n('warp'),
|
||||
'callback_data' => "/xtlswarp",
|
||||
]],
|
||||
[[
|
||||
'text' => $this->i18n('proxy'),
|
||||
'callback_data' => "/xtlsproxy",
|
||||
]],
|
||||
[[
|
||||
'text' => $this->i18n('process'),
|
||||
'callback_data' => "/xtlsprocess",
|
||||
@@ -4656,14 +4690,10 @@ DNS-over-HTTPS with IP:
|
||||
return 'off';
|
||||
}
|
||||
|
||||
public function offWarp()
|
||||
public function offWarp($inversion = true)
|
||||
{
|
||||
$p = $this->getPacConf();
|
||||
if (empty($p['warpoff'])) {
|
||||
$this->ssh('warp-cli --accept-tos registration delete', 'wp');
|
||||
$this->ssh('pkill warp-svc', 'wp');
|
||||
$p['warpoff'] = 1;
|
||||
} else {
|
||||
if ($inversion && !empty($p['warpoff'])) {
|
||||
$this->ssh('warp-svc > /dev/null 2>&1 &', 'wp');
|
||||
sleep(3);
|
||||
if (empty($this->ssh('[ -f "/var/lib/cloudflare-warp/conf.json" ] && echo 1', 'wp'))) {
|
||||
@@ -4675,9 +4705,19 @@ DNS-over-HTTPS with IP:
|
||||
$this->send($this->input['chat'], 'Proxy mode: ' . $this->ssh('warp-cli --accept-tos mode proxy 2>&1', 'wp'));
|
||||
$this->send($this->input['chat'], 'Connect: ' . $this->ssh('warp-cli --accept-tos connect 2>&1', 'wp'));
|
||||
unset($p['warpoff']);
|
||||
} else {
|
||||
if (empty($inversion)) {
|
||||
$this->ssh('warp-cli --accept-tos registration delete 2>&1', 'wp');
|
||||
} else {
|
||||
$this->send($this->input['chat'], 'Registration delete: ' . $this->ssh('warp-cli --accept-tos registration delete 2>&1', 'wp'));
|
||||
}
|
||||
$this->ssh('pkill warp-svc', 'wp');
|
||||
$p['warpoff'] = 1;
|
||||
}
|
||||
$this->setPacConf($p);
|
||||
$this->warp();
|
||||
if (!empty($inversion)) {
|
||||
$this->warp();
|
||||
}
|
||||
}
|
||||
|
||||
public function warp()
|
||||
@@ -5513,7 +5553,7 @@ DNS-over-HTTPS with IP:
|
||||
];
|
||||
exec("git -C / branch -vv", $mm);
|
||||
return [
|
||||
'text' => '<pre><code class="language-shell">' . implode("\n", $mm) . '</code></pre>',
|
||||
'text' => '<pre><code class="language-shell">' . htmlentities(implode("\n", $mm)) . '</code></pre>',
|
||||
'data' => $data,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ $bot = new Bot($c['key'], $i);
|
||||
|
||||
$bot->selfUpdate();
|
||||
$bot->restartTG();
|
||||
$bot->offWarp(0);
|
||||
$bot->dontshowcron = 1;
|
||||
$bot->sslip();
|
||||
$bot->cleanDocker();
|
||||
|
||||
Binary file not shown.
@@ -1,3 +1,12 @@
|
||||
26.10.2024 v1.89
|
||||
- xray rulesset: фикс меню при отсутствующих правилах
|
||||
26.10.2024 v1.88
|
||||
- xray rulesset: дублирование кнопок текстом
|
||||
- singbox 1.10.1 для windows x64
|
||||
- фикс с включенным warp после апдейта
|
||||
- фикс с нерабочей кнопкой апдейта, обновится можно через /autoupdate если поймали не рабочую кнопку апдейта
|
||||
25.10.2024 v1.87
|
||||
- xray: в routes добавлен раздел proxy - зеркало раздела Pac
|
||||
25.10.2024 v1.86
|
||||
- фикс не срабатывания автобэкапа во время старта
|
||||
- adguard: вывод списка разрешенных клиентов
|
||||
|
||||
Reference in New Issue
Block a user