Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 961ebf3423 | |||
| ddcaea751f | |||
| ce8cdac7c7 | |||
| 00aae6c2f7 | |||
| 89c0139ef6 | |||
| c57053c8a0 | |||
| 3cc16469ff | |||
| e06544b00f | |||
| c5b7e1ffdc | |||
| 7d21937f04 | |||
| 16138648ca | |||
| ced10f22fa | |||
| 18a4ee39fb | |||
| 4f4777b5ef | |||
| dee90b1f4f | |||
| 01571f50e6 | |||
| 4998893234 | |||
| 95f92791b1 | |||
| cedfb66ca0 | |||
| 6215836926 | |||
| 842d76261a | |||
| 4c63ae669a | |||
| bba1ec9e17 | |||
| a798df0fd3 | |||
| d225e7c039 | |||
| 3b9b930b48 | |||
| bd17e5cd14 | |||
| c3975549db | |||
| 3087bee82d |
+2
-1
@@ -20,4 +20,5 @@ update/*
|
||||
!update/update.sh
|
||||
|
||||
override.env
|
||||
override.html
|
||||
override.html
|
||||
override.php
|
||||
+180
-53
@@ -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;
|
||||
@@ -271,6 +274,9 @@ class Bot
|
||||
case preg_match('~^/addOcUser$~', $this->input['callback'], $m):
|
||||
$this->addOcUser();
|
||||
break;
|
||||
case preg_match('~^/changeOcExpose$~', $this->input['callback'], $m):
|
||||
$this->changeOcExpose();
|
||||
break;
|
||||
case preg_match('~^/addXrUser$~', $this->input['callback'], $m):
|
||||
$this->addXrUser();
|
||||
break;
|
||||
@@ -431,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;
|
||||
@@ -1060,25 +1069,32 @@ 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 ($now - $start >= $period && ($now - $start) % $period == 0) {
|
||||
$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);
|
||||
}
|
||||
@@ -1087,6 +1103,12 @@ class Bot
|
||||
}
|
||||
}
|
||||
|
||||
public function cleanQueue(): void
|
||||
{
|
||||
$r = $this->request('deleteWebhook', []);
|
||||
$r = $this->request('getUpdates', ['offset' => -1]);
|
||||
}
|
||||
|
||||
public function pinAdmin($pin, $unpin = false)
|
||||
{
|
||||
require __DIR__ . '/config.php';
|
||||
@@ -1101,9 +1123,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']);
|
||||
}
|
||||
@@ -1293,7 +1314,7 @@ class Bot
|
||||
if (!empty($file)) {
|
||||
file_put_contents($file, $json);
|
||||
}
|
||||
$bot = $this->request('getMyName', [])['result']['name'];
|
||||
$bot = preg_replace('~[\W]~iu', '_', $this->request('getMyName', [])['result']['name']);
|
||||
return $this->upload("{$bot}_export_" . date('d_m_Y_H_i') . '.json', $json);
|
||||
}
|
||||
|
||||
@@ -1445,8 +1466,10 @@ class Bot
|
||||
$this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out));
|
||||
$this->language = $this->getPacConf()['language'] ?: 'en';
|
||||
$this->limit = $this->getPacConf()['limitpage'] ?: 5;
|
||||
sleep(3);
|
||||
$this->menu();
|
||||
if (empty($file)) {
|
||||
sleep(3);
|
||||
$this->menu();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1782,11 +1805,19 @@ class Bot
|
||||
|
||||
public function sslip()
|
||||
{
|
||||
$c = $this->getPacConf();
|
||||
if (empty($c['domain'])) {
|
||||
require __DIR__ . '/config.php';
|
||||
$p = $this->getPacConf();
|
||||
$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['callback_id'] = false;
|
||||
if (empty($p['domain'])) {
|
||||
$this->addDomain(str_replace('.', '-', $this->ip) . '.nip.io', 1);
|
||||
$this->setSSL('letsencrypt');
|
||||
}
|
||||
$this->menu();
|
||||
}
|
||||
|
||||
public function comment($text, $tag)
|
||||
@@ -2442,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();
|
||||
@@ -3322,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');
|
||||
@@ -3575,6 +3610,25 @@ DNS-over-HTTPS with IP:
|
||||
);
|
||||
}
|
||||
|
||||
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'),
|
||||
'callback_data' => "/routes",
|
||||
],
|
||||
];
|
||||
$this->update(
|
||||
$this->input['chat'],
|
||||
$this->input['message_id'],
|
||||
implode("\n", $text ?: ['...']),
|
||||
$data ?: false,
|
||||
);
|
||||
}
|
||||
|
||||
public function appOutbound()
|
||||
{
|
||||
$p = $this->getPacConf();
|
||||
@@ -3840,9 +3894,10 @@ DNS-over-HTTPS with IP:
|
||||
public function menu($type = false, $arg = false, $return = false)
|
||||
{
|
||||
$domain = $this->getPacConf()['domain'] ?: $this->ip;
|
||||
$cron = exec('pgrep -f cron.php');
|
||||
$menu = [
|
||||
'main' => [
|
||||
'text' => 'v' . getenv('VER'),
|
||||
'text' => 'v' . getenv('VER') . ($this->dontshowcron ? '' : "\ncron: " . $this->i18n($cron ? 'on' : 'off') . ($cron ? '' : ' show <code>logs/php_error</code>')),
|
||||
'data' => [
|
||||
[
|
||||
[
|
||||
@@ -4129,10 +4184,12 @@ 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];
|
||||
preg_match('~^expose-iroutes = (true)~sm', $ocserv, $m);
|
||||
$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>";
|
||||
@@ -4150,6 +4207,12 @@ DNS-over-HTTPS with IP:
|
||||
'callback_data' => "/changeOcDns",
|
||||
],
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('expose-iroutes') . ' ' . $this->i18n($expose ? 'on' : 'off'),
|
||||
'callback_data' => "/changeOcExpose",
|
||||
],
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('add peer'),
|
||||
@@ -4177,6 +4240,15 @@ DNS-over-HTTPS with IP:
|
||||
];
|
||||
}
|
||||
|
||||
public function changeOcExpose()
|
||||
{
|
||||
$c = file_get_contents('/config/ocserv.conf');
|
||||
preg_match('~^expose-iroutes = ([^\n]+)~sm', $c, $m);
|
||||
$t = preg_replace('~^expose-iroutes[^\n]+~sm', "expose-iroutes = " . ($m[1] == 'true' ? 'false' : 'true'), $c);
|
||||
$this->restartOcserv($t);
|
||||
$this->menu('oc');
|
||||
}
|
||||
|
||||
public function deloc($i)
|
||||
{
|
||||
$clients = $this->getClientsOc();
|
||||
@@ -4543,6 +4615,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",
|
||||
@@ -4614,14 +4690,17 @@ DNS-over-HTTPS with IP:
|
||||
{
|
||||
$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 {
|
||||
$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'));
|
||||
@@ -4636,7 +4715,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'),
|
||||
@@ -5005,6 +5084,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);
|
||||
}
|
||||
|
||||
@@ -5277,6 +5364,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 = [
|
||||
[
|
||||
[
|
||||
@@ -5301,6 +5393,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'),
|
||||
@@ -5338,6 +5440,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 = [];
|
||||
@@ -5545,7 +5675,11 @@ DNS-over-HTTPS with IP:
|
||||
];
|
||||
$backup = array_filter(explode('/', $conf['backup']));
|
||||
if (!empty($backup)) {
|
||||
$backup = "{$backup[0]} start / {$backup[1]} period";
|
||||
if (!empty(strtotime($backup[0])) && !empty(strtotime($backup[1]))) {
|
||||
$backup = "{$backup[0]} start / {$backup[1]} period";
|
||||
} else {
|
||||
$backup = $this->i18n('off') . " {$conf['backup']} - wrong format";
|
||||
}
|
||||
}
|
||||
$data[] = [
|
||||
[
|
||||
@@ -5692,32 +5826,21 @@ DNS-over-HTTPS with IP:
|
||||
|
||||
public function selfUpdate()
|
||||
{
|
||||
require __DIR__ . '/config.php';
|
||||
if (!empty($c['admin'])) {
|
||||
$ip = getenv('IP');
|
||||
$rm = explode(':', trim(file_get_contents('/update/reload_message')));
|
||||
$m = file_get_contents('/update/message');
|
||||
foreach ($c['admin'] as $k => $v) {
|
||||
$r = $this->send($v, "start $ip");
|
||||
$this->input['chat'] = $v;
|
||||
$this->input['message_id'] = $r['result']['message_id'];
|
||||
if (file_exists($this->update)) {
|
||||
if (!empty($m)) {
|
||||
$this->send($v, "<pre>$m</pre>", $v == $rm[0] ? $rm[1] : 0);
|
||||
}
|
||||
$r = $this->send($v, "import settings");
|
||||
$this->input['chat'] = $v;
|
||||
$this->input['message_id'] = $r['result']['message_id'];
|
||||
$this->input['callback_id'] = $r['result']['message_id'];
|
||||
if (empty($flag)) {
|
||||
$this->importFile($this->update);
|
||||
unlink($this->update);
|
||||
$flag = true;
|
||||
}
|
||||
} else {
|
||||
$this->menu();
|
||||
}
|
||||
$ip = getenv('IP');
|
||||
$rm = explode(':', trim(file_get_contents('/update/reload_message')));
|
||||
$m = file_get_contents('/update/message');
|
||||
$this->input['chat'] = $rm[0];
|
||||
$this->input['message_id'] = $rm[1];
|
||||
$this->input['callback_id'] = $rm[1];
|
||||
if (file_exists($this->update)) {
|
||||
if (!empty($m)) {
|
||||
$this->send($this->input['chat'], "<pre>$m</pre>", $rm[1]);
|
||||
}
|
||||
$r = $this->send($this->input['chat'], "import settings");
|
||||
$this->input['message_id'] = $r['result']['message_id'];
|
||||
$this->input['callback_id'] = $r['result']['message_id'];
|
||||
$this->importFile($this->update);
|
||||
unlink($this->update);
|
||||
}
|
||||
file_put_contents('/update/message', '');
|
||||
file_put_contents('/update/reload_message', '');
|
||||
@@ -5855,7 +5978,11 @@ DNS-over-HTTPS with IP:
|
||||
$c['backup'] = '';
|
||||
} else {
|
||||
[$start, $period] = explode('/', $text);
|
||||
$c['backup'] = implode(' / ', [date('Y-m-d H:i', strtotime($start)), trim($period)]);
|
||||
if (!empty(strtotime($start)) && !empty(strtotime($period))) {
|
||||
$c['backup'] = implode(' / ', [date('Y-m-d H:i', strtotime($start)), trim($period)]);
|
||||
} else {
|
||||
$this->send($this->input['from'], $this->input['message'] . ' - wrong format');
|
||||
}
|
||||
}
|
||||
if ($c['pinbackup']) {
|
||||
$this->pinAdmin($c['pinbackup'], 1);
|
||||
@@ -5973,25 +6100,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";
|
||||
|
||||
@@ -341,4 +341,8 @@ $i = [
|
||||
'en' => 'fake html',
|
||||
'ru' => 'фейк заглушка',
|
||||
],
|
||||
'expose-iroutes' => [
|
||||
'en' => 'expose-iroutes',
|
||||
'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;
|
||||
|
||||
+1
-1
@@ -10,8 +10,8 @@ if ($c['debug']) {
|
||||
}
|
||||
|
||||
$bot = new Bot($c['key'], $i);
|
||||
$bot->cleanQueue();
|
||||
$bot->setwebhook();
|
||||
$bot->selfUpdate();
|
||||
$bot->adguardCheckPswd();
|
||||
$bot->adguardProtect();
|
||||
$bot->syncPortClients();
|
||||
|
||||
@@ -12,6 +12,8 @@ if ($c['debug']) {
|
||||
|
||||
$bot = new Bot($c['key'], $i);
|
||||
|
||||
$bot->selfUpdate();
|
||||
$bot->restartTG();
|
||||
$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
|
||||
|
||||
+2
-2
@@ -180,7 +180,7 @@ server-key = /certs/cert_private
|
||||
# the isolation was tested at. If you get random failures on worker processes, try
|
||||
# disabling that option and report the failures you, along with system and debugging
|
||||
# information at: https://gitlab.com/openconnect/ocserv/issues
|
||||
isolate-workers = true
|
||||
isolate-workers = false
|
||||
|
||||
# A banner to be displayed on clients after connection
|
||||
#banner = "Welcome"
|
||||
@@ -584,7 +584,7 @@ route = default
|
||||
# When set to true, all client's iroutes are made visible to all
|
||||
# connecting clients except for the ones offering them. This option
|
||||
# only makes sense if config-per-user is set.
|
||||
#expose-iroutes = true
|
||||
expose-iroutes = false
|
||||
|
||||
# Groups that a client is allowed to select from.
|
||||
# A client may belong in multiple groups, and in certain use-cases
|
||||
|
||||
+2
-5
@@ -16,6 +16,7 @@ networks:
|
||||
- subnet: 10.10.1.0/24
|
||||
volumes:
|
||||
adguard:
|
||||
warp:
|
||||
|
||||
services:
|
||||
up:
|
||||
@@ -462,11 +463,6 @@ services:
|
||||
default:
|
||||
ipv4_address: 10.10.0.11
|
||||
logging: *default-logging
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.50'
|
||||
memory: 200M
|
||||
np:
|
||||
image: mercurykd/vpnbot-np:1.1
|
||||
build:
|
||||
@@ -515,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:
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
b:
|
||||
docker compose build
|
||||
u: # запуск контейнеров
|
||||
$(eval IP := $(shell curl -s -t 1 2ip.io || curl -s -t 1 ipinfo.io/ip || curl -s -t 1 ifconfig.me))
|
||||
bash ./update/update.sh &
|
||||
touch ./override.env
|
||||
IP=$(shell curl ipinfo.io/ip) VER=$(shell git describe --tags) docker compose --env-file ./.env --env-file ./override.env up -d --force-recreate
|
||||
IP=$(IP) VER=$(shell git describe --tags) docker compose --env-file ./.env --env-file ./override.env up -d --force-recreate
|
||||
d: # остановка контейнеров
|
||||
-kill -9 $(shell cat ./update/update_pid) > /dev/null
|
||||
docker compose down --remove-orphans
|
||||
|
||||
+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
|
||||
|
||||
@@ -1,3 +1,40 @@
|
||||
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
|
||||
- фикс двойного импорта при обновлении, когда админов больше одного
|
||||
- рестарт бота сбрасывает очередь сообщений от телеграма
|
||||
- при старте статус крона не показывается, т.к он еще не успел запуститься
|
||||
23.10.2024 v1.77
|
||||
- вывод статуса cron
|
||||
- фикс с отправкой бэкапа при спецсимволах в названии бота
|
||||
- проверка формата времени в автобэкапе
|
||||
22.10.2024 v1.76
|
||||
- улучшение определения ip бота при старте
|
||||
22.10.2024 v1.75
|
||||
- openconnect: isolate-workers = false
|
||||
21.10.2024 v1.74
|
||||
- openconnect: expose-iroutes on/off
|
||||
21.10.2024 v1.73
|
||||
- openconnect: ограничение контейнера по цпу и памяти
|
||||
21.10.2024 v1.72
|
||||
|
||||
Reference in New Issue
Block a user