second refactor

This commit is contained in:
FUFSoB committed 2026-04-16 18:09:34 +05:00
1 parent b6bde24d2d
commit ba7560bfac
14 files changed
+1511 -1483

No files matched your search

+5 -20
View File
@@ -89,26 +89,11 @@ let
geoips = lib.unique (r.direct.geoips ++ lib.optional r.enableRuDirect "ru");
};
mkDomainRule =
tag: domains:
lib.optional (domains != [ ]) {
domain_suffix = domains;
outbound = tag;
};
mkIPRule =
tag: ips:
lib.optional (ips != [ ]) {
ip_cidr = ips;
outbound = tag;
};
mkRulesetRule =
tag: tags:
lib.optional (tags != [ ]) {
rule_set = tags;
outbound = tag;
};
mkRule = field: tag: items:
lib.optional (items != [ ]) { ${field} = items; outbound = tag; };
mkDomainRule = mkRule "domain_suffix";
mkIPRule = mkRule "ip_cidr";
mkRulesetRule = mkRule "rule_set";
# In "first" mode the start script renames the first outbound to "proxy",
# so any per-outbound routing tag that isn't direct/block/proxy must map