Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 72edcc4757 | |||
| 5988c4fcee | |||
| a82147eeda | |||
| 6bd21d06c0 | |||
| 3416cda826 | |||
| 2e40daf0c4 | |||
| 9c40b04392 | |||
| 1217ea7a09 | |||
| 7f6d462f22 | |||
| 47876ecdb4 | |||
| 66f03709fc | |||
| 42aafc6427 | |||
| 1674f6929e | |||
| 5791cabfb5 | |||
| 49d2d21f41 | |||
| 5263de514e | |||
| 9da810ba3d | |||
| b663eca445 | |||
| f8f95e22ac | |||
| 30f0f8c5f0 | |||
| 741f402ca1 | |||
| ef3d40c098 | |||
| ded85fb79f | |||
| b5ca5fbf93 | |||
| 570420274e |
+575
-98
@@ -133,6 +133,15 @@ class Bot
|
||||
case preg_match('~^/changeWG (\d+)$~', $this->input['callback'], $m):
|
||||
$this->changeWG($m[1]);
|
||||
break;
|
||||
case preg_match('~^/changeTransport(?: (\d+))?$~', $this->input['callback'], $m):
|
||||
$this->changeTransport($m[1] ?: false);
|
||||
break;
|
||||
case preg_match('~^/mirror$~', $this->input['message'], $m):
|
||||
$this->menu('mirror');
|
||||
break;
|
||||
case preg_match('~^/appOutbound$~', $this->input['callback'], $m):
|
||||
$this->appOutbound();
|
||||
break;
|
||||
case preg_match('~^/id$~', $this->input['message'], $m):
|
||||
$this->send($this->input['chat'], $this->input['from'], $this->input['message_id']);
|
||||
break;
|
||||
@@ -142,11 +151,14 @@ class Bot
|
||||
case preg_match('~^/mtproto$~', $this->input['callback'], $m):
|
||||
$this->mtproto();
|
||||
break;
|
||||
case preg_match('~^/deletePac$~', $this->input['callback'], $m):
|
||||
$this->deletePac();
|
||||
case preg_match('~^/deleteAll (\w+)$~', $this->input['callback'], $m):
|
||||
$this->deleteAll($m[1]);
|
||||
break;
|
||||
case preg_match('~^/deletePacYes$~', $this->input['callback'], $m):
|
||||
$this->deletePacYes();
|
||||
case preg_match('~^/exportList (\w+)$~', $this->input['callback'], $m):
|
||||
$this->exportList($m[1]);
|
||||
break;
|
||||
case preg_match('~^/deleteYes (\w+)$~', $this->input['callback'], $m):
|
||||
$this->deleteYes($m[1]);
|
||||
break;
|
||||
case preg_match('~^/addCommunityFilter$~', $this->input['callback'], $m):
|
||||
$this->addCommunityFilter();
|
||||
@@ -344,8 +356,8 @@ class Bot
|
||||
case preg_match('~^/qrSS$~', $this->input['callback'], $m):
|
||||
$this->qrSS();
|
||||
break;
|
||||
case preg_match('~^/qrXray (\d+)$~', $this->input['callback'], $m):
|
||||
$this->qrXray($m[1]);
|
||||
case preg_match('~^/qrXray (\d+)(?:_(\d+))?$~', $this->input['callback'], $m):
|
||||
$this->qrXray($m[1], $m[2] ?: false);
|
||||
break;
|
||||
case preg_match('~^/qrMtproto$~', $this->input['callback'], $m):
|
||||
$this->qrMtproto();
|
||||
@@ -365,8 +377,8 @@ class Bot
|
||||
case preg_match('~^/deldomain$~', $this->input['callback'], $m):
|
||||
$this->delDomain();
|
||||
break;
|
||||
case preg_match('~^/(?P<action>change|delete)(?P<typelist>\w+) (?P<arg>[^\s]+(?:_(?:-)?\d+)?)$~', $this->input['callback'], $m):
|
||||
$this->listPacChange($m['typelist'], $m['action'], ...explode('_', $m['arg']));
|
||||
case preg_match('~^/(?P<action>change|delete)(?P<typelist>\w+) (?P<arg>\d+)$~', $this->input['callback'], $m):
|
||||
$this->listPacChange($m['typelist'], $m['action'], $m['arg']);
|
||||
break;
|
||||
case preg_match('~^/paczapret$~', $this->input['callback'], $m):
|
||||
$this->pacZapret();
|
||||
@@ -395,9 +407,18 @@ class Bot
|
||||
case preg_match('~^/xtlsblock(?: (\d+))?$~', $this->input['callback'], $m):
|
||||
$this->xtlsblock($m[1] ?: 0);
|
||||
break;
|
||||
case preg_match('~^/routes(?: (\d+))?$~', $this->input['callback'], $m):
|
||||
$this->routes($m[1] ?: 0);
|
||||
break;
|
||||
case preg_match('~^/xtlswarp(?: (\d+))?$~', $this->input['callback'], $m):
|
||||
$this->xtlswarp($m[1] ?: 0);
|
||||
break;
|
||||
case preg_match('~^/xtlsapp(?: (\d+))?$~', $this->input['callback'], $m):
|
||||
$this->xtlsapp($m[1] ?: 0);
|
||||
break;
|
||||
case preg_match('~^/xtlsrulesset(?: (\d+))?$~', $this->input['callback'], $m):
|
||||
$this->xtlsrulesset($m[1] ?: 0);
|
||||
break;
|
||||
case preg_match('~^/delTemplate (\w+)(?: (.+))?$~', $this->input['callback'], $m):
|
||||
$this->delTemplate($m[1], $m[2]);
|
||||
break;
|
||||
@@ -455,6 +476,9 @@ class Bot
|
||||
case preg_match('~^/import$~', $this->input['callback'], $m):
|
||||
$this->import();
|
||||
break;
|
||||
case preg_match('~^/importList (\w+)$~', $this->input['callback'], $m):
|
||||
$this->importList($m[1]);
|
||||
break;
|
||||
case preg_match('~^/rename (?P<arg>\d+(?:_(?:-)?\d+)?)$~', $this->input['callback'], $m):
|
||||
$this->rename(...explode('_', $m['arg']));
|
||||
break;
|
||||
@@ -917,6 +941,46 @@ class Bot
|
||||
];
|
||||
}
|
||||
|
||||
public function importList($type)
|
||||
{
|
||||
$r = $this->send(
|
||||
$this->input['chat'],
|
||||
"@{$this->input['username']} send the export file:",
|
||||
$this->input['message_id'],
|
||||
reply: 'send the export file:',
|
||||
);
|
||||
$_SESSION['reply'][$r['result']['message_id']] = [
|
||||
'start_message' => $this->input['message_id'],
|
||||
'start_callback' => $this->input['callback_id'],
|
||||
'callback' => 'importListFile',
|
||||
'args' => [$type],
|
||||
];
|
||||
}
|
||||
|
||||
public function importListFile($text = '', $type)
|
||||
{
|
||||
$r = $this->request('getFile', ['file_id' => $this->input['file_id']]);
|
||||
$f = file_get_contents($this->file . $r['result']['file_path']);
|
||||
if (!empty($f)) {
|
||||
foreach (explode("\n", $f) as $v) {
|
||||
if (!empty($s = trim($v))) {
|
||||
$t = explode(';', $s);
|
||||
if ($type == 'rulessetlist') {
|
||||
if (preg_match('~^.+:.+:https?://.+~', $t[0])) {
|
||||
$list[$t[0]] = (bool) $t[1];
|
||||
}
|
||||
} else {
|
||||
$list[$t[0]] = (bool) $t[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
$p = $this->getPacConf();
|
||||
$p[$type] = $list;
|
||||
$this->setPacConf($p);
|
||||
}
|
||||
$this->backXtlsList($type);
|
||||
}
|
||||
|
||||
public function timerClient(string $time, int $client)
|
||||
{
|
||||
$clients = $this->readClients();
|
||||
@@ -1543,9 +1607,9 @@ class Bot
|
||||
}
|
||||
}
|
||||
|
||||
public function qrXray($i)
|
||||
public function qrXray($i, $s = false)
|
||||
{
|
||||
$link = $this->linkXray($i);
|
||||
$link = $this->linkXray($i, $s);
|
||||
$qr_file = __DIR__ . "/qr/xray.png";
|
||||
exec("qrencode -t png -o $qr_file '$link'");
|
||||
$r = $this->sendPhoto(
|
||||
@@ -2155,12 +2219,25 @@ DNS-over-HTTPS with IP:
|
||||
|
||||
public function include($type)
|
||||
{
|
||||
$r = $this->send(
|
||||
$this->input['chat'],
|
||||
"@{$this->input['username']} list domains separated by commas",
|
||||
$this->input['message_id'],
|
||||
reply: 'list domains separated by commas',
|
||||
);
|
||||
switch ($type) {
|
||||
case 'rulessetlist':
|
||||
$r = $this->send(
|
||||
$this->input['chat'],
|
||||
"@{$this->input['username']} [direct | block | proxy]:time:URL",
|
||||
$this->input['message_id'],
|
||||
reply: '[direct | block | proxy]:time:URL',
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
$r = $this->send(
|
||||
$this->input['chat'],
|
||||
"@{$this->input['username']} list domains separated by commas",
|
||||
$this->input['message_id'],
|
||||
reply: 'list domains separated by commas',
|
||||
);
|
||||
break;
|
||||
}
|
||||
$_SESSION['reply'][$r['result']['message_id']] = [
|
||||
'start_message' => $this->input['message_id'],
|
||||
'callback' => 'addInclude',
|
||||
@@ -2170,12 +2247,16 @@ DNS-over-HTTPS with IP:
|
||||
|
||||
public function addInclude(string $domains, $type)
|
||||
{
|
||||
if ($type == 'rulessetlist' && !preg_match('~^.+:.+:https?://.+~', $domains)) {
|
||||
$this->send($this->input['from'], 'wrong pattern, enter [direct|block|proxy|custom outbound]:time:URL');
|
||||
return;
|
||||
}
|
||||
$domains = explode(',', $domains);
|
||||
$domains = array_filter($domains, fn($x) => !empty(trim($x)));
|
||||
if (!empty($domains)) {
|
||||
$conf = $this->getPacConf();
|
||||
foreach ($domains as $k => $v) {
|
||||
$conf[$type][idn_to_ascii(trim($v))] = true;
|
||||
$conf[$type][$type == 'rulessetlist' ? trim($v) : idn_to_ascii(trim($v))] = true;
|
||||
}
|
||||
ksort($conf[$type]);
|
||||
$this->setPacConf($conf);
|
||||
@@ -2199,6 +2280,14 @@ DNS-over-HTTPS with IP:
|
||||
$this->xrayUpdateRules();
|
||||
$this->xtlswarp();
|
||||
break;
|
||||
case 'packagelist':
|
||||
$this->xrayUpdateRules();
|
||||
$this->xtlsapp();
|
||||
break;
|
||||
case 'rulessetlist':
|
||||
$this->xrayUpdateRules();
|
||||
$this->xtlsrulesset();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3145,32 +3234,100 @@ DNS-over-HTTPS with IP:
|
||||
);
|
||||
}
|
||||
|
||||
public function deletePacYes()
|
||||
public function deleteYes($type)
|
||||
{
|
||||
$c = $this->getPacConf();
|
||||
unset($c['includelist']);
|
||||
unset($c[$type]);
|
||||
$this->setPacConf($c);
|
||||
$this->pacUpdate();
|
||||
$this->menu('pac');
|
||||
switch ($type) {
|
||||
case 'includelist':
|
||||
$this->pacUpdate();
|
||||
break;
|
||||
case 'blocklist':
|
||||
$this->xtlsblock();
|
||||
break;
|
||||
case 'warplist':
|
||||
$this->xtlswarp();
|
||||
break;
|
||||
case 'packagelist':
|
||||
$this->xtlsapp();
|
||||
break;
|
||||
case 'rulessetlist':
|
||||
$this->xtlsrulesset();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function deletePac($page = 0)
|
||||
public function deleteAll($type)
|
||||
{
|
||||
switch ($type) {
|
||||
case 'includelist':
|
||||
$dir = 'PAC';
|
||||
break;
|
||||
case 'warplist':
|
||||
$dir = 'WARP';
|
||||
break;
|
||||
case 'blocklist':
|
||||
$dir = 'BLOCK';
|
||||
break;
|
||||
case 'packagelist':
|
||||
$dir = 'PACKAGE';
|
||||
break;
|
||||
case 'rulessetlist':
|
||||
$dir = 'rulesset';
|
||||
break;
|
||||
}
|
||||
$text = <<<text
|
||||
Menu -> PAC -> delete all
|
||||
Menu -> $dir -> delete all
|
||||
text;
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('yes'),
|
||||
'callback_data' => "/deletePacYes",
|
||||
],
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('back'),
|
||||
'callback_data' => "/pacMenu 0",
|
||||
'callback_data' => "/deleteYes $type",
|
||||
],
|
||||
];
|
||||
switch ($type) {
|
||||
case 'includelist':
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('back'),
|
||||
'callback_data' => "/pacMenu 0",
|
||||
],
|
||||
];
|
||||
break;
|
||||
case 'warplist':
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('back'),
|
||||
'callback_data' => "/xtlswarp",
|
||||
],
|
||||
];
|
||||
break;
|
||||
case 'blocklist':
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('back'),
|
||||
'callback_data' => "/xtlsblock",
|
||||
],
|
||||
];
|
||||
break;
|
||||
case 'packagelist':
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('back'),
|
||||
'callback_data' => "/xtlsapp",
|
||||
],
|
||||
];
|
||||
break;
|
||||
case 'rulessetlist':
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('back'),
|
||||
'callback_data' => "/xtlsrulesset",
|
||||
],
|
||||
];
|
||||
break;
|
||||
}
|
||||
$this->update(
|
||||
$this->input['chat'],
|
||||
$this->input['message_id'],
|
||||
@@ -3179,15 +3336,30 @@ DNS-over-HTTPS with IP:
|
||||
);
|
||||
}
|
||||
|
||||
public function exportList($type)
|
||||
{
|
||||
$domains = $this->getPacConf()[$type];
|
||||
if (!empty($domains)) {
|
||||
foreach ($domains as $k => $v) {
|
||||
$text .= "$k;$v\n";
|
||||
}
|
||||
$this->sendFile(
|
||||
$this->input['chat'],
|
||||
new CURLStringFile($text, "$type.csv", 'application/csv'),
|
||||
to: $this->input['message_id'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function xtlsblock($page = 0)
|
||||
{
|
||||
$text[] = "Menu -> " . $this->i18n('xray') . ' -> block list';
|
||||
$text[] = "Menu -> " . $this->i18n('xray') . ' -> ' . $this->i18n('routes') . ' -> block list';
|
||||
|
||||
$data = $this->listPac('blocklist', $page, 'xtlsblock');
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('back'),
|
||||
'callback_data' => "/xray",
|
||||
'callback_data' => "/routes",
|
||||
],
|
||||
];
|
||||
$this->update(
|
||||
@@ -3200,13 +3372,13 @@ DNS-over-HTTPS with IP:
|
||||
|
||||
public function xtlswarp($page = 0)
|
||||
{
|
||||
$text[] = "Menu -> " . $this->i18n('xray') . ' -> warp list';
|
||||
$text[] = "Menu -> " . $this->i18n('xray') . ' -> ' . $this->i18n('routes') . ' -> warp list';
|
||||
|
||||
$data = $this->listPac('warplist', $page, 'xtlswarp');
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('back'),
|
||||
'callback_data' => "/xray",
|
||||
'callback_data' => "/routes",
|
||||
],
|
||||
];
|
||||
$this->update(
|
||||
@@ -3217,7 +3389,60 @@ DNS-over-HTTPS with IP:
|
||||
);
|
||||
}
|
||||
|
||||
public function listPac($type, $page, $menu)
|
||||
public function appOutbound()
|
||||
{
|
||||
$p = $this->getPacConf();
|
||||
$p['app_outbound'] = !$p['app_outbound'];
|
||||
$p = $this->setPacConf($p);
|
||||
$this->xtlsapp();
|
||||
}
|
||||
|
||||
public function xtlsapp($page = 0)
|
||||
{
|
||||
$text[] = "Menu -> " . $this->i18n('xray') . ' -> ' . $this->i18n('routes') . ' -> package list';
|
||||
|
||||
$data = $this->listPac('packagelist', $page, 'xtlsapp');
|
||||
$p = $this->getPacConf();
|
||||
$data[] = [
|
||||
[
|
||||
'text' => 'set to ' . ($p['app_outbound'] ? 'proxy' : 'direct'),
|
||||
'callback_data' => "/appOutbound",
|
||||
],
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('back'),
|
||||
'callback_data' => "/routes",
|
||||
],
|
||||
];
|
||||
$this->update(
|
||||
$this->input['chat'],
|
||||
$this->input['message_id'],
|
||||
implode("\n", $text ?: ['...']),
|
||||
$data ?: false,
|
||||
);
|
||||
}
|
||||
|
||||
public function xtlsrulesset($page = 0)
|
||||
{
|
||||
$text[] = "Menu -> " . $this->i18n('xray') . ' -> ' . $this->i18n('routes') . ' -> rulesset list';
|
||||
|
||||
$data = $this->listPac('rulessetlist', $page, 'xtlsrulesset', 1);
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('back'),
|
||||
'callback_data' => "/routes",
|
||||
],
|
||||
];
|
||||
$this->update(
|
||||
$this->input['chat'],
|
||||
$this->input['message_id'],
|
||||
implode("\n", $text ?: ['...']),
|
||||
$data ?: false,
|
||||
);
|
||||
}
|
||||
|
||||
public function listPac($type, $page, $menu, $basename = false)
|
||||
{
|
||||
$data[] = [
|
||||
[
|
||||
@@ -3227,22 +3452,23 @@ DNS-over-HTTPS with IP:
|
||||
];
|
||||
$domains = $this->getPacConf()[$type];
|
||||
if (!empty($domains)) {
|
||||
ksort($domains);
|
||||
$all = (int) ceil(count($domains) / $this->limit);
|
||||
$page = min($page, $all - 1);
|
||||
$page = $page < 0 ? $all - 1 : $page;
|
||||
$domains = array_slice($domains, $page * $this->limit, $this->limit, true);
|
||||
$i = 0;
|
||||
foreach ($domains as $k => $v) {
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n($v ? 'on' : 'off') . ' ' . idn_to_utf8($k),
|
||||
'callback_data' => "/change$type {$k}_{$this->limit}",
|
||||
'text' => $this->i18n($v ? 'on' : 'off') . ' ' . ($basename ? basename($k) . ' ' : '') . idn_to_utf8($k),
|
||||
'callback_data' => "/change$type " . ($i + $page * $this->limit),
|
||||
],
|
||||
[
|
||||
'text' => 'delete',
|
||||
'callback_data' => "/delete$type {$k}_{$this->limit}",
|
||||
'callback_data' => "/delete$type " . ($i + $page * $this->limit),
|
||||
],
|
||||
];
|
||||
$i++;
|
||||
}
|
||||
if ($all > 1) {
|
||||
$data[] = [
|
||||
@@ -3259,7 +3485,22 @@ DNS-over-HTTPS with IP:
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('delete all'),
|
||||
'callback_data' => "/deletePac",
|
||||
'callback_data' => "/deleteAll $type",
|
||||
],
|
||||
[
|
||||
'text' => $this->i18n('export'),
|
||||
'callback_data' => "/exportList $type",
|
||||
],
|
||||
[
|
||||
'text' => $this->i18n('import'),
|
||||
'callback_data' => "/importList $type",
|
||||
],
|
||||
];
|
||||
} else {
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('import'),
|
||||
'callback_data' => "/importList $type",
|
||||
],
|
||||
];
|
||||
}
|
||||
@@ -3269,14 +3510,20 @@ DNS-over-HTTPS with IP:
|
||||
public function listPacChange($type, $action, $key)
|
||||
{
|
||||
$conf = $this->getPacConf();
|
||||
ksort($conf[$type]);
|
||||
switch ($action) {
|
||||
case 'change':
|
||||
$conf[$type][$key] = !$conf[$type][$key];
|
||||
break;
|
||||
case 'delete':
|
||||
unset($conf[$type][$key]);
|
||||
$i = 0;
|
||||
foreach ($conf[$type] as $k => $v) {
|
||||
if ($key == $i) {
|
||||
switch ($action) {
|
||||
case 'change':
|
||||
$conf[$type][$k] = !$v;
|
||||
break;
|
||||
case 'delete':
|
||||
unset($conf[$type][$k]);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$this->setPacConf($conf);
|
||||
$this->backXtlsList($type);
|
||||
@@ -3485,17 +3732,28 @@ DNS-over-HTTPS with IP:
|
||||
}
|
||||
}
|
||||
|
||||
public function geodb()
|
||||
{
|
||||
$this->answer($this->input['callback_id'], 'in developing...');
|
||||
}
|
||||
|
||||
public function linkXray($i)
|
||||
public function linkXray($i, $s = false)
|
||||
{
|
||||
$c = $this->getXray();
|
||||
$pac = $this->getPacConf();
|
||||
$domain = $pac['domain'] ?: $this->ip;
|
||||
return "vless://{$c['inbounds'][0]['settings']['clients'][$i]['id']}@$domain:443?security=reality&sni={$c['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0]}&fp=chrome&pbk={$pac['xray']}&sid={$c['inbounds'][0]['streamSettings']['realitySettings']['shortIds'][0]}&type=tcp&flow=xtls-rprx-vision#vpnbot";
|
||||
$scheme = empty($this->nginxGetTypeCert()) ? 'http' : 'https';
|
||||
$hash = substr(md5($this->key), 0, 8);
|
||||
$si = "$scheme://{$domain}/pac/" . base64_encode(serialize([
|
||||
'h' => $hash,
|
||||
't' => 'si',
|
||||
's' => $c['inbounds'][0]['settings']['clients'][$i]['id'],
|
||||
]));
|
||||
|
||||
switch ($s) {
|
||||
case 1:
|
||||
return "$scheme://{$domain}/pac?h=$hash&t=s&s={$c['inbounds'][0]['settings']['clients'][$i]['id']}";
|
||||
case 2:
|
||||
return "sing-box://import-remote-profile/?url={$si}#{$c['inbounds'][0]['settings']['clients'][$i]['email']}";
|
||||
|
||||
default:
|
||||
return "vless://{$c['inbounds'][0]['settings']['clients'][$i]['id']}@$domain:443?security=reality&sni={$c['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0]}&fp=chrome&pbk={$pac['xray']}&sid={$c['inbounds'][0]['streamSettings']['realitySettings']['shortIds'][0]}&type=tcp&flow=xtls-rprx-vision#{$c['inbounds'][0]['settings']['clients'][$i]['email']}";
|
||||
}
|
||||
}
|
||||
|
||||
public function dockerApi($url, $method = 'GET', $data = [])
|
||||
@@ -3920,18 +4178,32 @@ DNS-over-HTTPS with IP:
|
||||
$this->generateSecretXray();
|
||||
}
|
||||
$c = $this->getXray();
|
||||
$p = $this->getPacConf();
|
||||
$text[] = "Menu -> " . $this->i18n('xray');
|
||||
$text[] = "fake domain: <code>{$c['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0]}</code>";
|
||||
$text[] = 'transport: ' . ($p['transport'] ?: 'Reality');
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('changeFakeDomain'),
|
||||
'callback_data' => "/changeFakeDomain",
|
||||
'text' => $this->i18n('Reality') . ' ' . ($p['transport'] != 'Websocket' ? $this->i18n('on') : $this->i18n('off')),
|
||||
'callback_data' => "/changeTransport",
|
||||
],
|
||||
[
|
||||
'text' => $this->i18n('selfFakeDomain'),
|
||||
'callback_data' => "/selfFakeDomain",
|
||||
'text' => $this->i18n('Websocket') . ' ' . ($p['transport'] == 'Websocket' ? $this->i18n('on') : $this->i18n('off')),
|
||||
'callback_data' => "/changeTransport 1",
|
||||
],
|
||||
];
|
||||
if ($p['transport'] != 'Websocket') {
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('changeFakeDomain'),
|
||||
'callback_data' => "/changeFakeDomain",
|
||||
],
|
||||
[
|
||||
'text' => $this->i18n('selfFakeDomain'),
|
||||
'callback_data' => "/selfFakeDomain",
|
||||
],
|
||||
];
|
||||
}
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('v2ray templates'),
|
||||
@@ -3944,15 +4216,9 @@ DNS-over-HTTPS with IP:
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('block'),
|
||||
'callback_data' => "/xtlsblock",
|
||||
'text' => $this->i18n('routes'),
|
||||
'callback_data' => "/routes",
|
||||
],
|
||||
[
|
||||
'text' => $this->i18n('warp'),
|
||||
'callback_data' => "/xtlswarp",
|
||||
],
|
||||
];
|
||||
$data[] = [
|
||||
];
|
||||
foreach ($c['inbounds'][0]['settings']['clients'] as $k => $v) {
|
||||
if (!empty($v['off'])) {
|
||||
@@ -4019,6 +4285,42 @@ DNS-over-HTTPS with IP:
|
||||
);
|
||||
}
|
||||
|
||||
public function routes($page = 0)
|
||||
{
|
||||
$text[] = "Menu -> " . $this->i18n('xray') . ' -> routes';
|
||||
|
||||
$data = [
|
||||
[[
|
||||
'text' => $this->i18n('block'),
|
||||
'callback_data' => "/xtlsblock",
|
||||
]],
|
||||
[[
|
||||
'text' => $this->i18n('warp'),
|
||||
'callback_data' => "/xtlswarp",
|
||||
]],
|
||||
[[
|
||||
'text' => $this->i18n('package'),
|
||||
'callback_data' => "/xtlsapp",
|
||||
]],
|
||||
[[
|
||||
'text' => $this->i18n('rulesset'),
|
||||
'callback_data' => "/xtlsrulesset",
|
||||
]],
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('back'),
|
||||
'callback_data' => "/xray",
|
||||
],
|
||||
];
|
||||
$this->update(
|
||||
$this->input['chat'],
|
||||
$this->input['message_id'],
|
||||
implode("\n", $text ?: ['...']),
|
||||
$data ?: false,
|
||||
);
|
||||
}
|
||||
|
||||
public function warpPlus()
|
||||
{
|
||||
$r = $this->send(
|
||||
@@ -4056,6 +4358,7 @@ DNS-over-HTTPS with IP:
|
||||
{
|
||||
$text[] = "Menu -> " . $this->i18n('warp');
|
||||
$text[] = "status: " . $this->warpStatus();
|
||||
$text[] = "key: " . $this->getPacConf()['warp'];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('set key'),
|
||||
@@ -4185,9 +4488,17 @@ DNS-over-HTTPS with IP:
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('show QR'),
|
||||
'text' => $this->i18n('qr short'),
|
||||
'callback_data' => "/qrXray $i",
|
||||
],
|
||||
[
|
||||
'text' => $this->i18n('qr v2ray'),
|
||||
'callback_data' => "/qrXray {$i}_1",
|
||||
],
|
||||
[
|
||||
'text' => $this->i18n('qr singbox'),
|
||||
'callback_data' => "/qrXray {$i}_2",
|
||||
],
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
@@ -4277,11 +4588,15 @@ DNS-over-HTTPS with IP:
|
||||
}
|
||||
|
||||
if (!empty($_GET['r'])) {
|
||||
$si = "$scheme://{$domain}/pac?h=$hash&t=si&s=$uid";
|
||||
$si = "$scheme://{$domain}/pac/" . base64_encode(serialize([
|
||||
'h' => $hash,
|
||||
't' => 'si',
|
||||
's' => $uid,
|
||||
]));
|
||||
$v2 = "$scheme://{$domain}/pac?h=$hash&t=s&s=$uid";
|
||||
switch ($_GET['r']) {
|
||||
case 'si':
|
||||
header("Location: sing-box://import-remote-profile/?url=" . urlencode($si));
|
||||
header("Location: sing-box://import-remote-profile/?url=" . $si);
|
||||
exit;
|
||||
case 'st':
|
||||
header("Location: streisand://import/$v2");
|
||||
@@ -4290,7 +4605,7 @@ DNS-over-HTTPS with IP:
|
||||
header("Location: v2rayng://install-config?url=" . urlencode($v2));
|
||||
exit;
|
||||
case 'h':
|
||||
header("Location: hiddify://install-config/?url=" . urlencode($si));
|
||||
header("Location: hiddify://install-config/?url=" . $si);
|
||||
exit;
|
||||
case 'w':
|
||||
$link = htmlspecialchars($si, ENT_XML1, 'UTF-8');
|
||||
@@ -4329,10 +4644,41 @@ DNS-over-HTTPS with IP:
|
||||
switch ($_GET['t']) {
|
||||
case 's':
|
||||
$c['outbounds'][0]['settings']['vnext'][0]['address'] = $domain;
|
||||
$c['outbounds'][0]['settings']['vnext'][0]['users'][0]['id'] = $uid;
|
||||
$c['outbounds'][0]['streamSettings']['realitySettings']['serverName'] = $xr['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0];
|
||||
$c['outbounds'][0]['streamSettings']['realitySettings']['publicKey'] = $pac['xray'];
|
||||
$c['outbounds'][0]['streamSettings']['realitySettings']['shortId'] = $xr['inbounds'][0]['streamSettings']['realitySettings']['shortIds'][0];
|
||||
$c['outbounds'][0]['settings']['vnext'][0]['users'][0] = [
|
||||
'id' => $uid,
|
||||
'encryption' => 'none',
|
||||
];
|
||||
if ($pac['transport'] == 'Websocket') {
|
||||
$c['outbounds'][0]['streamSettings'] = [
|
||||
"network" => "ws",
|
||||
"security" => "tls",
|
||||
"wsSettings" => [
|
||||
"path" => "/ws?ed=2560"
|
||||
],
|
||||
"tlsSettings" => [
|
||||
"allowInsecure" => false,
|
||||
"serverName" => $domain,
|
||||
"fingerprint" => "chrome"
|
||||
]
|
||||
];
|
||||
unset($c['outbounds'][0]['mux']);
|
||||
} else {
|
||||
$c['outbounds'][0]['settings']['vnext'][0]['users'][0]["flow"] = "xtls-rprx-vision";
|
||||
$c['outbounds'][0]['streamSettings'] = [
|
||||
"network" => "tcp",
|
||||
"security" => "reality",
|
||||
"realitySettings" => [
|
||||
"serverName" => $xr['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0],
|
||||
"fingerprint" => "chrome",
|
||||
"publicKey" => $pac['xray'],
|
||||
"shortId" => $xr['inbounds'][0]['streamSettings']['realitySettings']['shortIds'][0],
|
||||
]
|
||||
];
|
||||
$c['outbounds'][0]['mux'] = [
|
||||
"enabled" => false,
|
||||
"concurrency" => -1
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($c['routing']['rules'] as $k => $v) {
|
||||
if (array_key_exists('domain', $v) && $v['domain'] == '~pac~') {
|
||||
@@ -4349,11 +4695,24 @@ DNS-over-HTTPS with IP:
|
||||
$c['dns']['servers'][0]['address'] = "tls://" . ($pac['adguardkey'] ? "{$pac['adguardkey']}." : '') . "$domain";
|
||||
}
|
||||
|
||||
$c['outbounds'][0]['server'] = $domain;
|
||||
$c['outbounds'][0]['uuid'] = $uid;
|
||||
$c['outbounds'][0]['tls']['reality']['public_key'] = $pac['xray'];
|
||||
$c['outbounds'][0]['tls']['server_name'] = $xr['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0];
|
||||
$c['outbounds'][0]['tls']['reality']['short_id'] = $xr['inbounds'][0]['streamSettings']['realitySettings']['shortIds'][0];
|
||||
$c['outbounds'][0]['server'] = $domain;
|
||||
$c['outbounds'][0]['uuid'] = $uid;
|
||||
if ($pac['transport'] == 'Websocket') {
|
||||
unset($c['outbounds'][0]['tls']['reality']);
|
||||
unset($c['outbounds'][0]['flow']);
|
||||
$c['outbounds'][0]["transport"] = [
|
||||
"type" => "ws",
|
||||
"path" => "/ws"
|
||||
];
|
||||
$c['outbounds'][0]['tls']['server_name'] = $domain;
|
||||
} else {
|
||||
unset($c['outbounds'][0]["transport"]);
|
||||
$c['outbounds'][0]['flow'] = 'xtls-rprx-vision';
|
||||
$c['outbounds'][0]['tls']['reality']['public_key'] = $pac['xray'];
|
||||
$c['outbounds'][0]['tls']['server_name'] = $xr['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0];
|
||||
$c['outbounds'][0]['tls']['reality']['short_id'] = $xr['inbounds'][0]['streamSettings']['realitySettings']['shortIds'][0];
|
||||
}
|
||||
|
||||
foreach ($c['route']['rules'] as $k => $v) {
|
||||
if (array_key_exists('domain_suffix', $v) && $v['domain_suffix'] == '~pac~') {
|
||||
$c['route']['rules'][$k]['domain_suffix'] = array_keys(array_filter($pac['includelist'] ?: []));
|
||||
@@ -4363,7 +4722,10 @@ DNS-over-HTTPS with IP:
|
||||
}
|
||||
}
|
||||
$c['route']['rules'] = array_values($c['route']['rules']);
|
||||
$c['route'] = $this->addRuleSet($c['route']);
|
||||
$c['route'] = $this->addPackageRule($c['route']);
|
||||
$c['route'] = $this->createRuleSet($c['route'], $uid);
|
||||
$c['route'] = $this->clearEmptyRules($c['route']);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -4371,6 +4733,54 @@ DNS-over-HTTPS with IP:
|
||||
echo json_encode($c);
|
||||
}
|
||||
|
||||
public function clearEmptyRules($route)
|
||||
{
|
||||
foreach ($route['rules'] as $k => $v) {
|
||||
if (count($v) == 1) {
|
||||
unset($route['rules'][$k]);
|
||||
}
|
||||
}
|
||||
$route['rules'] = array_values($route['rules']);
|
||||
return $route;
|
||||
}
|
||||
|
||||
public function addPackageRule($route)
|
||||
{
|
||||
$p = $this->getPacConf();
|
||||
if (!empty($t = array_filter($p['packagelist'] ?: []))) {
|
||||
$route['rules'][] = [
|
||||
'package_name' => array_keys($t),
|
||||
'outbound' => $p['app_outbound'] ? 'direct' : 'proxy',
|
||||
];
|
||||
}
|
||||
return $route;
|
||||
}
|
||||
|
||||
public function addRuleSet($route)
|
||||
{
|
||||
foreach ($route['rules'] as $k => $v) {
|
||||
$t[$v['outbound']] = $k;
|
||||
}
|
||||
$p = $this->getPacConf();
|
||||
if (!empty($p['rulessetlist'])) {
|
||||
foreach ($p['rulessetlist'] as $k => $v) {
|
||||
if (!empty($v)) {
|
||||
[$type, $time, $url] = explode(':', $k, 3);
|
||||
$route['rule_set'][] = [
|
||||
"tag" => $k,
|
||||
"type" => "remote",
|
||||
"format" => "binary",
|
||||
"url" => $url,
|
||||
"download_detour" => "direct",
|
||||
"update_interval" => $time
|
||||
];
|
||||
$route['rules'][$t[$type]]['rule_set'][] = $k;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $route;
|
||||
}
|
||||
|
||||
public function createRuleSet($route, $uid)
|
||||
{
|
||||
$pac = $this->getPacConf();
|
||||
@@ -4388,37 +4798,47 @@ DNS-over-HTTPS with IP:
|
||||
unset($r['rules'][$l]);
|
||||
}
|
||||
}
|
||||
if (array_key_exists('domain_suffix', $n) && $n['domain_suffix'] == '~warp~') {
|
||||
$r['rules'][$l]['domain_suffix'] = array_keys(array_filter($pac['warplist'] ?: []));
|
||||
if (empty($r['rules'][$l]['domain_suffix'])) {
|
||||
unset($r['rules'][$l]);
|
||||
}
|
||||
}
|
||||
if (array_key_exists('domain_suffix', $n) && $n['domain_suffix'] == '~block~') {
|
||||
$r['rules'][$l]['domain_suffix'] = array_keys(array_filter($pac['blocklist'] ?: []));
|
||||
if (empty($r['rules'][$l]['domain_suffix'])) {
|
||||
unset($r['rules'][$l]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($_GET['r']) && $r['name'] == $_GET['r']) {
|
||||
header("Content-Disposition: attachment; filename={$r['name']}.srs");
|
||||
header('Content-Type: application/binary');
|
||||
$f = "/tmp/{$r['name']}" . time() . rand(1, 100);
|
||||
file_put_contents($f, json_encode([
|
||||
'version' => 1,
|
||||
'rules' => $r['rules'],
|
||||
'rules' => $r['rules'] ?: [],
|
||||
]));
|
||||
exec("sing-box rule-set compile $f");
|
||||
header("Content-Disposition: attachment; filename={$r['name']}.srs");
|
||||
header('Content-Type: application/binary');
|
||||
echo file_get_contents("$f.srs");
|
||||
unlink($f);
|
||||
unlink("$f.srs");
|
||||
exit;
|
||||
}
|
||||
if (!empty($r['rules'])) {
|
||||
$ruleset[] = [
|
||||
"tag" => $r['name'],
|
||||
"url" => "$scheme://{$domain}/pac?" . http_build_query([
|
||||
'h' => $hash,
|
||||
't' => 'si',
|
||||
's' => $uid,
|
||||
'r' => $r['name'],
|
||||
]),
|
||||
"update_interval" => $r['interval'],
|
||||
"type" => "remote",
|
||||
"format" => "binary",
|
||||
"download_detour" => "direct",
|
||||
];
|
||||
$route['rules'][$k]['rule_set'][] = $r['name'];
|
||||
}
|
||||
$ruleset[] = [
|
||||
"tag" => $r['name'],
|
||||
"url" => "$scheme://{$domain}/pac?" . http_build_query([
|
||||
'h' => $hash,
|
||||
't' => 'si',
|
||||
's' => $uid,
|
||||
'r' => $r['name'],
|
||||
]),
|
||||
"update_interval" => $r['interval'],
|
||||
"type" => "remote",
|
||||
"format" => "binary",
|
||||
"download_detour" => "direct",
|
||||
];
|
||||
$route['rules'][$k]['rule_set'][] = $r['name'];
|
||||
}
|
||||
unset($route['rules'][$k]['createruleset']);
|
||||
if (empty($route['rules'][$k]['rule_set'])) {
|
||||
@@ -4452,6 +4872,8 @@ DNS-over-HTTPS with IP:
|
||||
$c['inbounds'][0]['streamSettings']['realitySettings']['shortIds'][0] = $shortId;
|
||||
$pac = $this->getPacConf();
|
||||
$pac['xray'] = $public;
|
||||
$pac['reality']['shortId'] = $shortId;
|
||||
$pac['reality']['privateKey'] = $$p['reality']['shortId'];
|
||||
$this->setPacConf($pac);
|
||||
$this->restartXray($c);
|
||||
}
|
||||
@@ -5025,8 +5447,12 @@ DNS-over-HTTPS with IP:
|
||||
public function setFakeDomain($domain, $self = false)
|
||||
{
|
||||
$c = $this->getXray();
|
||||
$p = $this->getPacConf();
|
||||
$c['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0] = $domain;
|
||||
$c['inbounds'][0]['streamSettings']['realitySettings']['dest'] = $self ? "10.10.1.2:443" : "$domain:443";
|
||||
$p['reality']['domain'] = $domain;
|
||||
$p['reality']['destination'] = $self ? "10.10.1.2:443" : "$domain:443";
|
||||
$this->setPacConf($p);
|
||||
$this->restartXray($c);
|
||||
$this->setUpstreamDomain($domain);
|
||||
$this->xray();
|
||||
@@ -5042,6 +5468,57 @@ DNS-over-HTTPS with IP:
|
||||
}
|
||||
}
|
||||
|
||||
public function changeTransport($ws = null)
|
||||
{
|
||||
$p = $this->getPacConf();
|
||||
$x = $this->getXray();
|
||||
$p['transport'] = $ws ? 'Websocket' : 'Reality';
|
||||
if (!empty($ws)) {
|
||||
$p['reality']['domain'] = $x['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0];
|
||||
$p['reality']['destination'] = $x['inbounds'][0]['streamSettings']['realitySettings']['dest'];
|
||||
$p['reality']['shortId'] = $x['inbounds'][0]['streamSettings']['realitySettings']['shortIds'][0];
|
||||
foreach ($x['inbounds'][0]['settings']['clients'] as $k => $v) {
|
||||
unset($x['inbounds'][0]['settings']['clients'][$k]['flow']);
|
||||
}
|
||||
$x['inbounds'][0]['streamSettings'] = [
|
||||
"network" => "ws",
|
||||
"wsSettings" => [
|
||||
"path" => "/ws"
|
||||
]
|
||||
];
|
||||
} else {
|
||||
foreach ($x['inbounds'][0]['settings']['clients'] as $k => $v) {
|
||||
$x['inbounds'][0]['settings']['clients'][$k]['flow'] = 'xtls-rprx-vision';
|
||||
}
|
||||
$x['inbounds'][0]['streamSettings'] = [
|
||||
"network" => "tcp",
|
||||
"realitySettings" => [
|
||||
"dest" => $p['reality']['destination'],
|
||||
"maxClientVer" => "",
|
||||
"maxTimeDiff" => 0,
|
||||
"minClientVer" => "",
|
||||
"privateKey" => $p['reality']['privateKey'],
|
||||
"serverNames" => [
|
||||
$p['reality']['domain']
|
||||
],
|
||||
"shortIds" => [$p['reality']['shortId']],
|
||||
"show" => false,
|
||||
"xver" => 0
|
||||
],
|
||||
"tcpSettings" => [
|
||||
"acceptProxyProtocol" => true
|
||||
],
|
||||
"sockopt" => [
|
||||
"acceptProxyProtocol" => true
|
||||
],
|
||||
"security" => "reality"
|
||||
];
|
||||
}
|
||||
$this->setPacConf($p);
|
||||
$this->restartXray($x);
|
||||
$this->xray();
|
||||
}
|
||||
|
||||
public function setBackup($text)
|
||||
{
|
||||
$text = trim($text);
|
||||
|
||||
+4
-4
@@ -2,8 +2,8 @@
|
||||
|
||||
$i = [
|
||||
'warp' => [
|
||||
'en' => 'Warp',
|
||||
'ru' => 'Warp',
|
||||
'en' => 'warp',
|
||||
'ru' => 'warp',
|
||||
],
|
||||
'wg_title' => [
|
||||
'en' => 'Wireguard',
|
||||
@@ -262,8 +262,8 @@ $i = [
|
||||
'ru' => 'очистить',
|
||||
],
|
||||
'xray' => [
|
||||
'en' => 'XTLS-Reality',
|
||||
'ru' => 'XTLS-Reality',
|
||||
'en' => 'Xray',
|
||||
'ru' => 'Xray',
|
||||
],
|
||||
'geodb' => [
|
||||
'en' => 'GeoIp/GeoSite',
|
||||
|
||||
+6
-3
@@ -17,10 +17,13 @@ if ('POST' == $_SERVER['REQUEST_METHOD'] && $_GET['k'] == $c['key']) {
|
||||
}
|
||||
|
||||
// pac
|
||||
$type = $_GET['t'] ?? 'pac';
|
||||
if (!empty($t = unserialize(base64_decode(explode('/', $_SERVER['REQUEST_URI'])[2])))) { // fix sing-box import
|
||||
$_GET = array_merge($_GET, $t);
|
||||
}
|
||||
$type = $_GET['t'] ?? 'pac';
|
||||
$address = $_GET['a'] ?: '127.0.0.1';
|
||||
$port = $_GET['p'] ?: '1080';
|
||||
$hash = $_GET['h'];
|
||||
$port = $_GET['p'] ?: '1080';
|
||||
$hash = $_GET['h'];
|
||||
if ($hash == substr(md5($c['key']), 0, 8)) {
|
||||
require __DIR__ . '/bot.php';
|
||||
require __DIR__ . '/i18n.php';
|
||||
|
||||
+12
-6
@@ -89,11 +89,14 @@ function start()
|
||||
|
||||
$conf = $bot->getPacConf();
|
||||
|
||||
$subzones = array_keys(array_filter($conf['subzoneslist'], fn($x) => $x == true));
|
||||
if (!empty($conf['subzoneslist'])) {
|
||||
$subzones = array_keys(array_filter($conf['subzoneslist'], fn($x) => $x == true));
|
||||
}
|
||||
|
||||
// check && exclude
|
||||
$include = array_filter($conf['includelist'], fn($x) => $x == true);
|
||||
$domains = $include;
|
||||
if (!empty($conf['includelist'])) {
|
||||
$domains = array_filter($conf['includelist'], fn($x) => $x == true);
|
||||
}
|
||||
if (empty($domains)) {
|
||||
$text = "Empty domains. Delete pac files";
|
||||
unlink(__DIR__ . '/zapretlists/mpac');
|
||||
@@ -146,10 +149,13 @@ function start()
|
||||
file_put_contents(__DIR__ . '/zapretlists/pac', $pac);
|
||||
$text .= "Create minified pac 100%\n";
|
||||
}
|
||||
|
||||
// create reverse PAC
|
||||
$domains = array_filter($conf['reverselist'], fn($x) => $x == true);
|
||||
unset($domains);
|
||||
if (!empty($conf['reverselist'])) {
|
||||
$domains = array_filter($conf['reverselist'], fn($x) => $x == true);
|
||||
}
|
||||
if (empty($domains)) {
|
||||
|
||||
// $text .= "Empty reverse domains. Delete reverse pac files";
|
||||
unlink(__DIR__ . '/zapretlists/rmpac');
|
||||
unlink(__DIR__ . '/zapretlists/rpac');
|
||||
@@ -197,6 +203,7 @@ function start()
|
||||
file_put_contents(__DIR__ . '/zapretlists/rpac', $pac);
|
||||
$text .= 'Create minified reverse pac 100%';
|
||||
}
|
||||
|
||||
endScript($text);
|
||||
}
|
||||
|
||||
@@ -242,7 +249,6 @@ $load = [
|
||||
'-',
|
||||
'\\',
|
||||
];
|
||||
|
||||
switch ($_SERVER['argv'][1]) {
|
||||
case 'start':
|
||||
$bot = new Bot($c['key'], $i);
|
||||
|
||||
@@ -64,6 +64,17 @@ http {
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
location /ws {
|
||||
proxy_pass http://xr:443;
|
||||
proxy_redirect off;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_read_timeout 5d;
|
||||
}
|
||||
location ~\.well-known {
|
||||
access_log /logs/nginx_certbot_access;
|
||||
root /certs/;
|
||||
@@ -124,6 +135,17 @@ http {
|
||||
# proxy_set_header Upgrade $http_upgrade;
|
||||
# proxy_set_header Connection "upgrade";
|
||||
# }
|
||||
# location /ws {
|
||||
# proxy_pass http://xr:443;
|
||||
# proxy_redirect off;
|
||||
# proxy_http_version 1.1;
|
||||
# proxy_set_header Upgrade $http_upgrade;
|
||||
# proxy_set_header Connection "upgrade";
|
||||
# proxy_set_header Host $host;
|
||||
# proxy_set_header X-Real-IP $remote_addr;
|
||||
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
# proxy_read_timeout 5d;
|
||||
# }
|
||||
#-domain
|
||||
#-ssl
|
||||
# # The DoH server block
|
||||
|
||||
@@ -64,6 +64,17 @@ http {
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
location /ws {
|
||||
proxy_pass http://xr:443;
|
||||
proxy_redirect off;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_read_timeout 5d;
|
||||
}
|
||||
location ~\.well-known {
|
||||
access_log /logs/nginx_certbot_access;
|
||||
root /certs/;
|
||||
@@ -124,6 +135,17 @@ http {
|
||||
# proxy_set_header Upgrade $http_upgrade;
|
||||
# proxy_set_header Connection "upgrade";
|
||||
# }
|
||||
# location /ws {
|
||||
# proxy_pass http://xr:443;
|
||||
# proxy_redirect off;
|
||||
# proxy_http_version 1.1;
|
||||
# proxy_set_header Upgrade $http_upgrade;
|
||||
# proxy_set_header Connection "upgrade";
|
||||
# proxy_set_header Host $host;
|
||||
# proxy_set_header X-Real-IP $remote_addr;
|
||||
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
# proxy_read_timeout 5d;
|
||||
# }
|
||||
#-domain
|
||||
#-ssl
|
||||
# # The DoH server block
|
||||
|
||||
+27
-1
@@ -113,16 +113,42 @@
|
||||
{
|
||||
"createruleset": [
|
||||
{
|
||||
"name": "selfpac",
|
||||
"name": "pac",
|
||||
"interval": "15s",
|
||||
"rules": [
|
||||
{
|
||||
"domain_suffix": "~pac~"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "warp",
|
||||
"interval": "15s",
|
||||
"rules": [
|
||||
{
|
||||
"domain_suffix": "~warp~"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"outbound": "proxy"
|
||||
},
|
||||
{
|
||||
"createruleset": [
|
||||
{
|
||||
"name": "block",
|
||||
"interval": "15s",
|
||||
"rules": [
|
||||
{
|
||||
"domain_suffix": "~block~"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"outbound": "block"
|
||||
},
|
||||
{
|
||||
"outbound": "direct"
|
||||
}
|
||||
],
|
||||
"final": "direct"
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
03.09.2024 v1.45
|
||||
- выбор транспорта reality/websocket
|
||||
26.08.2024 v1.44
|
||||
- qr для xtls
|
||||
- фикс действий на элементом списков
|
||||
21.08.2024 v1.43
|
||||
- singbox:поддержка кастомных outbound для ruleset
|
||||
16.08.2024 v1.42.1
|
||||
- фикс добавления рулсетов с длинными урл
|
||||
16.08.2024 v1.42
|
||||
- добавлена возможность сохранять/восстанавливать список доменов/правил маршрутизации
|
||||
- изменена ссылка на сингбокс-конфиг для совместимости с клиентом сингбокса (фикс импорта в sing-box)
|
||||
- sing-box: добавлена возможность добавлять свои packagename (outbound:proxy)
|
||||
- sing-box: добавлена возможность добавлять свои ruleset с указанием outbound и временем обновления
|
||||
- sing-box: списки доменов pac/warp/block трансформируются в собственный ruleset и присутствуют в шаблоне origin всегда, даже если они пустые. это дает возможность не ждать перезагрузки конфига клиентом
|
||||
09.08.2024 v1.41.1
|
||||
- фикс для "удалить все" в списках доменов
|
||||
06.08.2024 v1.41
|
||||
- возможность очистить РАС лист
|
||||
03.08.2024 v1.40
|
||||
|
||||
Reference in New Issue
Block a user