Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 29e7be6cd8 | |||
| a5599118fc |
+21
-16
@@ -481,6 +481,7 @@ class Bot
|
||||
|
||||
public function restartXray($c)
|
||||
{
|
||||
$c['inbounds'][0]['settings']['clients'] = array_values($c['inbounds'][0]['settings']['clients']);
|
||||
$this->ssh('pkill xray', 'xr');
|
||||
file_put_contents('/config/xray.json', json_encode($c, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
|
||||
$this->ssh('xray run -config /xray.json > /dev/null 2>&1 &', 'xr');
|
||||
@@ -3639,7 +3640,7 @@ DNS-over-HTTPS with IP:
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => "default: " . $this->i18n('show'),
|
||||
'text' => "origin",
|
||||
'web_app' => ['url' => "https://$domain/pac?h=$hash&t=te"],
|
||||
],
|
||||
[
|
||||
@@ -3650,7 +3651,7 @@ DNS-over-HTTPS with IP:
|
||||
foreach ($templates as $k => $v) {
|
||||
$data[] = [
|
||||
[
|
||||
'text' => "$k: " . $this->i18n('show'),
|
||||
'text' => "$k",
|
||||
'web_app' => ['url' => "https://$domain/pac?h=$hash&t=te&te=" . urlencode($k)],
|
||||
],
|
||||
[
|
||||
@@ -3798,6 +3799,12 @@ DNS-over-HTTPS with IP:
|
||||
'callback_data' => "/choiceTemplate $i",
|
||||
],
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => 'origin',
|
||||
'callback_data' => "/choiceTemplate {$i}_" . base64_encode('origin'),
|
||||
],
|
||||
];
|
||||
foreach ($templates as $k => $v) {
|
||||
$data[] = [
|
||||
[
|
||||
@@ -3945,7 +3952,7 @@ DNS-over-HTTPS with IP:
|
||||
if (empty($v['off'])) {
|
||||
$flag = false;
|
||||
}
|
||||
$template = $v['template'];
|
||||
$template = base64_decode($v['template']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3953,14 +3960,18 @@ DNS-over-HTTPS with IP:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!empty($template) && !empty($pac['singtemplates'][base64_decode($template)])) {
|
||||
$c = $pac['singtemplates'][base64_decode($template)];
|
||||
} else {
|
||||
if (!empty($pac['defaulttemplate'])) {
|
||||
$c = $pac['singtemplates'][base64_decode($pac['defaulttemplate'])];
|
||||
} else {
|
||||
switch (true) {
|
||||
case !empty($template) && $template == 'origin':
|
||||
case empty($template) && empty($pac['defaulttemplate']):
|
||||
$c = json_decode(file_get_contents('/config/sing.json'), true);
|
||||
}
|
||||
break;
|
||||
case !empty($template):
|
||||
$c = $pac['singtemplates'][$template];
|
||||
break;
|
||||
|
||||
default:
|
||||
$c = $pac['singtemplates'][base64_decode($pac['defaulttemplate'])];
|
||||
break;
|
||||
}
|
||||
|
||||
if ($c['dns']['servers'][0]['address'] == '~dns~') {
|
||||
@@ -4161,12 +4172,6 @@ DNS-over-HTTPS with IP:
|
||||
],
|
||||
],
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('reset settings'),
|
||||
'callback_data' => "/adguardreset",
|
||||
],
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('add upstream'),
|
||||
|
||||
Reference in New Issue
Block a user