Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1d9d992361 | |||
| e1f14d85e0 |
+32
-7
@@ -1776,7 +1776,7 @@ class Bot
|
||||
{
|
||||
$c = $this->getPacConf();
|
||||
if (empty($c['domain'])) {
|
||||
$this->addDomain(str_replace('.', '-', $this->ip) . '.sslip.io', 1);
|
||||
$this->addDomain(str_replace('.', '-', $this->ip) . '.nip.io', 1);
|
||||
$this->setSSL('letsencrypt');
|
||||
} else {
|
||||
$this->menu();
|
||||
@@ -4982,6 +4982,7 @@ 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->addProcessRule($c['route']);
|
||||
$c['route'] = $this->createRuleSet($c['route'], $uid, $domain);
|
||||
$c['route'] = $this->clearEmptyRules($c['route']);
|
||||
break;
|
||||
@@ -5004,12 +5005,36 @@ DNS-over-HTTPS with IP:
|
||||
|
||||
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',
|
||||
];
|
||||
foreach ($route['rules'] as $k => $v) {
|
||||
if (array_key_exists('package_name', $v)) {
|
||||
$p = $this->getPacConf();
|
||||
if (!empty($t = array_filter($p['packagelist'] ?: []))) {
|
||||
$route['rules'][$k] = [
|
||||
'package_name' => array_keys($t),
|
||||
'outbound' => $p['app_outbound'] ? 'direct' : 'proxy',
|
||||
];
|
||||
} else {
|
||||
unset($route['rules'][$k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $route;
|
||||
}
|
||||
|
||||
public function addProcessRule($route)
|
||||
{
|
||||
foreach ($route['rules'] as $k => $v) {
|
||||
if (array_key_exists('process_name', $v)) {
|
||||
$p = $this->getPacConf();
|
||||
if (!empty($t = array_filter($p['processlist'] ?: []))) {
|
||||
$route['rules'][$k] = [
|
||||
'process_name' => array_keys($t),
|
||||
'outbound' => $p['process_outbound'] ? 'direct' : 'proxy',
|
||||
];
|
||||
} else {
|
||||
unset($route['rules'][$k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $route;
|
||||
}
|
||||
|
||||
@@ -110,6 +110,16 @@
|
||||
"protocol": "dns",
|
||||
"outbound": "dns-out"
|
||||
},
|
||||
{
|
||||
"package_name": [
|
||||
],
|
||||
"outbound": "proxy"
|
||||
},
|
||||
{
|
||||
"process_name": [
|
||||
],
|
||||
"outbound": "proxy"
|
||||
},
|
||||
{
|
||||
"createruleset": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user