From ef2c150c6347058ac7560fd9c77ae02f2c2c30c4 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 3 Nov 2026 00:33:30 +0800 Subject: [PATCH] Added ru services to rules routing --- README.md | 3 +- luci/graph.js | 42 ++-------------------- templates/rule-providers/10-base.yaml | 9 +++++ templates/rules/90-base.yaml | 6 +++- tests/expected/mobile.yaml | 13 ++++++- tests/expected/router-boots.yaml | 13 ++++++- tests/expected/router-csqtt-foreign.yaml | 13 ++++++- tests/expected/router-csqtt.yaml | 13 ++++++- tests/expected/router-foreign.yaml | 13 ++++++- tests/expected/router-hwid.yaml | 13 ++++++- tests/expected/router-ids.yaml | 13 ++++++- tests/expected/router-lite-csqtt.yaml | 13 ++++++- tests/expected/router-lite.yaml | 13 ++++++- tests/expected/router-main.yaml | 13 ++++++- tests/expected/router-minimal.yaml | 13 ++++++- tests/expected/router-whitelist-ts-my.yaml | 13 ++++++- tests/expected/router-whitelist-ts.yaml | 13 ++++++- tests/expected/router-whitelist.yaml | 13 ++++++- 18 files changed, 186 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index 014fb82..cfb8081 100644 --- a/README.md +++ b/README.md @@ -478,7 +478,8 @@ RU-адреса, без OpenVPN, Tailscale, торрентов и `PUSH`; сво |---|---|---|---|---| | подписки через `BOOT-AUTO` | ✓ | ✓ | ✓ | ✓ | | `ru-inside` | напрямую | напрямую | через RU | напрямую | -| остальные `.ru` / `.рф`, доп. IP (`RU_IPS`) | напрямую | через RU | через RU | через RU | +| `ru-services` (русские сервисы вне ru-inside и вне .ru/.su/.рф) | напрямую | через RU | через RU | через RU | +| остальные `.ru` / `.su` / `.рф`, доп. IP (`RU_IPS`) | напрямую | через RU | через RU | через RU | | доп. IP / домены через FOREIGN, MY (`FOREIGN_*`, `MY_*`) | `FOREIGN` / `MY` | `FOREIGN` / `MY` | `FOREIGN` / `MY` | `FOREIGN` / `MY` | | доп. домены через RU (`RU_DOMAINS`) | напрямую | через RU | через RU | через RU | | локальные адреса (`LOCAL_HOSTS`) | по LAN | по LAN | по LAN | — | diff --git a/luci/graph.js b/luci/graph.js index 6874107..1101f5a 100644 --- a/luci/graph.js +++ b/luci/graph.js @@ -682,8 +682,6 @@ '.mkg .e.file{stroke:var(--fetch);stroke-dasharray:1 3;stroke-opacity:.6}' + '.mkg .e.wan{stroke-dasharray:3 3;stroke-opacity:.45}' + '.mkg .lane{stroke:var(--rule-b);stroke-dasharray:4 4}.mkg .lane-t{fill:var(--mute);font-size:11px}' + - '.mkg .lbl{fill:var(--mute);font-size:10px;paint-order:stroke;stroke:var(--bg);stroke-width:3px;stroke-linejoin:round;opacity:0}' + - '.mkg .focus .lbl.hl{opacity:1}' + '.mkg .live .e.off{stroke-opacity:.15}' + '.mkg .e.now{stroke:var(--now);stroke-opacity:.95;stroke-width:2}' + '.mkg .e.flow{stroke:var(--flow);stroke-opacity:.95;stroke-dasharray:8 6;animation:mkg-flow 1s linear infinite}' + @@ -957,30 +955,7 @@ if (!x) return; x.path.classList.toggle('hl', !!r.edges[i]); - if (x.label) - x.label.classList.toggle('hl', !!r.edges[i]); }); - spread(r.edges); - }; - // the shown filter labels: edges into one subscription end close together, so their - // labels would lie on each other; each one that hits a placed one goes below it - var spread = function(shown) { - var placed = []; - edgeEls.map(function(x, i) { return shown[i] && x && x.label ? x : null; }).filter(Boolean) - .sort(function(a, b) { return a.by - b.by; }).forEach(function(x) { - var y = x.by, hit = true; - while (hit) { - hit = false; - placed.forEach(function(p) { - if (Math.abs(p.bx - x.bx) < (p.w + x.w) / 2 + 4 && Math.abs(p.y - y) < 12) { - y = p.y + 12; - hit = true; - } - }); - } - placed.push({ bx: x.bx, w: x.w, y: y }); - x.label.setAttribute('y', y); - }); }; var row = function(k, v) { return el('tr', {}, [ el('td', { text: k }), el('td', {}, [].concat(v)) ]); }; @@ -1473,7 +1448,7 @@ world.removeChild(world.firstChild); nodeEls = {}; edgeEls = []; - var ge = el('g', {}), gl = el('g', {}), gn = el('g', {}); + var ge = el('g', {}), gn = el('g', {}); lay.edges.forEach(function(le, i) { var e = le.e, a = lay.nodes[e.from], b = lay.nodes[e.to]; if (!a || !b) @@ -1483,17 +1458,7 @@ 'marker-end': e.kind == 'fetch' ? 'url(#mkg-arrow)' : null }); p.appendChild(el('title', { text: (m.nodes[e.from].label + ' → ' + m.nodes[e.to].label) + (e.label ? '\n' + e.label : '') })); ge.appendChild(p); - var x = { path: p, label: null }; - // filters on the way into a subscription: halfway along the last stretch - if (e.kind == 'use' && e.label && le.pts) { - var q = le.pts[le.pts.length - 1], o = le.pts[le.pts.length - 2]; - var t = cut(e.label, 30); - x.bx = (o.x + q.x) / 2; - x.by = (o.y + q.y) / 2 - 3; - x.w = measure(t, 10); - x.label = el('text', { 'class': 'lbl', x: x.bx, y: x.by, 'text-anchor': 'middle', text: t }); - gl.appendChild(x.label); - } + var x = { path: p }; edgeEls[i] = x; }); m.list.forEach(function(n) { @@ -1531,7 +1496,6 @@ text: 'служебное — правила сюда не ведут: через что качаются подписки' }) ])); world.appendChild(ge); - world.appendChild(gl); world.appendChild(gn); }; @@ -1558,8 +1522,6 @@ x.path.style.strokeWidth = f ? Math.min(7, 2 + Math.log(1 + f.n) + (f.rate ? Math.log(1 + f.rate / 4096) : 0)) + 'px' : ''; var hide = onlyNow.checked && on && isOff && !f; x.path.style.display = hide ? 'none' : ''; - if (x.label) - x.label.style.display = hide ? 'none' : ''; }); m.list.forEach(function(n) { var g = nodeEls[n.id], b = lay.nodes[n.id]; diff --git a/templates/rule-providers/10-base.yaml b/templates/rule-providers/10-base.yaml index e25e577..d74f364 100644 --- a/templates/rule-providers/10-base.yaml +++ b/templates/rule-providers/10-base.yaml @@ -7,3 +7,12 @@ url: "${RULESET_URL}/ru-inside.mrs" path: ./ruleset/ru-inside.mrs interval: 86400 + # Russian services outside ru-inside and outside .ru/.su/.рф (russia-only ru-services): + # not on the whitelist, so through RU everywhere but main + ru-services: + type: http + behavior: domain + format: mrs + url: "${RULESET_URL}/ru-services.mrs" + path: ./ruleset/ru-services.mrs + interval: 86400 diff --git a/templates/rules/90-base.yaml b/templates/rules/90-base.yaml index f686e04..fbbcfd0 100644 --- a/templates/rules/90-base.yaml +++ b/templates/rules/90-base.yaml @@ -1,9 +1,13 @@ - RULE-SET,ru-inside,DIRECT #@!foreign # abroad: Russian services through the RU pool too #@foreign - RULE-SET,ru-inside,RU #@foreign - # main (home, own white IP): .ru/.рф directly; elsewhere through RU + # main (home, own white IP): ru-services and .ru/.su/.рф directly; elsewhere through RU + - RULE-SET,ru-services,DIRECT #@main - DOMAIN-SUFFIX,ru,DIRECT #@main + - DOMAIN-SUFFIX,su,DIRECT #@main - DOMAIN-SUFFIX,xn--p1ai,DIRECT #@main + - RULE-SET,ru-services,RU #@!main - DOMAIN-SUFFIX,ru,RU #@!main + - DOMAIN-SUFFIX,su,RU #@!main - DOMAIN-SUFFIX,xn--p1ai,RU #@!main - MATCH,MAIN diff --git a/tests/expected/mobile.yaml b/tests/expected/mobile.yaml index 20e0228..391a29a 100644 --- a/tests/expected/mobile.yaml +++ b/tests/expected/mobile.yaml @@ -144,6 +144,15 @@ rule-providers: url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-inside.mrs" path: ./ruleset/ru-inside.mrs interval: 86400 + # Russian services outside ru-inside and outside .ru/.su/.рф (russia-only ru-services): + # not on the whitelist, so through RU everywhere but main + ru-services: + type: http + behavior: domain + format: mrs + url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-services.mrs" + path: ./ruleset/ru-services.mrs + interval: 86400 # services (SERVICES): geosite list anthropic of MetaCubeX/meta-rules-dat geosite-anthropic: @@ -303,7 +312,9 @@ rules: - IP-CIDR,194.190.191.112/32,RU - RULE-SET,ru-inside,DIRECT - # main (home, own white IP): .ru/.рф directly; elsewhere through RU + # main (home, own white IP): ru-services and .ru/.su/.рф directly; elsewhere through RU + - RULE-SET,ru-services,RU - DOMAIN-SUFFIX,ru,RU + - DOMAIN-SUFFIX,su,RU - DOMAIN-SUFFIX,xn--p1ai,RU - MATCH,MAIN diff --git a/tests/expected/router-boots.yaml b/tests/expected/router-boots.yaml index 35046d5..000f97e 100644 --- a/tests/expected/router-boots.yaml +++ b/tests/expected/router-boots.yaml @@ -116,6 +116,15 @@ rule-providers: url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-inside.mrs" path: ./ruleset/ru-inside.mrs interval: 86400 + # Russian services outside ru-inside and outside .ru/.su/.рф (russia-only ru-services): + # not on the whitelist, so through RU everywhere but main + ru-services: + type: http + behavior: domain + format: mrs + url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-services.mrs" + path: ./ruleset/ru-services.mrs + interval: 86400 sniffer: enable: true @@ -273,7 +282,9 @@ rules: - SRC-PORT,20000-20199,TORRENT-SEL - RULE-SET,ru-inside,DIRECT - # main (home, own white IP): .ru/.рф directly; elsewhere through RU + # main (home, own white IP): ru-services and .ru/.su/.рф directly; elsewhere through RU + - RULE-SET,ru-services,RU - DOMAIN-SUFFIX,ru,RU + - DOMAIN-SUFFIX,su,RU - DOMAIN-SUFFIX,xn--p1ai,RU - MATCH,MAIN diff --git a/tests/expected/router-csqtt-foreign.yaml b/tests/expected/router-csqtt-foreign.yaml index f415033..3fbcb73 100644 --- a/tests/expected/router-csqtt-foreign.yaml +++ b/tests/expected/router-csqtt-foreign.yaml @@ -122,6 +122,15 @@ rule-providers: url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-inside.mrs" path: ./ruleset/ru-inside.mrs interval: 86400 + # Russian services outside ru-inside and outside .ru/.su/.рф (russia-only ru-services): + # not on the whitelist, so through RU everywhere but main + ru-services: + type: http + behavior: domain + format: mrs + url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-services.mrs" + path: ./ruleset/ru-services.mrs + interval: 86400 sniffer: enable: true @@ -282,7 +291,9 @@ rules: # abroad: Russian services through the RU pool too - RULE-SET,ru-inside,RU - # main (home, own white IP): .ru/.рф directly; elsewhere through RU + # main (home, own white IP): ru-services and .ru/.su/.рф directly; elsewhere through RU + - RULE-SET,ru-services,RU - DOMAIN-SUFFIX,ru,RU + - DOMAIN-SUFFIX,su,RU - DOMAIN-SUFFIX,xn--p1ai,RU - MATCH,MAIN diff --git a/tests/expected/router-csqtt.yaml b/tests/expected/router-csqtt.yaml index 7e3985c..dbad910 100644 --- a/tests/expected/router-csqtt.yaml +++ b/tests/expected/router-csqtt.yaml @@ -121,6 +121,15 @@ rule-providers: url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-inside.mrs" path: ./ruleset/ru-inside.mrs interval: 86400 + # Russian services outside ru-inside and outside .ru/.su/.рф (russia-only ru-services): + # not on the whitelist, so through RU everywhere but main + ru-services: + type: http + behavior: domain + format: mrs + url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-services.mrs" + path: ./ruleset/ru-services.mrs + interval: 86400 sniffer: enable: true @@ -290,7 +299,9 @@ rules: - SRC-PORT,20000-20199,TORRENT-SEL - RULE-SET,ru-inside,DIRECT - # main (home, own white IP): .ru/.рф directly; elsewhere through RU + # main (home, own white IP): ru-services and .ru/.su/.рф directly; elsewhere through RU + - RULE-SET,ru-services,RU - DOMAIN-SUFFIX,ru,RU + - DOMAIN-SUFFIX,su,RU - DOMAIN-SUFFIX,xn--p1ai,RU - MATCH,MAIN diff --git a/tests/expected/router-foreign.yaml b/tests/expected/router-foreign.yaml index ded45d8..92467ea 100644 --- a/tests/expected/router-foreign.yaml +++ b/tests/expected/router-foreign.yaml @@ -124,6 +124,15 @@ rule-providers: url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-inside.mrs" path: ./ruleset/ru-inside.mrs interval: 86400 + # Russian services outside ru-inside and outside .ru/.su/.рф (russia-only ru-services): + # not on the whitelist, so through RU everywhere but main + ru-services: + type: http + behavior: domain + format: mrs + url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-services.mrs" + path: ./ruleset/ru-services.mrs + interval: 86400 # OpenVPN routes (OVPN_ROUTES): the file is written by mihomo-kit.sh build and # emptied by bmstu-otp.sh off, so with the tunnel off these addresses follow @@ -321,7 +330,9 @@ rules: # abroad: Russian services through the RU pool too - RULE-SET,ru-inside,RU - # main (home, own white IP): .ru/.рф directly; elsewhere through RU + # main (home, own white IP): ru-services and .ru/.su/.рф directly; elsewhere through RU + - RULE-SET,ru-services,RU - DOMAIN-SUFFIX,ru,RU + - DOMAIN-SUFFIX,su,RU - DOMAIN-SUFFIX,xn--p1ai,RU - MATCH,MAIN diff --git a/tests/expected/router-hwid.yaml b/tests/expected/router-hwid.yaml index 3a2bc1b..614c47a 100644 --- a/tests/expected/router-hwid.yaml +++ b/tests/expected/router-hwid.yaml @@ -103,6 +103,15 @@ rule-providers: url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-inside.mrs" path: ./ruleset/ru-inside.mrs interval: 86400 + # Russian services outside ru-inside and outside .ru/.su/.рф (russia-only ru-services): + # not on the whitelist, so through RU everywhere but main + ru-services: + type: http + behavior: domain + format: mrs + url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-services.mrs" + path: ./ruleset/ru-services.mrs + interval: 86400 sniffer: enable: true @@ -251,7 +260,9 @@ rules: - SRC-PORT,20000-20199,TORRENT-SEL - RULE-SET,ru-inside,DIRECT - # main (home, own white IP): .ru/.рф directly; elsewhere through RU + # main (home, own white IP): ru-services and .ru/.su/.рф directly; elsewhere through RU + - RULE-SET,ru-services,DIRECT - DOMAIN-SUFFIX,ru,DIRECT + - DOMAIN-SUFFIX,su,DIRECT - DOMAIN-SUFFIX,xn--p1ai,DIRECT - MATCH,MAIN diff --git a/tests/expected/router-ids.yaml b/tests/expected/router-ids.yaml index ecd0a20..91c2679 100644 --- a/tests/expected/router-ids.yaml +++ b/tests/expected/router-ids.yaml @@ -138,6 +138,15 @@ rule-providers: url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-inside.mrs" path: ./ruleset/ru-inside.mrs interval: 86400 + # Russian services outside ru-inside and outside .ru/.su/.рф (russia-only ru-services): + # not on the whitelist, so through RU everywhere but main + ru-services: + type: http + behavior: domain + format: mrs + url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-services.mrs" + path: ./ruleset/ru-services.mrs + interval: 86400 sniffer: enable: true @@ -286,7 +295,9 @@ rules: - SRC-PORT,20000-20199,TORRENT-SEL - RULE-SET,ru-inside,DIRECT - # main (home, own white IP): .ru/.рф directly; elsewhere through RU + # main (home, own white IP): ru-services and .ru/.su/.рф directly; elsewhere through RU + - RULE-SET,ru-services,DIRECT - DOMAIN-SUFFIX,ru,DIRECT + - DOMAIN-SUFFIX,su,DIRECT - DOMAIN-SUFFIX,xn--p1ai,DIRECT - MATCH,MAIN diff --git a/tests/expected/router-lite-csqtt.yaml b/tests/expected/router-lite-csqtt.yaml index ecbcb96..e22bf91 100644 --- a/tests/expected/router-lite-csqtt.yaml +++ b/tests/expected/router-lite-csqtt.yaml @@ -120,6 +120,15 @@ rule-providers: url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-inside.mrs" path: ./ruleset/ru-inside.mrs interval: 86400 + # Russian services outside ru-inside and outside .ru/.su/.рф (russia-only ru-services): + # not on the whitelist, so through RU everywhere but main + ru-services: + type: http + behavior: domain + format: mrs + url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-services.mrs" + path: ./ruleset/ru-services.mrs + interval: 86400 sniffer: enable: true @@ -278,7 +287,9 @@ rules: - SRC-PORT,20000-20199,TORRENT-SEL - RULE-SET,ru-inside,DIRECT - # main (home, own white IP): .ru/.рф directly; elsewhere through RU + # main (home, own white IP): ru-services and .ru/.su/.рф directly; elsewhere through RU + - RULE-SET,ru-services,DIRECT - DOMAIN-SUFFIX,ru,DIRECT + - DOMAIN-SUFFIX,su,DIRECT - DOMAIN-SUFFIX,xn--p1ai,DIRECT - MATCH,MAIN diff --git a/tests/expected/router-lite.yaml b/tests/expected/router-lite.yaml index 86da46e..4263fa1 100644 --- a/tests/expected/router-lite.yaml +++ b/tests/expected/router-lite.yaml @@ -114,6 +114,15 @@ rule-providers: url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-inside.mrs" path: ./ruleset/ru-inside.mrs interval: 86400 + # Russian services outside ru-inside and outside .ru/.su/.рф (russia-only ru-services): + # not on the whitelist, so through RU everywhere but main + ru-services: + type: http + behavior: domain + format: mrs + url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-services.mrs" + path: ./ruleset/ru-services.mrs + interval: 86400 sniffer: enable: true @@ -269,7 +278,9 @@ rules: - SRC-PORT,20000-20199,TORRENT-SEL - RULE-SET,ru-inside,DIRECT - # main (home, own white IP): .ru/.рф directly; elsewhere through RU + # main (home, own white IP): ru-services and .ru/.su/.рф directly; elsewhere through RU + - RULE-SET,ru-services,RU - DOMAIN-SUFFIX,ru,RU + - DOMAIN-SUFFIX,su,RU - DOMAIN-SUFFIX,xn--p1ai,RU - MATCH,MAIN diff --git a/tests/expected/router-main.yaml b/tests/expected/router-main.yaml index 58e31c8..64368d2 100644 --- a/tests/expected/router-main.yaml +++ b/tests/expected/router-main.yaml @@ -126,6 +126,15 @@ rule-providers: url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-inside.mrs" path: ./ruleset/ru-inside.mrs interval: 86400 + # Russian services outside ru-inside and outside .ru/.su/.рф (russia-only ru-services): + # not on the whitelist, so through RU everywhere but main + ru-services: + type: http + behavior: domain + format: mrs + url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-services.mrs" + path: ./ruleset/ru-services.mrs + interval: 86400 # OpenVPN routes (OVPN_ROUTES): the file is written by mihomo-kit.sh build and # emptied by bmstu-otp.sh off, so with the tunnel off these addresses follow @@ -338,7 +347,9 @@ rules: - SRC-PORT,20000-20199,TORRENT-SEL - RULE-SET,ru-inside,DIRECT - # main (home, own white IP): .ru/.рф directly; elsewhere through RU + # main (home, own white IP): ru-services and .ru/.su/.рф directly; elsewhere through RU + - RULE-SET,ru-services,DIRECT - DOMAIN-SUFFIX,ru,DIRECT + - DOMAIN-SUFFIX,su,DIRECT - DOMAIN-SUFFIX,xn--p1ai,DIRECT - MATCH,MAIN diff --git a/tests/expected/router-minimal.yaml b/tests/expected/router-minimal.yaml index 5de65e6..f1f410f 100644 --- a/tests/expected/router-minimal.yaml +++ b/tests/expected/router-minimal.yaml @@ -81,6 +81,15 @@ rule-providers: url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-inside.mrs" path: ./ruleset/ru-inside.mrs interval: 86400 + # Russian services outside ru-inside and outside .ru/.su/.рф (russia-only ru-services): + # not on the whitelist, so through RU everywhere but main + ru-services: + type: http + behavior: domain + format: mrs + url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-services.mrs" + path: ./ruleset/ru-services.mrs + interval: 86400 sniffer: enable: true @@ -190,7 +199,9 @@ rules: - IP-CIDR,9.9.9.9/32,FOREIGN - RULE-SET,ru-inside,DIRECT - # main (home, own white IP): .ru/.рф directly; elsewhere through RU + # main (home, own white IP): ru-services and .ru/.su/.рф directly; elsewhere through RU + - RULE-SET,ru-services,DIRECT - DOMAIN-SUFFIX,ru,DIRECT + - DOMAIN-SUFFIX,su,DIRECT - DOMAIN-SUFFIX,xn--p1ai,DIRECT - MATCH,MAIN diff --git a/tests/expected/router-whitelist-ts-my.yaml b/tests/expected/router-whitelist-ts-my.yaml index deed50e..9086744 100644 --- a/tests/expected/router-whitelist-ts-my.yaml +++ b/tests/expected/router-whitelist-ts-my.yaml @@ -243,6 +243,15 @@ rule-providers: url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-inside.mrs" path: ./ruleset/ru-inside.mrs interval: 86400 + # Russian services outside ru-inside and outside .ru/.su/.рф (russia-only ru-services): + # not on the whitelist, so through RU everywhere but main + ru-services: + type: http + behavior: domain + format: mrs + url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-services.mrs" + path: ./ruleset/ru-services.mrs + interval: 86400 # services (SERVICES): geosite list anthropic of MetaCubeX/meta-rules-dat geosite-anthropic: @@ -525,7 +534,9 @@ rules: - SRC-PORT,20000-20199,TORRENT-SEL - RULE-SET,ru-inside,DIRECT - # main (home, own white IP): .ru/.рф directly; elsewhere through RU + # main (home, own white IP): ru-services and .ru/.su/.рф directly; elsewhere through RU + - RULE-SET,ru-services,RU - DOMAIN-SUFFIX,ru,RU + - DOMAIN-SUFFIX,su,RU - DOMAIN-SUFFIX,xn--p1ai,RU - MATCH,MAIN diff --git a/tests/expected/router-whitelist-ts.yaml b/tests/expected/router-whitelist-ts.yaml index 9b8efe5..c047593 100644 --- a/tests/expected/router-whitelist-ts.yaml +++ b/tests/expected/router-whitelist-ts.yaml @@ -122,6 +122,15 @@ rule-providers: url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-inside.mrs" path: ./ruleset/ru-inside.mrs interval: 86400 + # Russian services outside ru-inside and outside .ru/.su/.рф (russia-only ru-services): + # not on the whitelist, so through RU everywhere but main + ru-services: + type: http + behavior: domain + format: mrs + url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-services.mrs" + path: ./ruleset/ru-services.mrs + interval: 86400 sniffer: enable: true @@ -296,7 +305,9 @@ rules: - SRC-PORT,20000-20199,TORRENT-SEL - RULE-SET,ru-inside,DIRECT - # main (home, own white IP): .ru/.рф directly; elsewhere through RU + # main (home, own white IP): ru-services and .ru/.su/.рф directly; elsewhere through RU + - RULE-SET,ru-services,RU - DOMAIN-SUFFIX,ru,RU + - DOMAIN-SUFFIX,su,RU - DOMAIN-SUFFIX,xn--p1ai,RU - MATCH,MAIN diff --git a/tests/expected/router-whitelist.yaml b/tests/expected/router-whitelist.yaml index 51e916b..cd8e6c5 100644 --- a/tests/expected/router-whitelist.yaml +++ b/tests/expected/router-whitelist.yaml @@ -130,6 +130,15 @@ rule-providers: url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-inside.mrs" path: ./ruleset/ru-inside.mrs interval: 86400 + # Russian services outside ru-inside and outside .ru/.su/.рф (russia-only ru-services): + # not on the whitelist, so through RU everywhere but main + ru-services: + type: http + behavior: domain + format: mrs + url: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/ru-services.mrs" + path: ./ruleset/ru-services.mrs + interval: 86400 # OpenVPN routes (OVPN_ROUTES): the file is written by mihomo-kit.sh build and # emptied by bmstu-otp.sh off, so with the tunnel off these addresses follow @@ -352,7 +361,9 @@ rules: - SRC-PORT,20000-20199,TORRENT-SEL - RULE-SET,ru-inside,DIRECT - # main (home, own white IP): .ru/.рф directly; elsewhere through RU + # main (home, own white IP): ru-services and .ru/.su/.рф directly; elsewhere through RU + - RULE-SET,ru-services,RU - DOMAIN-SUFFIX,ru,RU + - DOMAIN-SUFFIX,su,RU - DOMAIN-SUFFIX,xn--p1ai,RU - MATCH,MAIN