show dns openconnect

This commit is contained in:
mercury
2024-02-06 15:19:34 +04:00
parent eb6348e35e
commit b6789f2acc
+8 -4
View File
@@ -2817,11 +2817,15 @@ DNS-over-HTTPS with IP:
public function ocMenu()
{
$pac = $this->getPacConf();
preg_match('~^camouflage_secret[^\n]+?"([^"]+)*"~sm', file_get_contents('/config/ocserv.conf'), $m);
$pac = $this->getPacConf();
$ocserv = file_get_contents('/config/ocserv.conf');
preg_match('~^camouflage_secret[^\n]+?"([^"]+)*"~sm', $ocserv, $m);
$cs = $m[1];
preg_match('~^dns = ([^\n]+)~sm', $ocserv, $m);
$dns = $m[1];
$text[] = "Menu -> OpenConnect";
if (!empty($m[1])) {
$text[] = "<code>https://oc.{$pac['domain']}/?{$m[1]}</code>";
$text[] = "<code>https://oc.{$pac['domain']}/?$cs</code>";
}
$text[] = "password: <span class='tg-spoiler'>{$pac['ocserv']}</span>";
$data[] = [
@@ -2834,7 +2838,7 @@ DNS-over-HTTPS with IP:
'callback_data' => "/changeOcPass",
],
[
'text' => $this->i18n('dns'),
'text' => $this->i18n('dns') . ": $dns",
'callback_data' => "/changeOcDns",
],
];