Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bb83ab0684 | |||
| 05267f44be |
+13
-7
@@ -3281,7 +3281,7 @@ DNS-over-HTTPS with IP:
|
||||
'callback_data' => "/menu ss",
|
||||
],
|
||||
[
|
||||
'text' => $this->i18n('warp'),
|
||||
'text' => $this->i18n('warp') . ': ' . $this->warpStatus(),
|
||||
'callback_data' => "/warp",
|
||||
],
|
||||
],
|
||||
@@ -3699,7 +3699,7 @@ DNS-over-HTTPS with IP:
|
||||
'web_app' => ['url' => "https://$domain/pac?h=$hash&t=te&ty=$type"],
|
||||
],
|
||||
[
|
||||
'text' => $this->i18n($pac["default{$type}template"] ? 'off' : 'on'),
|
||||
'text' => $this->i18n($pac["default{$type}template"] && !empty($pac["{$type}templates"][$pac["default{$type}template"]]) ? 'off' : 'on'),
|
||||
'callback_data' => "/defaultTemplate $type",
|
||||
],
|
||||
];
|
||||
@@ -3869,12 +3869,17 @@ DNS-over-HTTPS with IP:
|
||||
$this->warp();
|
||||
}
|
||||
|
||||
public function warpStatus()
|
||||
{
|
||||
$st = $this->ssh('curl -m 1 -x socks5://127.0.0.1:40000 https://cloudflare.com/cdn-cgi/trace', 'wp');
|
||||
preg_match('~warp=(\w+)~', $st, $m);
|
||||
return $m[1];
|
||||
}
|
||||
|
||||
public function warp()
|
||||
{
|
||||
$st = $this->ssh('curl -x socks5://127.0.0.1:40000 https://cloudflare.com/cdn-cgi/trace', 'wp');
|
||||
preg_match('~warp=(\w+)~', $st, $m);
|
||||
$text[] = "Menu -> " . $this->i18n('warp');
|
||||
$text[] = "status: {$m['1']}";
|
||||
$text[] = "status: " . $this->warpStatus();
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('set key'),
|
||||
@@ -3990,8 +3995,8 @@ DNS-over-HTTPS with IP:
|
||||
'callback_data' => "/switchXr $i",
|
||||
],
|
||||
];
|
||||
$singtemplate = $c['singtemplate'] ? base64_decode($c['singtemplate']) : 'default(' . ($pac['defaultsingtemplate'] ? base64_decode($pac['defaultsingtemplate']) : 'origin') . ')';
|
||||
$v2raytemplate = $c['v2raytemplate'] ? base64_decode($c['v2raytemplate']) : 'default(' . ($pac['defaultv2raytemplate'] ? base64_decode($pac['defaultv2raytemplate']) : 'origin') . ')';
|
||||
$singtemplate = $c['singtemplate'] ? base64_decode($c['singtemplate']) : 'default(' . ($pac['defaultsingtemplate'] && !empty($pac['singtemplates'][base64_decode($pac['defaultsingtemplate'])]) ? base64_decode($pac['defaultsingtemplate']) : 'origin') . ')';
|
||||
$v2raytemplate = $c['v2raytemplate'] ? base64_decode($c['v2raytemplate']) : 'default(' . ($pac['defaultv2raytemplate'] && !empty($pac['v2raytemplates'][base64_decode($pac['defaultv2raytemplate'])]) ? base64_decode($pac['defaultv2raytemplate']) : 'origin') . ')';
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('v2ray') . ": $v2raytemplate",
|
||||
@@ -4131,6 +4136,7 @@ DNS-over-HTTPS with IP:
|
||||
switch (true) {
|
||||
case !empty($template) && $template == 'origin':
|
||||
case empty($template) && empty($pac['default' . ($_GET['t'] == 's' ? 'v2ray' : 'sing') . 'template']):
|
||||
case empty($template) && !empty($pac['default' . ($_GET['t'] == 's' ? 'v2ray' : 'sing') . 'template']) && empty($pac[($_GET['t'] == 's' ? 'v2ray' : 'sing') . 'templates'][$pac['default' . ($_GET['t'] == 's' ? 'v2ray' : 'sing') . 'template']]):
|
||||
$c = json_decode(file_get_contents('/config/' . ($_GET['t'] == 's' ? 'v2ray' : 'sing') . '.json'), true);
|
||||
break;
|
||||
case !empty($template):
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ if ($hash == substr(md5($c['key']), 0, 8)) {
|
||||
|
||||
case 'te':
|
||||
if (!empty($_GET['te'])) {
|
||||
$t = $bot->getPacConf()["{$_GET['ty']}templates"][urldecode($_GET['te'])];
|
||||
$t = $bot->getPacConf()["{$_GET['ty']}templates"][$_GET['te']];
|
||||
} else {
|
||||
$t = json_decode(file_get_contents("/config/{$_GET['ty']}.json"), true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user