Compare commits

...

2 Commits

Author SHA1 Message Date
mercury 1d9d992361 sslip.io -> nip.io 2024-10-14 00:00:25 +04:00
mercury e1f14d85e0 порядок правил маршрутизации для singbox 2024-10-13 23:58:02 +04:00
3 changed files with 46 additions and 7 deletions
+32 -7
View File
@@ -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;
}
+10
View File
@@ -110,6 +110,16 @@
"protocol": "dns",
"outbound": "dns-out"
},
{
"package_name": [
],
"outbound": "proxy"
},
{
"process_name": [
],
"outbound": "proxy"
},
{
"createruleset": [
{
+4
View File
@@ -1,3 +1,7 @@
13.10.2024 v1.67
- sslip.io -> nip.io
13.10.2024 v1.66
- singbox template: изменен порядок правил маршрутизации для package_name
10.10.2024 v1.65.1
- фикс создания архива windows service singbox 2
09.10.2024 v1.65