Compare commits

...

4 Commits

Author SHA1 Message Date
mercury 8e8babe1a6 update version 2025-12-16 00:58:02 +04:00
mercury 238c380f23 fix clash template rules behavior 2025-12-16 00:55:44 +04:00
mercury abc2e7c587 setting up dnstt display in menu 2025-12-16 00:38:34 +04:00
mercury 3f99d9fbf0 hide dnstt 2025-12-15 17:06:19 +04:00
3 changed files with 121 additions and 81 deletions
+116 -78
View File
@@ -320,8 +320,11 @@ class Bot
case preg_match('~^/logs$~', $this->input['callback'], $m):
$this->logs();
break;
case preg_match('~^/dnstt$~', $this->input['callback'], $m):
$this->dnstt();
case preg_match('~^/dnstt$~', $this->input['callback'] ?: $this->input['message'], $m):
$this->dnstt(!empty($this->input['callback']));
break;
case preg_match('~^/showdnstt$~', $this->input['callback'], $m):
$this->showdnstt();
break;
case preg_match('~^/dnsttDownload$~', $this->input['callback'], $m):
$this->dnsttDownload();
@@ -1236,7 +1239,11 @@ class Bot
public function chhypass($pass)
{
$pac = $this->getPacConf();
$pac['hysteria_pass'] = $pass;
if (!empty($pass)) {
$pac['hysteria_pass'] = $pass;
} else {
unset($pac['hysteria_pass']);
}
$this->setPacConf($pac);
$this->restartHysteria();
$this->menu('hy');
@@ -4696,11 +4703,25 @@ DNS-over-HTTPS with IP:
$this->sendFile($this->input['from'], curl_file_create('/config/dnstt/server.pub'));
}
public function dnstt()
public function showdnstt()
{
$c = $this->getPacConf();
$c['showdnstt'] = empty($c['showdnstt']);
$this->setPacConf($c);
$this->dnstt(1);
}
public function dnstt($update = false)
{
$c = $this->getPacConf();
$pubkey = file_get_contents('/config/dnstt/server.pub');
$text[] = "dnstt";
$data[] = [
[
'text' => $this->i18n('show in menu ') . $this->i18n($c['showdnstt'] ? 'on' : 'off'),
'callback_data' => "/showdnstt",
],
];
if (!empty($c['dnsttDomain']) && !empty($c['dnsttPassword'])) {
$text[] = "<pre>set the NS record for {$c['dnsttDomain']}: tns.{$c['domain']}\nset A record for tns.{$c['domain']}: {$this->ip}</pre>";
$text[] = "account: <code>vpnbot:{$c['dnsttPassword']}</code>";
@@ -4734,12 +4755,21 @@ DNS-over-HTTPS with IP:
'callback_data' => "/menu",
],
];
$this->update(
$this->input['chat'],
$this->input['message_id'],
implode("\n", $text),
$data ?: false,
);
if ($update) {
$this->update(
$this->input['chat'],
$this->input['message_id'],
implode("\n", $text),
$data ?: false,
);
} else {
$this->send(
$this->input['chat'],
implode("\n", $text),
$this->input['message_id'],
$data ?: false,
);
}
}
public function menu($type = false, $arg = false, $return = false)
@@ -4842,86 +4872,94 @@ DNS-over-HTTPS with IP:
$menu = [
'main' => [
'text' => implode("\n", $main ?: []),
'data' => [
'data' => array_merge(
[
[
'text' => $this->i18n($this->getPacConf()['amnezia'] ? 'amnezia' : 'wg_title'),
'callback_data' => "/changeWG 0",
[
'text' => $this->i18n($this->getPacConf()['amnezia'] ? 'amnezia' : 'wg_title'),
'callback_data' => "/changeWG 0",
],
[
'text' => $this->i18n($this->getPacConf()['wg1_amnezia'] ? 'amnezia' : 'wg_title'),
'callback_data' => "/changeWG 1",
],
],
[
'text' => $this->i18n($this->getPacConf()['wg1_amnezia'] ? 'amnezia' : 'wg_title'),
'callback_data' => "/changeWG 1",
[
'text' => $this->i18n('xray'),
'callback_data' => "/xray",
],
[
'text' => $this->i18n('naive'),
'callback_data' => "/menu naive",
],
],
[
[
'text' => $this->i18n('ocserv'),
'callback_data' => "/menu oc",
],
[
'text' => $this->i18n('mtproto'),
'callback_data' => "/mtproto",
],
],
[
[
'text' => $this->i18n('ad_title'),
'callback_data' => "/menu adguard",
],
[
'text' => $this->i18n('warp'),
'callback_data' => "/warp",
],
],
[
[
'text' => $this->i18n('sh_title'),
'callback_data' => "/menu ss",
],
[
'text' => $this->i18n('pac'),
'callback_data' => "/pacMenu 0",
],
],
],
[array_merge(
[
[
'text' => $this->i18n('Hysteria'),
'callback_data' => "/menu hy",
],
],
$conf['showdnstt'] ? [
[
'text' => $this->i18n('DNSTT'),
'callback_data' => "/dnstt",
],
] : [],
)],
[
[
'text' => $this->i18n('xray'),
'callback_data' => "/xray",
[
'text' => $this->i18n('config'),
'callback_data' => "/menu config",
],
],
[
'text' => $this->i18n('naive'),
'callback_data' => "/menu naive",
[
'text' => $this->i18n('chat'),
'url' => base64_decode('aHR0cHM6Ly90Lm1lLys0RzMtUTRkX3ZGRXhPRGN5'),
],
[
'text' => $this->i18n('donate'),
'web_app' => [
'url' => "https://$domain/webapp$hash/donate.html",
]
],
],
],
[
[
'text' => $this->i18n('ocserv'),
'callback_data' => "/menu oc",
],
[
'text' => $this->i18n('mtproto'),
'callback_data' => "/mtproto",
],
],
[
[
'text' => $this->i18n('ad_title'),
'callback_data' => "/menu adguard",
],
[
'text' => $this->i18n('warp'),
'callback_data' => "/warp",
],
],
[
[
'text' => $this->i18n('sh_title'),
'callback_data' => "/menu ss",
],
[
'text' => $this->i18n('pac'),
'callback_data' => "/pacMenu 0",
],
],
[
[
'text' => $this->i18n('Hysteria'),
'callback_data' => "/menu hy",
],
[
'text' => $this->i18n('DNSTT'),
'callback_data' => "/dnstt",
],
],
[
[
'text' => $this->i18n('config'),
'callback_data' => "/menu config",
],
],
[
[
'text' => $this->i18n('chat'),
'url' => base64_decode('aHR0cHM6Ly90Lm1lLys0RzMtUTRkX3ZGRXhPRGN5'),
],
[
'text' => $this->i18n('donate'),
'web_app' => [
'url' => "https://$domain/webapp$hash/donate.html",
]
],
],
],
)
],
'wg' => $type == 'wg' ? $this->statusWg($arg) : false,
'client' => $type == 'client' ? $this->getClient(...explode('_', $arg)) : false,
+3 -3
View File
@@ -99,7 +99,7 @@
"list": "~block~",
"action": "REJECT",
"interval": 60,
"behavior": "domain",
"behavior": "classical",
"name": "block"
},
{
@@ -131,7 +131,7 @@
"list": "~pac~",
"action": "PROXY",
"interval": 60,
"behavior": "domain",
"behavior": "classical",
"name": "pac"
},
{
@@ -139,7 +139,7 @@
"list": "~subnet~",
"action": "PROXY",
"interval": 60,
"behavior": "ipcidr",
"behavior": "classical",
"name": "subnet"
},
{
+2
View File
@@ -1,3 +1,5 @@
16.12.2025 v2.28.1
- фикс шаблона mihomo
15.12.2025 v2.28
- новый MTProto
- hysteria