Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ef0de6e1c | |||
| 1cf24407c0 | |||
| d3470bd8ea | |||
| 1fcddf49e3 | |||
| a0d9bada2b | |||
| 32109c4526 | |||
| ca37736cd5 | |||
| 1c4fff50d1 | |||
| 6ffb4d0a79 | |||
| 394062cbe0 | |||
| dd8897575f | |||
| 9ab05de320 | |||
| 71f7db5bac | |||
| 237da68f14 | |||
| 961ebf3423 | |||
| ddcaea751f | |||
| ce8cdac7c7 | |||
| 00aae6c2f7 | |||
| 89c0139ef6 | |||
| c57053c8a0 | |||
| 3cc16469ff | |||
| e06544b00f | |||
| c5b7e1ffdc | |||
| 7d21937f04 | |||
| 16138648ca | |||
| ced10f22fa | |||
| 18a4ee39fb | |||
| 4f4777b5ef | |||
| dee90b1f4f | |||
| 01571f50e6 | |||
| 4998893234 | |||
| 95f92791b1 | |||
| cedfb66ca0 | |||
| 6215836926 |
+2
-1
@@ -20,4 +20,5 @@ update/*
|
||||
!update/update.sh
|
||||
|
||||
override.env
|
||||
override.html
|
||||
override.html
|
||||
override.php
|
||||
+178
-42
@@ -142,6 +142,9 @@ class Bot
|
||||
case preg_match('~^/autoupdate$~', $this->input['message'], $m):
|
||||
$this->autoupdate();
|
||||
break;
|
||||
case preg_match('~^/adgFillAllowedClients(?: (\d+))?$~', $this->input['callback'], $m):
|
||||
$this->adgFillAllowedClients($m[1] ?: false);
|
||||
break;
|
||||
case preg_match('~^/appOutbound$~', $this->input['callback'], $m):
|
||||
$this->appOutbound();
|
||||
break;
|
||||
@@ -398,6 +401,9 @@ class Bot
|
||||
case preg_match('~^/deldomain$~', $this->input['callback'], $m):
|
||||
$this->delDomain();
|
||||
break;
|
||||
case preg_match('~^/addNipdomain$~', $this->input['callback'], $m):
|
||||
$this->addNipdomain();
|
||||
break;
|
||||
case preg_match('~^/(?P<action>change|delete)(?P<typelist>\w+) (?P<arg>\d+)$~', $this->input['callback'], $m):
|
||||
$this->listPacChange($m['typelist'], $m['action'], $m['arg']);
|
||||
break;
|
||||
@@ -434,6 +440,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;
|
||||
@@ -446,6 +455,9 @@ class Bot
|
||||
case preg_match('~^/delTemplate (\w+)(?: (.+))?$~', $this->input['callback'], $m):
|
||||
$this->delTemplate($m[1], $m[2]);
|
||||
break;
|
||||
case preg_match('~^/downloadOrigin (\w+)$~', $this->input['callback'], $m):
|
||||
$this->downloadOrigin($m[1]);
|
||||
break;
|
||||
case preg_match('~^/downloadTemplate (\w+)(?: (.+))?$~', $this->input['callback'], $m):
|
||||
$this->downloadTemplate($m[1], $m[2]);
|
||||
break;
|
||||
@@ -1063,36 +1075,41 @@ class Bot
|
||||
|
||||
public function cron()
|
||||
{
|
||||
$period = 10;
|
||||
while (true) {
|
||||
$this->shutdownClient();
|
||||
$this->shutdownClientXr();
|
||||
$this->checkVersion();
|
||||
$this->checkBackup();
|
||||
$this->checkBackup($period);
|
||||
$this->checkCert();
|
||||
sleep(10);
|
||||
sleep($period);
|
||||
}
|
||||
}
|
||||
|
||||
public function checkBackup()
|
||||
public function checkBackup($delta)
|
||||
{
|
||||
$c = $this->getPacConf();
|
||||
$now = strtotime(date('Y-m-d H:i'));
|
||||
if (!empty($c['backup'])) {
|
||||
$now = strtotime(date('Y-m-d H:i:s'));
|
||||
[$start, $period] = explode('/', $c['backup']);
|
||||
$start = strtotime($start);
|
||||
$period = strtotime($period, 0);
|
||||
if (!empty($start) && !empty($period)) {
|
||||
if ($now - $start >= $period && ($now - $start) % $period == 0) {
|
||||
if (!empty($c['pinbackup'])) {
|
||||
$this->pinAdmin($c['pinbackup'], 1);
|
||||
}
|
||||
$this->pinBackup();
|
||||
$start = strtotime(trim($start));
|
||||
$period = strtotime(trim($period), 0);
|
||||
if (
|
||||
!empty($start)
|
||||
&& !empty($period)
|
||||
&& empty($this->backup)
|
||||
&& $now - $start >= 0
|
||||
&& (($now - $start) % $period < $delta)
|
||||
) {
|
||||
if (!empty($c['pinbackup'])) {
|
||||
$this->pinAdmin($c['pinbackup'], 1);
|
||||
}
|
||||
$this->pinBackup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function cleanQueue()
|
||||
public function cleanQueue(): void
|
||||
{
|
||||
$r = $this->request('deleteWebhook', []);
|
||||
$r = $this->request('getUpdates', ['offset' => -1]);
|
||||
@@ -1112,9 +1129,8 @@ class Bot
|
||||
{
|
||||
require __DIR__ . '/config.php';
|
||||
$conf = $this->getPacConf();
|
||||
$bot = $this->request('getMyName', [])['result']['name'];
|
||||
$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['backup'] = implode(' / ', [date('Y-m-d H:i'), trim(explode('/', $conf['backup'])[1])]);
|
||||
$this->setPacConf($conf);
|
||||
$this->pinAdmin($conf['pinbackup']);
|
||||
}
|
||||
@@ -1755,6 +1771,11 @@ class Bot
|
||||
}
|
||||
}
|
||||
|
||||
public function addNipdomain()
|
||||
{
|
||||
$this->addDomain(str_replace('.', '-', $this->ip) . '.nip.io');
|
||||
}
|
||||
|
||||
public function addDomain($domain, $nomenu = false)
|
||||
{
|
||||
$domain = trim($domain);
|
||||
@@ -1800,8 +1821,9 @@ class Bot
|
||||
$ip = getenv('IP');
|
||||
$r = $this->send($c['admin'][0], "start $ip");
|
||||
|
||||
$this->input['chat'] = $c['admin'][0];
|
||||
$this->input['message_id'] = $r['result']['message_id'];
|
||||
$this->input['chat'] = $c['admin'][0];
|
||||
$this->input['message_id'] = $r['result']['message_id'];
|
||||
$this->input['callback_id'] = false;
|
||||
if (empty($p['domain'])) {
|
||||
$this->addDomain(str_replace('.', '-', $this->ip) . '.nip.io', 1);
|
||||
$this->setSSL('letsencrypt');
|
||||
@@ -2462,7 +2484,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();
|
||||
@@ -3342,6 +3367,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');
|
||||
@@ -3422,7 +3448,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'),
|
||||
@@ -3561,7 +3587,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'),
|
||||
@@ -3580,7 +3606,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'),
|
||||
@@ -3615,7 +3660,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[] = [
|
||||
[
|
||||
@@ -3641,7 +3686,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[] = [
|
||||
[
|
||||
@@ -3667,7 +3712,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'),
|
||||
@@ -3698,6 +3744,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)),
|
||||
@@ -3744,7 +3793,7 @@ DNS-over-HTTPS with IP:
|
||||
],
|
||||
];
|
||||
}
|
||||
return $data;
|
||||
return [$data, $text];
|
||||
}
|
||||
|
||||
public function listPacChange($type, $action, $key)
|
||||
@@ -4155,7 +4204,7 @@ DNS-over-HTTPS with IP:
|
||||
$expose = $m[1];
|
||||
$pass = htmlspecialchars($pac['ocserv']);
|
||||
$text[] = "Menu -> OpenConnect";
|
||||
if (!empty($m[1])) {
|
||||
if (!empty($cs)) {
|
||||
$text[] = "<code>https://oc.$domain/?$cs</code>";
|
||||
}
|
||||
$text[] = "password: <span class='tg-spoiler'>$pass</span>";
|
||||
@@ -4369,6 +4418,19 @@ DNS-over-HTTPS with IP:
|
||||
$this->templates($type);
|
||||
}
|
||||
|
||||
public function downloadOrigin($type)
|
||||
{
|
||||
switch ($type) {
|
||||
case 'sing':
|
||||
$f = new \CURLFile('/config/sing.json', 'application/json', 'origin.json');
|
||||
break;
|
||||
case 'v2ray':
|
||||
$f = new \CURLFile('/config/v2ray.json', 'application/json', 'origin.json');
|
||||
break;
|
||||
}
|
||||
$this->sendFile($this->input['chat'], $f);
|
||||
}
|
||||
|
||||
public function downloadTemplate($type, $name)
|
||||
{
|
||||
$pac = $this->getPacConf();
|
||||
@@ -4407,6 +4469,10 @@ DNS-over-HTTPS with IP:
|
||||
'text' => "origin",
|
||||
'web_app' => ['url' => "https://$domain/pac?h=$hash&t=te&ty=$type"],
|
||||
],
|
||||
[
|
||||
'text' => $this->i18n('download'),
|
||||
'callback_data' => "/downloadOrigin $type",
|
||||
],
|
||||
[
|
||||
'text' => $this->i18n($pac["default{$type}template"] && !empty($pac["{$type}templates"][base64_decode($pac["default{$type}template"])]) ? 'off' : 'on'),
|
||||
'callback_data' => "/defaultTemplate $type",
|
||||
@@ -4415,7 +4481,7 @@ DNS-over-HTTPS with IP:
|
||||
foreach ($templates as $k => $v) {
|
||||
$data[] = [
|
||||
[
|
||||
'text' => "$k",
|
||||
'text' => $k,
|
||||
'web_app' => ['url' => "https://$domain/pac?h=$hash&t=te&ty=$type&te=" . urlencode($k)],
|
||||
],
|
||||
[
|
||||
@@ -4581,6 +4647,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",
|
||||
@@ -4650,23 +4720,33 @@ DNS-over-HTTPS with IP:
|
||||
|
||||
public function offWarp()
|
||||
{
|
||||
$p = $this->getPacConf();
|
||||
if (empty($p['warpoff'])) {
|
||||
$this->ssh('pkill warp-svc', 'wp');
|
||||
$p['warpoff'] = 1;
|
||||
} else {
|
||||
$p = $this->getPacConf();
|
||||
if (!empty($this->selfupdate)) {
|
||||
if (!empty($p['warpoff'])) {
|
||||
$this->ssh('warp-cli --accept-tos registration delete 2>&1', 'wp');
|
||||
$this->ssh('pkill warp-svc', 'wp');
|
||||
}
|
||||
} elseif (!empty($p['warpoff'])) {
|
||||
$this->ssh('warp-svc > /dev/null 2>&1 &', 'wp');
|
||||
sleep(3);
|
||||
$this->send($this->input['chat'], 'Registration: ' . $this->ssh('warp-cli --accept-tos registration new 2>&1', 'wp'));
|
||||
if (!empty($p['warp'])) {
|
||||
$this->send($this->input['chat'], 'License: ' . $this->ssh("warp-cli --accept-tos registration license {$p['warp']} 2>&1", 'wp'));
|
||||
if (empty($this->ssh('[ -f "/var/lib/cloudflare-warp/conf.json" ] && echo 1', 'wp'))) {
|
||||
$this->send($this->input['chat'], 'Registration: ' . $this->ssh('warp-cli --accept-tos registration new 2>&1', 'wp'));
|
||||
if (!empty($p['warp'])) {
|
||||
$this->send($this->input['chat'], 'License: ' . $this->ssh("warp-cli --accept-tos registration license {$p['warp']} 2>&1", 'wp'));
|
||||
}
|
||||
}
|
||||
$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 {
|
||||
$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($this->selfupdate)) {
|
||||
$this->warp();
|
||||
}
|
||||
}
|
||||
|
||||
public function warp()
|
||||
@@ -4674,7 +4754,7 @@ DNS-over-HTTPS with IP:
|
||||
$p = $this->getPacConf();
|
||||
$text[] = "Menu -> " . $this->i18n('warp');
|
||||
$text[] = "status: " . $this->warpStatus();
|
||||
$text[] = "key: " . $this->getPacConf()['warp'];
|
||||
$text[] = "key: <code>{$this->getPacConf()['warp']}</code>";
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n($p['warpoff'] ? 'off' : 'on'),
|
||||
@@ -5043,6 +5123,14 @@ DNS-over-HTTPS with IP:
|
||||
}
|
||||
$json['routing']['rules'] = array_values($json['routing']['rules']);
|
||||
}
|
||||
if (!empty($json['route']['rules'])) {
|
||||
foreach ($json['route']['rules'] as $k => $v) {
|
||||
if (count($v) < 2) {
|
||||
unset($json['route']['rules'][$k]);
|
||||
}
|
||||
}
|
||||
$json['route']['rules'] = array_values($json['route']['rules']);
|
||||
}
|
||||
return json_encode($json);
|
||||
}
|
||||
|
||||
@@ -5315,6 +5403,11 @@ DNS-over-HTTPS with IP:
|
||||
$text .= "DNS over HTTPS:\n<code>$ip</code>\n<code>$scheme://$domain/dns-query" . ($conf['adguardkey'] ? "/{$conf['adguardkey']}" : '') . "</code>\n\n";
|
||||
$text .= "DNS over TLS:\n<code>tls://" . ($conf['adguardkey'] ? "{$conf['adguardkey']}." : '') . "$domain</code>";
|
||||
}
|
||||
$safesearch = yaml_parse_file($this->adguard)['filtering']['safe_search']['enabled'];
|
||||
$text .= "\n\nsafesearch: " . $this->i18n($safesearch ? 'on' : 'off');
|
||||
$allowedClients = yaml_parse_file($this->adguard)['dns']['allowed_clients'];
|
||||
$text .= $allowedClients ? "\n\nallowed clients: \n - " . implode("\n - ", $allowedClients) : '';
|
||||
|
||||
$data = [
|
||||
[
|
||||
[
|
||||
@@ -5339,6 +5432,16 @@ DNS-over-HTTPS with IP:
|
||||
],
|
||||
],
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('fill allowed clients'),
|
||||
'callback_data' => "/adgFillAllowedClients 0",
|
||||
],
|
||||
[
|
||||
'text' => $this->i18n('delete allowed clients'),
|
||||
'callback_data' => "/adgFillAllowedClients 1",
|
||||
],
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('add upstream'),
|
||||
@@ -5376,6 +5479,34 @@ DNS-over-HTTPS with IP:
|
||||
];
|
||||
}
|
||||
|
||||
public function adgFillAllowedClients($delete = false)
|
||||
{
|
||||
$pac = $this->getPacConf();
|
||||
$out[] = 'Restart Adguard Home';
|
||||
$this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out));
|
||||
$this->stopAd();
|
||||
$c = yaml_parse_file($this->adguard);
|
||||
if (!empty($delete)) {
|
||||
unset($c['dns']['allowed_clients']);
|
||||
} else {
|
||||
$c['dns']['allowed_clients'] = [];
|
||||
if (!empty($pac['adguardKey'])) {
|
||||
$c['dns']['allowed_clients'][] = $pac['adguardKey'];
|
||||
}
|
||||
$c['dns']['allowed_clients'][] = getenv('WGADDRESS');
|
||||
$c['dns']['allowed_clients'][] = getenv('WG1ADDRESS');
|
||||
$c['dns']['allowed_clients'][] = '10.0.2.0/24'; // openconnect
|
||||
if (!empty($xr = $this->getXray())) {
|
||||
foreach ($xr['inbounds'][0]['settings']['clients'] as $v) {
|
||||
$c['dns']['allowed_clients'][] = $v['id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
yaml_emit_file($this->adguard, $c);
|
||||
$this->startAd();
|
||||
$this->menu('adguard');
|
||||
}
|
||||
|
||||
public function menuLang()
|
||||
{
|
||||
$data = [];
|
||||
@@ -5451,7 +5582,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,
|
||||
];
|
||||
}
|
||||
@@ -5495,6 +5626,10 @@ DNS-over-HTTPS with IP:
|
||||
'text' => $this->i18n('+ subdomain'),
|
||||
'callback_data' => '/addSubdomain',
|
||||
],
|
||||
[
|
||||
'text' => $this->i18n('nip.io'),
|
||||
'callback_data' => '/addNipdomain',
|
||||
],
|
||||
],
|
||||
];
|
||||
if ($conf['domain']) {
|
||||
@@ -5741,6 +5876,7 @@ DNS-over-HTTPS with IP:
|
||||
$this->input['message_id'] = $rm[1];
|
||||
$this->input['callback_id'] = $rm[1];
|
||||
if (file_exists($this->update)) {
|
||||
$this->selfupdate = true;
|
||||
if (!empty($m)) {
|
||||
$this->send($this->input['chat'], "<pre>$m</pre>", $rm[1]);
|
||||
}
|
||||
@@ -6008,25 +6144,25 @@ DNS-over-HTTPS with IP:
|
||||
|
||||
public function createConfig($data)
|
||||
{
|
||||
$pac = $this->getPacConf();
|
||||
$conf[] = "[Interface]";
|
||||
if (empty($data['interface']['ListenPort'])) {
|
||||
if (empty($data['interface']['DNS'])) {
|
||||
$data['interface']['DNS'] = $this->getPacConf()[$this->getInstanceWG(1) . 'dns'] ?: $this->dns;
|
||||
$data['interface']['DNS'] = $pac[$this->getInstanceWG(1) . 'dns'] ?: $this->dns;
|
||||
}
|
||||
if (empty($data['interface']['MTU'])) {
|
||||
$data['interface']['MTU'] = $this->getPacConf()[$this->getInstanceWG(1) . 'mtu'] ?: $this->mtu;
|
||||
$data['interface']['MTU'] = $pac[$this->getInstanceWG(1) . 'mtu'] ?: $this->mtu;
|
||||
}
|
||||
}
|
||||
foreach ($data['interface'] as $k => $v) {
|
||||
$conf[] = "$k = $v";
|
||||
}
|
||||
$pac = $this->getPacConf();
|
||||
if (!empty($data['peers'])) {
|
||||
foreach ($data['peers'] as $peer) {
|
||||
$conf[] = '';
|
||||
$conf[] = $peer['# PublicKey'] ? '# [Peer]' : '[Peer]';
|
||||
if (!empty($peer['Endpoint'])) {
|
||||
$peer['Endpoint'] = ($this->getPacConf()[$this->getInstanceWG(1) . 'endpoint'] ? $this->ip : $this->getDomain()) . ":" . getenv($this->getInstanceWG(1) ? 'WG1PORT' : 'WGPORT');
|
||||
$peer['Endpoint'] = ($pac[$this->getInstanceWG(1) . 'endpoint'] ? $this->ip : $this->getDomain()) . ":" . getenv($this->getInstanceWG(1) ? 'WG1PORT' : 'WGPORT');
|
||||
}
|
||||
foreach ($peer as $k => $v) {
|
||||
$conf[] = "$k = $v";
|
||||
|
||||
+10
-2
@@ -282,8 +282,8 @@ $i = [
|
||||
'ru' => 'пагинация',
|
||||
],
|
||||
'exchange' => [
|
||||
'en' => 'open ip',
|
||||
'ru' => 'откр айпи',
|
||||
'en' => 'client isolation',
|
||||
'ru' => 'изоляция клиентов',
|
||||
],
|
||||
'ocserv' => [
|
||||
'en' => 'OpenConnect',
|
||||
@@ -345,4 +345,12 @@ $i = [
|
||||
'en' => 'expose-iroutes',
|
||||
'ru' => 'изоляция клиентов',
|
||||
],
|
||||
'fill allowed clients' => [
|
||||
'en' => 'fill allowed clients',
|
||||
'ru' => 'заполнить белый список клиентов',
|
||||
],
|
||||
'delete allowed clients' => [
|
||||
'en' => 'delete allowed clients',
|
||||
'ru' => 'очистить белый список клиентов',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -11,6 +11,9 @@ if ('POST' == $_SERVER['REQUEST_METHOD'] && $_GET['k'] == $c['key']) {
|
||||
require __DIR__ . '/calc.php';
|
||||
require __DIR__ . '/bot.php';
|
||||
require __DIR__ . '/i18n.php';
|
||||
if (file_exists(__DIR__ . '/override.php')) {
|
||||
include __DIR__ . '/override.php';
|
||||
}
|
||||
$bot = new Bot($c['key'], $i);
|
||||
$bot->input();
|
||||
exit;
|
||||
|
||||
@@ -12,7 +12,6 @@ if ($c['debug']) {
|
||||
$bot = new Bot($c['key'], $i);
|
||||
$bot->cleanQueue();
|
||||
$bot->setwebhook();
|
||||
$bot->selfUpdate();
|
||||
$bot->adguardCheckPswd();
|
||||
$bot->adguardProtect();
|
||||
$bot->syncPortClients();
|
||||
|
||||
@@ -12,7 +12,11 @@ if ($c['debug']) {
|
||||
|
||||
$bot = new Bot($c['key'], $i);
|
||||
|
||||
$bot->selfUpdate();
|
||||
$bot->restartTG();
|
||||
if (!empty($bot->selfupdate)) {
|
||||
$bot->offWarp();
|
||||
}
|
||||
$bot->dontshowcron = 1;
|
||||
$bot->sslip();
|
||||
$bot->cleanDocker();
|
||||
|
||||
@@ -16,5 +16,8 @@ dns:
|
||||
tls:
|
||||
certificate_path: /certs/cert_public
|
||||
private_key_path: /certs/cert_private
|
||||
filtering:
|
||||
safe_search:
|
||||
enabled: false
|
||||
log:
|
||||
file: /logs/adguard
|
||||
|
||||
@@ -16,6 +16,7 @@ networks:
|
||||
- subnet: 10.10.1.0/24
|
||||
volumes:
|
||||
adguard:
|
||||
warp:
|
||||
|
||||
services:
|
||||
up:
|
||||
@@ -510,6 +511,7 @@ services:
|
||||
- ./config:/config
|
||||
- ./certs:/certs
|
||||
- ./scripts/start_wp.sh:/start_wp.sh
|
||||
- warp:/var/lib/cloudflare-warp
|
||||
hostname: warp
|
||||
container_name: warp-${VER}
|
||||
depends_on:
|
||||
|
||||
+6
-3
@@ -7,10 +7,13 @@ if [ "$off" == 'null' ]
|
||||
then
|
||||
warp-svc > /dev/null &
|
||||
sleep 3
|
||||
warp-cli --accept-tos registration new
|
||||
if [ ! -z "$key" ]
|
||||
if [ ! -f /var/lib/cloudflare-warp/conf.json ]
|
||||
then
|
||||
warp-cli --accept-tos registration license $key
|
||||
warp-cli --accept-tos registration new
|
||||
if [ ! -z "$key" ]
|
||||
then
|
||||
warp-cli --accept-tos registration license $key
|
||||
fi
|
||||
fi
|
||||
warp-cli --accept-tos mode proxy
|
||||
warp-cli --accept-tos connect
|
||||
|
||||
Binary file not shown.
@@ -1,3 +1,38 @@
|
||||
30.10.2024 v1.92
|
||||
- возможность скачать origin шаблон
|
||||
30.10.2024 v1.91
|
||||
- кнопка nip.io для быстрой смены домена
|
||||
27.10.2024 v1.90
|
||||
- очередной фикс запуска warp после апдейта
|
||||
- правки фраз меню
|
||||
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: вывод списка разрешенных клиентов
|
||||
- adguard: кнопка заполнения разрешенных клиентов - собирает все clientId со всех контейнеров
|
||||
- adguard: вывод статуса безопасного поиска
|
||||
- warp: при выключении удаляется регистрация deviceid
|
||||
24.10.2024 v1.85
|
||||
- фикс удаления состояния warp после рестарта
|
||||
- возможность перезаписать фразы меню бота через app/override.php
|
||||
24.10.2024 v1.84
|
||||
- фикс показа ссылки для openconnect
|
||||
24.10.2024 v1.83
|
||||
- фикс ошибок доступа контейнеров при автообновлении
|
||||
23.10.2024 v1.82
|
||||
- фикс автобэкапа
|
||||
23.10.2024 v1.81
|
||||
- фикс краша wireguard после апдейта
|
||||
23.10.2024 v1.80
|
||||
- фикс пустых правил для singbox
|
||||
23.10.2024 v1.79
|
||||
- улучшение процесса обновления
|
||||
23.10.2024 v1.78
|
||||
|
||||
Reference in New Issue
Block a user