Compare commits

...

6 Commits

Author SHA1 Message Date
mercury 16138648ca fix openconnect link 2024-10-24 21:54:37 +04:00
mercury ced10f22fa update version 2024-10-24 00:01:51 +04:00
mercury 18a4ee39fb improve selfupdate 2024-10-23 23:59:32 +04:00
mercury 4f4777b5ef improve selfupdate 2024-10-23 23:56:50 +04:00
mercury dee90b1f4f improve selfupdate 2024-10-23 23:53:58 +04:00
mercury 01571f50e6 improve selfupdate 2024-10-23 23:29:56 +04:00
4 changed files with 13 additions and 16 deletions
+8 -15
View File
@@ -1327,7 +1327,7 @@ class Bot
];
}
public function importFile($file = false, $autoupdate = false)
public function importFile($file = false)
{
if (!empty($file)) {
$json = json_decode(file_get_contents($file), true);
@@ -1367,11 +1367,7 @@ class Bot
$this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out));
$this->wg = 0;
$this->saveClients($json['wg']['clients']);
if (empty($autoupdate)) {
$this->restartWG($this->createConfig($json['wg']['server']), $switch_amnezia);
} else {
file_put_contents('/config/wg0.conf', $this->createConfig($json['wg']['server']));
}
$this->restartWG($this->createConfig($json['wg']['server']), $switch_amnezia);
$this->iptablesWG();
}
// wg1
@@ -1380,11 +1376,7 @@ class Bot
$this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out));
$this->wg = 1;
$this->saveClients($json['wg1']['clients']);
if (empty($autoupdate)) {
$this->restartWG($this->createConfig($json['wg1']['server']), $switch_wg1amnezia);
} else {
file_put_contents('/config/wg1.conf', $this->createConfig($json['wg1']['server']));
}
$this->restartWG($this->createConfig($json['wg1']['server']), $switch_wg1amnezia);
$this->iptablesWG();
}
// ad
@@ -1811,8 +1803,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');
@@ -4166,7 +4159,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>";
@@ -5766,7 +5759,7 @@ DNS-over-HTTPS with IP:
$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, 1);
$this->importFile($this->update);
unlink($this->update);
}
file_put_contents('/update/message', '');
-1
View File
@@ -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();
+1
View File
@@ -12,6 +12,7 @@ if ($c['debug']) {
$bot = new Bot($c['key'], $i);
$bot->selfUpdate();
$bot->restartTG();
$bot->dontshowcron = 1;
$bot->sslip();
+4
View File
@@ -1,3 +1,7 @@
24.10.2024 v1.84
- фикс показа ссылки для openconnect
24.10.2024 v1.83
- фикс ошибок доступа контейнеров при автообновлении
23.10.2024 v1.82
- фикс автобэкапа
23.10.2024 v1.81