Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1cf24407c0 | |||
| d3470bd8ea | |||
| 1fcddf49e3 | |||
| a0d9bada2b | |||
| 32109c4526 |
+23
-9
@@ -401,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;
|
||||
@@ -1765,6 +1768,11 @@ class Bot
|
||||
}
|
||||
}
|
||||
|
||||
public function addNipdomain()
|
||||
{
|
||||
$this->addDomain(str_replace('.', '-', $this->ip) . '.nip.io');
|
||||
}
|
||||
|
||||
public function addDomain($domain, $nomenu = false)
|
||||
{
|
||||
$domain = trim($domain);
|
||||
@@ -4690,10 +4698,15 @@ DNS-over-HTTPS with IP:
|
||||
return 'off';
|
||||
}
|
||||
|
||||
public function offWarp($inversion = true)
|
||||
public function offWarp()
|
||||
{
|
||||
$p = $this->getPacConf();
|
||||
if ($inversion && !empty($p['warpoff'])) {
|
||||
$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);
|
||||
if (empty($this->ssh('[ -f "/var/lib/cloudflare-warp/conf.json" ] && echo 1', 'wp'))) {
|
||||
@@ -4706,16 +4719,12 @@ DNS-over-HTTPS with IP:
|
||||
$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->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);
|
||||
if (!empty($inversion)) {
|
||||
if (empty($this->selfupdate)) {
|
||||
$this->warp();
|
||||
}
|
||||
}
|
||||
@@ -5597,6 +5606,10 @@ DNS-over-HTTPS with IP:
|
||||
'text' => $this->i18n('+ subdomain'),
|
||||
'callback_data' => '/addSubdomain',
|
||||
],
|
||||
[
|
||||
'text' => $this->i18n('nip.io'),
|
||||
'callback_data' => '/addNipdomain',
|
||||
],
|
||||
],
|
||||
];
|
||||
if ($conf['domain']) {
|
||||
@@ -5843,6 +5856,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]);
|
||||
}
|
||||
|
||||
+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' => 'очистить белый список клиентов',
|
||||
],
|
||||
];
|
||||
|
||||
+3
-1
@@ -14,7 +14,9 @@ $bot = new Bot($c['key'], $i);
|
||||
|
||||
$bot->selfUpdate();
|
||||
$bot->restartTG();
|
||||
$bot->offWarp(0);
|
||||
if (!empty($bot->selfupdate)) {
|
||||
$bot->offWarp();
|
||||
}
|
||||
$bot->dontshowcron = 1;
|
||||
$bot->sslip();
|
||||
$bot->cleanDocker();
|
||||
|
||||
Reference in New Issue
Block a user