diff --git a/app/bot.php b/app/bot.php index 0c3753c..a630e7c 100644 --- a/app/bot.php +++ b/app/bot.php @@ -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[] = "https://oc.{$pac['domain']}/?{$m[1]}"; + $text[] = "https://oc.{$pac['domain']}/?$cs"; } $text[] = "password: {$pac['ocserv']}"; $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", ], ];