Fix LAN proxy binding in routing setup
Some checks failed
Build and Deploy Gateway / build-and-deploy (push) Failing after 13s

This commit is contained in:
2026-05-09 10:11:40 +03:00
parent aab7533438
commit cab4313c70
15 changed files with 171 additions and 42 deletions

View File

@@ -51,7 +51,14 @@ function readCustomRuleSets() {
}
}
function ruleSets(customRuleSets = []) {
function ruleSetDownloadDetour(vpnTag) {
const detour = String(settings.ruleSetDownloadDetour || "vpn").trim();
if (!detour || detour === "vpn") return vpnTag;
return detour;
}
function ruleSets(customRuleSets = [], vpnTag = "direct") {
const downloadDetour = ruleSetDownloadDetour(vpnTag);
const builtIn = settings.routingRuDirect
? [
{
@@ -59,14 +66,14 @@ function ruleSets(customRuleSets = []) {
tag: "geoip-ru",
format: "binary",
url: "https://cdn.jsdelivr.net/gh/SagerNet/sing-geoip@rule-set/geoip-ru.srs",
download_detour: "direct",
download_detour: downloadDetour,
},
{
type: "remote",
tag: "geosite-category-ru",
format: "binary",
url: "https://cdn.jsdelivr.net/gh/SagerNet/sing-geosite@rule-set/geosite-category-ru.srs",
download_detour: "direct",
download_detour: downloadDetour,
},
]
: [];
@@ -78,7 +85,7 @@ function ruleSets(customRuleSets = []) {
tag: String(rs.tag).trim(),
format: rs.format || "binary",
url: String(rs.url).trim(),
download_detour: "direct",
download_detour: downloadDetour,
}));
// Пользовательские rule-sets не должны дублировать встроенные
@@ -286,7 +293,7 @@ export function buildGatewayConfig(
{ type: "block", tag: "block" },
],
route: {
rule_set: bypassAll ? [] : ruleSets(customRuleSets),
rule_set: bypassAll ? [] : ruleSets(customRuleSets, vpnOutbound.tag),
rules: bypassAll
? [{ ip_is_private: true, outbound: "direct" }]
: routeRules(subscriptionConfig.customRules, vpnOutbound.tag),