|
|
|
@ -206,8 +206,7 @@
|
|
|
|
TARGET: "router", LOCATION: "main",
|
|
|
|
TARGET: "router", LOCATION: "main",
|
|
|
|
BOOT: "1", TORRENT: "1", PUSH: "1", OPENVPN: "0", TAILSCALE: "0", TS_EXIT: "0",
|
|
|
|
BOOT: "1", TORRENT: "1", PUSH: "1", OPENVPN: "0", TAILSCALE: "0", TS_EXIT: "0",
|
|
|
|
SUBS: "", RU_IPS: "", HY2: "",
|
|
|
|
SUBS: "", RU_IPS: "", HY2: "",
|
|
|
|
GEOIP_URL: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/geoip.dat",
|
|
|
|
RULESET_URL: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release",
|
|
|
|
GEOSITE_URL: "https://cdn.jsdelivr.net/gh/SamLatsin/russia-only@release/geosite.dat",
|
|
|
|
|
|
|
|
BOOT_LINKS: "",
|
|
|
|
BOOT_LINKS: "",
|
|
|
|
BOOT_SERVER: "", BOOT_PORT: "443", BOOT_UUID: "", BOOT_SNI: "", BOOT_PBK: "", BOOT_SID: "",
|
|
|
|
BOOT_SERVER: "", BOOT_PORT: "443", BOOT_UUID: "", BOOT_SNI: "", BOOT_PBK: "", BOOT_SID: "",
|
|
|
|
TS_HOSTNAME: "mihomo", TS_DOMAINS: "",
|
|
|
|
TS_HOSTNAME: "mihomo", TS_DOMAINS: "",
|
|
|
|
@ -498,7 +497,7 @@
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
const TEMPLATES = {
|
|
|
|
const TEMPLATES = {
|
|
|
|
"dns/10-base.yaml": "dns:\n enable: true\n ipv6: false\n respect-rules: true\n enhanced-mode: fake-ip\n fake-ip-range: 198.18.0.1/16\n fake-ip-filter:\n - '*.lan'\n - '*.local' #@router\n - '+.ru' #@!foreign\n - '+.xn--p1ai' #@router,!foreign\n - geosite:ru-inside #@router,!foreign\n # tailnet names: real 100.x addresses from MagicDNS (nameserver-policy below) #@tailscale\n - '+.ts.net' #@tailscale\n - '+.${@TS_DOMAINS}' #@tailscale\n\n default-nameserver:\n - 77.88.8.8\n - 1.1.1.1 #@router\n - 223.5.5.5 #@mobile\n\n proxy-server-nameserver:\n - https://77.88.8.8/dns-query\n\n direct-nameserver:\n - 77.88.8.8 #@!foreign\n - 77.88.8.1 #@!foreign\n - 1.1.1.1 #@foreign\n - 8.8.8.8 #@foreign\n\n nameserver:\n - https://1.1.1.1/dns-query #@router\n - https://dns.google/dns-query\n - https://1.1.1.1/dns-query #@mobile\n\n # MagicDNS of the embedded Tailscale (the proxy named \"tailscale\") #@tailscale\n nameserver-policy: #@tailscale\n '+.ts.net': tailscale://tailscale #@tailscale\n '+.${@TS_DOMAINS}': tailscale://tailscale #@tailscale\n",
|
|
|
|
"dns/10-base.yaml": "dns:\n enable: true\n ipv6: false\n respect-rules: true\n enhanced-mode: fake-ip\n fake-ip-range: 198.18.0.1/16\n fake-ip-filter:\n - '*.lan'\n - '*.local' #@router\n - '+.ru' #@!foreign\n - '+.xn--p1ai' #@router,!foreign\n - rule-set:ru-inside #@router,!foreign\n # tailnet names: real 100.x addresses from MagicDNS (nameserver-policy below) #@tailscale\n - '+.ts.net' #@tailscale\n - '+.${@TS_DOMAINS}' #@tailscale\n\n default-nameserver:\n - 77.88.8.8\n - 1.1.1.1 #@router\n - 223.5.5.5 #@mobile\n\n proxy-server-nameserver:\n - https://77.88.8.8/dns-query\n\n direct-nameserver:\n - 77.88.8.8 #@!foreign\n - 77.88.8.1 #@!foreign\n - 1.1.1.1 #@foreign\n - 8.8.8.8 #@foreign\n\n nameserver:\n - https://1.1.1.1/dns-query #@router\n - https://dns.google/dns-query\n - https://1.1.1.1/dns-query #@mobile\n\n # MagicDNS of the embedded Tailscale (the proxy named \"tailscale\") #@tailscale\n nameserver-policy: #@tailscale\n '+.ts.net': tailscale://tailscale #@tailscale\n '+.${@TS_DOMAINS}': tailscale://tailscale #@tailscale\n",
|
|
|
|
"groups/10-boot.yaml": " # BOOT: whitelisted entry nodes (BOOT_LINKS), the first alive one\n - name: BOOT\n type: fallback\n proxies: [${SEED_LIST}]\n url: \"https://www.gstatic.com/generate_204\"\n interval: 300\n lazy: false\n",
|
|
|
|
"groups/10-boot.yaml": " # BOOT: whitelisted entry nodes (BOOT_LINKS), the first alive one\n - name: BOOT\n type: fallback\n proxies: [${SEED_LIST}]\n url: \"https://www.gstatic.com/generate_204\"\n interval: 300\n lazy: false\n",
|
|
|
|
"groups/15-sub.yaml": " # default for downloading subscriptions: BOOT (if set), else the nodes of the\n # saved subscriptions (providers are cached on disk), else direct. FOREIGN goes\n # before DIRECT: the health check of DIRECT (gstatic) passes in Russia even when\n # the subscription site itself is blocked.\n - name: BOOT-AUTO\n type: fallback\n proxies: [BOOT, FOREIGN, DIRECT] #@boot\n proxies: [FOREIGN, DIRECT] #@!boot\n url: \"https://www.gstatic.com/generate_204\"\n interval: 300\n lazy: false\n",
|
|
|
|
"groups/15-sub.yaml": " # default for downloading subscriptions: BOOT (if set), else the nodes of the\n # saved subscriptions (providers are cached on disk), else direct. FOREIGN goes\n # before DIRECT: the health check of DIRECT (gstatic) passes in Russia even when\n # the subscription site itself is blocked.\n - name: BOOT-AUTO\n type: fallback\n proxies: [BOOT, FOREIGN, DIRECT] #@boot\n proxies: [FOREIGN, DIRECT] #@!boot\n url: \"https://www.gstatic.com/generate_204\"\n interval: 300\n lazy: false\n",
|
|
|
|
"groups/20-sub.yaml": " - name: RU\n type: url-test\n use: [${SUB_LIST}]\n filter: \"(?i)🇷🇺|\\\\bru\\\\b|russia|росси|моск\"\n url: \"https://ya.ru\"\n interval: 300\n tolerance: 50\n lazy: false\n\n - name: FOREIGN\n type: url-test\n use: [${SUB_LIST}]\n exclude-filter: \"(?i)🇷🇺|\\\\bru\\\\b|russia|росси|моск\"\n url: \"https://www.gstatic.com/generate_204\"\n interval: 300\n tolerance: 50\n lazy: false\n",
|
|
|
|
"groups/20-sub.yaml": " - name: RU\n type: url-test\n use: [${SUB_LIST}]\n filter: \"(?i)🇷🇺|\\\\bru\\\\b|russia|росси|моск\"\n url: \"https://ya.ru\"\n interval: 300\n tolerance: 50\n lazy: false\n\n - name: FOREIGN\n type: url-test\n use: [${SUB_LIST}]\n exclude-filter: \"(?i)🇷🇺|\\\\bru\\\\b|russia|росси|моск\"\n url: \"https://www.gstatic.com/generate_204\"\n interval: 300\n tolerance: 50\n lazy: false\n",
|
|
|
|
@ -512,13 +511,13 @@ const TEMPLATES = {
|
|
|
|
"groups/90-base.yaml": " - name: MAIN\n type: select\n proxies: [FOREIGN, ${HY2_MAIN}RU, DIRECT${CSQTT_MAIN}] #@!foreign\n # abroad: direct by default, own servers / pools by hand #@foreign\n proxies: [DIRECT, ${HY2_MAIN}FOREIGN, RU${CSQTT_MAIN}] #@foreign\n",
|
|
|
|
"groups/90-base.yaml": " - name: MAIN\n type: select\n proxies: [FOREIGN, ${HY2_MAIN}RU, DIRECT${CSQTT_MAIN}] #@!foreign\n # abroad: direct by default, own servers / pools by hand #@foreign\n proxies: [DIRECT, ${HY2_MAIN}FOREIGN, RU${CSQTT_MAIN}] #@foreign\n",
|
|
|
|
"groups/91-torrent.yaml": " - name: TORRENT-SEL\n type: select\n proxies: [TORRENT, FOREIGN, DIRECT]\n",
|
|
|
|
"groups/91-torrent.yaml": " - name: TORRENT-SEL\n type: select\n proxies: [TORRENT, FOREIGN, DIRECT]\n",
|
|
|
|
"groups/92-push.yaml": " - name: PUSH\n type: select\n proxies: [DIRECT, ${HY2_MAIN}FOREIGN] #@!whitelist\n proxies: [${HY2_MAIN}FOREIGN, DIRECT] #@whitelist\n",
|
|
|
|
"groups/92-push.yaml": " - name: PUSH\n type: select\n proxies: [DIRECT, ${HY2_MAIN}FOREIGN] #@!whitelist\n proxies: [${HY2_MAIN}FOREIGN, DIRECT] #@whitelist\n",
|
|
|
|
"head/10-base.yaml": "geodata-mode: true\ngeodata-loader: memconservative\ngeo-auto-update: true\ngeo-update-interval: 24\ngeox-url:\n geoip: \"${GEOIP_URL}\"\n geosite: \"${GEOSITE_URL}\"\n",
|
|
|
|
|
|
|
|
"providers/10-sub.each.yaml": " ${SUB_NAME}:\n type: http\n url: \"${SUB_URL}\"\n path: ./providers/${SUB_NAME}.yaml\n interval: 3600\n proxy: ${@SUB_PROXY}\n exclude-filter: \"(?i)app not supported|приложение не|свяжитесь\"\n override: #@csqtt\n dialer-proxy: UPLINK #@csqtt\n header:\n User-Agent: [\"${SUB_UA}\"]\n ${@@SUB_HEADERS}\n health-check:\n enable: true\n url: \"https://www.gstatic.com/generate_204\"\n interval: 300\n timeout: 3000\n lazy: false\n",
|
|
|
|
"providers/10-sub.each.yaml": " ${SUB_NAME}:\n type: http\n url: \"${SUB_URL}\"\n path: ./providers/${SUB_NAME}.yaml\n interval: 3600\n proxy: ${@SUB_PROXY}\n exclude-filter: \"(?i)app not supported|приложение не|свяжитесь\"\n override: #@csqtt\n dialer-proxy: UPLINK #@csqtt\n header:\n User-Agent: [\"${SUB_UA}\"]\n ${@@SUB_HEADERS}\n health-check:\n enable: true\n url: \"https://www.gstatic.com/generate_204\"\n interval: 300\n timeout: 3000\n lazy: false\n",
|
|
|
|
"providers/20-openvpn.yaml": " # OpenVPN: file written on the router by bmstu-otp.sh (fresh TOTP in the\n # password). No health-check here: a dead tunnel would be redialed with a\n # stale OTP; the cron watchdog (bmstu-otp.sh check) handles it.\n ${OVPN_PROVIDER}:\n type: file\n path: ./providers/${OVPN_PROVIDER}.yaml\n health-check:\n enable: false\n override: #@ovpn_exit\n dialer-proxy: OVPN-EXIT #@ovpn_exit\n",
|
|
|
|
"providers/20-openvpn.yaml": " # OpenVPN: file written on the router by bmstu-otp.sh (fresh TOTP in the\n # password). No health-check here: a dead tunnel would be redialed with a\n # stale OTP; the cron watchdog (bmstu-otp.sh check) handles it.\n ${OVPN_PROVIDER}:\n type: file\n path: ./providers/${OVPN_PROVIDER}.yaml\n health-check:\n enable: false\n override: #@ovpn_exit\n dialer-proxy: OVPN-EXIT #@ovpn_exit\n",
|
|
|
|
"proxies/10-boot.each.yaml": " - name: ${SEED_NAME}\n type: vless\n server: ${SEED_SERVER}\n port: ${SEED_PORT}\n uuid: ${SEED_UUID}\n network: tcp\n udp: true\n tls: true\n flow: xtls-rprx-vision\n servername: ${SEED_SNI}\n client-fingerprint: firefox\n reality-opts:\n public-key: ${SEED_PBK}\n short-id: ${SEED_SID}\n dialer-proxy: UPLINK #@csqtt\n",
|
|
|
|
"proxies/10-boot.each.yaml": " - name: ${SEED_NAME}\n type: vless\n server: ${SEED_SERVER}\n port: ${SEED_PORT}\n uuid: ${SEED_UUID}\n network: tcp\n udp: true\n tls: true\n flow: xtls-rprx-vision\n servername: ${SEED_SNI}\n client-fingerprint: firefox\n reality-opts:\n public-key: ${SEED_PBK}\n short-id: ${SEED_SID}\n dialer-proxy: UPLINK #@csqtt\n",
|
|
|
|
"proxies/20-tailscale.yaml": " # Tailscale: userspace node, starts on first use. First login: open the URL\n # from the nikki log (\"To start this tsnet server ... go to: ...\"), then\n # disable key expiry for this node. Needs TS_FORCE_NOISE_443=true in the\n # mihomo environment (mihomo-kit.sh fix).\n - name: tailscale\n type: tailscale\n hostname: ${TS_HOSTNAME}\n state-dir: ./tailscale\n udp: true\n accept-routes: true\n dialer-proxy: TS-EXIT #@ts_exit\n # whitelist: control and DERP over TCP through own servers (MY -> hysteria2 -> MY-EXIT); #@whitelist,hy2,!ts_exit\n # needs the kit's core (v1.19.32-ts1, tools/core/*.patch, MetaCubeX/mihomo#3142) #@whitelist,hy2,!ts_exit\n dialer-proxy: MY #@whitelist,hy2,!ts_exit\n",
|
|
|
|
"proxies/20-tailscale.yaml": " # Tailscale: userspace node, starts on first use. First login: open the URL\n # from the nikki log (\"To start this tsnet server ... go to: ...\"), then\n # disable key expiry for this node. Needs TS_FORCE_NOISE_443=true in the\n # mihomo environment (mihomo-kit.sh fix).\n - name: tailscale\n type: tailscale\n hostname: ${TS_HOSTNAME}\n state-dir: ./tailscale\n udp: true\n accept-routes: true\n dialer-proxy: TS-EXIT #@ts_exit\n # whitelist: control and DERP over TCP through own servers (MY -> hysteria2 -> MY-EXIT); #@whitelist,hy2,!ts_exit\n # needs the kit's core (v1.19.32-ts1, tools/core/*.patch, MetaCubeX/mihomo#3142) #@whitelist,hy2,!ts_exit\n dialer-proxy: MY #@whitelist,hy2,!ts_exit\n",
|
|
|
|
"proxies/30-hy2.each.yaml": " - name: ${HY2_NAME}\n type: hysteria2\n server: ${HY2_SERVER}\n port: ${HY2_PORT}\n password: \"${HY2_PASSWORD}\"\n obfs: ${@HY2_OBFS}\n obfs-password: \"${@@HY2_OBFS_PASSWORD}\"\n sni: ${@HY2_SNI}\n skip-cert-verify: ${HY2_INSECURE}\n up: \"${@@HY2_UP}\"\n down: \"${@@HY2_DOWN}\"\n udp: true\n dialer-proxy: MY-EXIT #@hy2_exit\n dialer-proxy: UPLINK #@csqtt,!hy2_exit\n",
|
|
|
|
"proxies/30-hy2.each.yaml": " - name: ${HY2_NAME}\n type: hysteria2\n server: ${HY2_SERVER}\n port: ${HY2_PORT}\n password: \"${HY2_PASSWORD}\"\n obfs: ${@HY2_OBFS}\n obfs-password: \"${@@HY2_OBFS_PASSWORD}\"\n sni: ${@HY2_SNI}\n skip-cert-verify: ${HY2_INSECURE}\n up: \"${@@HY2_UP}\"\n down: \"${@@HY2_DOWN}\"\n udp: true\n dialer-proxy: MY-EXIT #@hy2_exit\n dialer-proxy: UPLINK #@csqtt,!hy2_exit\n",
|
|
|
|
"proxies/40-csqtt.yaml": " # CSQTT (star-panel-csqtt): tunnel interface csqtt0 on the router, mihomo\n # just sends the connection out of it (the interface does not change routes)\n - name: CSQTT\n type: direct\n interface-name: ${CSQTT_IFACE}\n udp: true\n",
|
|
|
|
"proxies/40-csqtt.yaml": " # CSQTT (star-panel-csqtt): tunnel interface csqtt0 on the router, mihomo\n # just sends the connection out of it (the interface does not change routes)\n - name: CSQTT\n type: direct\n interface-name: ${CSQTT_IFACE}\n udp: true\n",
|
|
|
|
|
|
|
|
"rule-providers/10-base.yaml": " # Russian services (geosite ru-inside of russia-only, as .mrs): an ordinary\n # http rule-set, so every client fetches it with the config, no geodata setup\n ru-inside:\n type: http\n behavior: domain\n format: mrs\n url: \"${RULESET_URL}/ru-inside.mrs\"\n path: ./ruleset/ru-inside.mrs\n interval: 86400\n",
|
|
|
|
"rule-providers/20-openvpn.yaml": " # OpenVPN routes (OVPN_ROUTES): the file is written by mihomo-kit.sh build and\n # emptied by bmstu-otp.sh off, so with the tunnel off these addresses follow\n # the normal rules instead of a dead BMSTU group\n ${OVPN_PROVIDER}-routes:\n type: file\n behavior: ipcidr\n path: ./providers/${OVPN_PROVIDER}-routes.yaml\n",
|
|
|
|
"rule-providers/20-openvpn.yaml": " # OpenVPN routes (OVPN_ROUTES): the file is written by mihomo-kit.sh build and\n # emptied by bmstu-otp.sh off, so with the tunnel off these addresses follow\n # the normal rules instead of a dead BMSTU group\n ${OVPN_PROVIDER}-routes:\n type: file\n behavior: ipcidr\n path: ./providers/${OVPN_PROVIDER}-routes.yaml\n",
|
|
|
|
"rules/05-csqtt.yaml": " # the CSQTT client's own connections (peer, VK TURN) must not go into its tunnel\n - PROCESS-NAME,${@CSQTT_PROCESS},DIRECT\n",
|
|
|
|
"rules/05-csqtt.yaml": " # the CSQTT client's own connections (peer, VK TURN) must not go into its tunnel\n - PROCESS-NAME,${@CSQTT_PROCESS},DIRECT\n",
|
|
|
|
"rules/10-tailscale.yaml": " # Tailscale: tailnet IPs and MagicDNS names (resolved by tailscale itself)\n - IP-CIDR,100.64.0.0/10,TAILSCALE,no-resolve\n - DOMAIN-SUFFIX,ts.net,TAILSCALE\n - DOMAIN-SUFFIX,${@TS_DOMAINS},TAILSCALE\n",
|
|
|
|
"rules/10-tailscale.yaml": " # Tailscale: tailnet IPs and MagicDNS names (resolved by tailscale itself)\n - IP-CIDR,100.64.0.0/10,TAILSCALE,no-resolve\n - DOMAIN-SUFFIX,ts.net,TAILSCALE\n - DOMAIN-SUFFIX,${@TS_DOMAINS},TAILSCALE\n",
|
|
|
|
@ -527,7 +526,7 @@ const TEMPLATES = {
|
|
|
|
"rules/35-push.yaml": " # push notifications (Apple APNs, Google FCM): long-lived connections on a\n # stable path - group PUSH (main/foreign: DIRECT, whitelist: MY)\n - DOMAIN-SUFFIX,push.apple.com,PUSH\n - IP-CIDR,17.249.0.0/16,PUSH,no-resolve\n - IP-CIDR,17.252.0.0/16,PUSH,no-resolve\n - IP-CIDR,17.57.144.0/22,PUSH,no-resolve\n - IP-CIDR,17.188.128.0/18,PUSH,no-resolve\n - IP-CIDR,17.188.20.0/23,PUSH,no-resolve\n - DOMAIN-REGEX,^(alt[0-9]+-)?mtalk[0-9]*\\.google\\.com$,PUSH\n - DST-PORT,5228-5230,PUSH\n",
|
|
|
|
"rules/35-push.yaml": " # push notifications (Apple APNs, Google FCM): long-lived connections on a\n # stable path - group PUSH (main/foreign: DIRECT, whitelist: MY)\n - DOMAIN-SUFFIX,push.apple.com,PUSH\n - IP-CIDR,17.249.0.0/16,PUSH,no-resolve\n - IP-CIDR,17.252.0.0/16,PUSH,no-resolve\n - IP-CIDR,17.57.144.0/22,PUSH,no-resolve\n - IP-CIDR,17.188.128.0/18,PUSH,no-resolve\n - IP-CIDR,17.188.20.0/23,PUSH,no-resolve\n - DOMAIN-REGEX,^(alt[0-9]+-)?mtalk[0-9]*\\.google\\.com$,PUSH\n - DST-PORT,5228-5230,PUSH\n",
|
|
|
|
"rules/40-base.yaml": " # main (home, own white IP): reachable directly; whitelist/abroad: through RU\n - IP-CIDR,${@RU_IPS},DIRECT #@main\n - IP-CIDR,${@RU_IPS},RU #@!main\n",
|
|
|
|
"rules/40-base.yaml": " # main (home, own white IP): reachable directly; whitelist/abroad: through RU\n - IP-CIDR,${@RU_IPS},DIRECT #@main\n - IP-CIDR,${@RU_IPS},RU #@!main\n",
|
|
|
|
"rules/50-torrent.yaml": " - SRC-PORT,20000-20199,TORRENT-SEL\n",
|
|
|
|
"rules/50-torrent.yaml": " - SRC-PORT,20000-20199,TORRENT-SEL\n",
|
|
|
|
"rules/90-base.yaml": " - GEOSITE,ru-inside,DIRECT #@!foreign\n # abroad: Russian services through the RU pool too #@foreign\n - GEOSITE,ru-inside,RU #@foreign\n # main (home, own white IP): .ru/.рф directly; elsewhere through RU\n - DOMAIN-SUFFIX,ru,DIRECT #@main\n - DOMAIN-SUFFIX,xn--p1ai,DIRECT #@main\n - DOMAIN-SUFFIX,ru,RU #@!main\n - DOMAIN-SUFFIX,xn--p1ai,RU #@!main\n - MATCH,MAIN\n",
|
|
|
|
"rules/90-base.yaml": " - RULE-SET,ru-inside,DIRECT #@!foreign\n # abroad: Russian services through the RU pool too #@foreign\n - RULE-SET,ru-inside,RU #@foreign\n # main (home, own white IP): .ru/.рф directly; elsewhere through RU\n - DOMAIN-SUFFIX,ru,DIRECT #@main\n - DOMAIN-SUFFIX,xn--p1ai,DIRECT #@main\n - DOMAIN-SUFFIX,ru,RU #@!main\n - DOMAIN-SUFFIX,xn--p1ai,RU #@!main\n - MATCH,MAIN\n",
|
|
|
|
"sniffer/10-base.yaml": "sniffer:\n enable: true\n force-dns-mapping: true\n parse-pure-ip: true\n override-destination: false\n sniff:\n HTTP:\n ports: [80, 8080-8880]\n TLS:\n ports: [443, 8443]\n QUIC:\n ports: [443, 8443]\n"
|
|
|
|
"sniffer/10-base.yaml": "sniffer:\n enable: true\n force-dns-mapping: true\n parse-pure-ip: true\n override-destination: false\n sniff:\n HTTP:\n ports: [80, 8080-8880]\n TLS:\n ports: [443, 8443]\n QUIC:\n ports: [443, 8443]\n"
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const D = MihomoKit.DEFAULTS;
|
|
|
|
const D = MihomoKit.DEFAULTS;
|
|
|
|
|