proxies: - name: seed type: vless server: 1.2.3.4 port: 443 uuid: 00000000-0000-0000-0000-000000000000 network: tcp udp: true tls: true flow: xtls-rprx-vision servername: eh.vk.ru client-fingerprint: firefox reality-opts: public-key: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA short-id: a1b2 dialer-proxy: UPLINK # Tailscale: userspace node, starts on first use. First login: open the URL # from the nikki log ("To start this tsnet server ... go to: ..."), then # disable key expiry for this node. Needs TS_FORCE_NOISE_443=true in the # mihomo environment (mihomo-kit.sh fix). - name: tailscale type: tailscale hostname: test-mihomo state-dir: ./tailscale udp: true accept-routes: true # whitelist: control and DERP over TCP through own servers (MY -> own node -> MY-EXIT); # MY holds hysteria2 from the settings and "[MY]" nodes of the subscriptions; empty MY is direct # needs the kit's core (v1.19.32-ts1, tools/core/*.patch, MetaCubeX/mihomo#3142) dialer-proxy: MY # own servers of the settings (LuCI "Свои серверы", /etc/nikki/my-servers): one JSON # proxy per line, as mihomo's own config would have it; the kit puts dialer-proxy in # front: whitelist and the phone through MY-EXIT, else with UPLINK (CSQTT, pools) through it. # A server with an entry of its own (LuCI "Вход") keeps it in every profile - {"dialer-proxy": "MY-EXIT", "name":"🇩🇪 de 1","type":"vless","server":"x.example.com","port":"443","uuid":"00000000-0000-0000-0000-000000000001","udp":true,"tls":true,"client-fingerprint":"chrome","servername":"www.example.com","reality-opts":{"public-key":"Nc9ZSDuQMwHN4M6TeDHjfJhgZ6SBTBbfMwx5iHQZ1ns","short-id":"ab"},"xudp":true,"network":"xhttp","xhttp-opts":{"path":"/x"}} - {"dialer-proxy": "MY-EXIT", "name":"tr \"q\"","type":"trojan","server":"t.example.org","port":"443","password":"p\u0024w","udp":true,"skip-cert-verify":false,"sni":"t.example.org","network":"grpc","grpc-opts":{"grpc-service-name":"g"},"client-fingerprint":"chrome"} - {"dialer-proxy": "MY-EXIT", "name":"hy-own","type":"hysteria2","server":"h.example.net","port":8443,"password":"a\u0024b","obfs":"salamander","obfs-password":"o","up":"50 mbps"} - {"dialer-proxy": "MY-EXIT", "name":"awg-own","type":"wireguard","server":"203.0.113.10","port":47613,"ip":"10.8.1.2","private-key":"fTo2df+b5vCuulh7pOXMWiWJY2VwSe2Kuup2nA34tfI=","public-key":"vGYpG72gCXPNfYzr/0iNfSoL83vbrVSGUC+v+MKRVyE=","pre-shared-key":"6ut/J6EuaJ97RMFcZuiJkzIo7a5uxR98htK5NdWJW6E=","persistent-keepalive":25,"udp":true,"amnezia-wg-option":{"jc":4,"jmin":10,"jmax":50,"s1":98,"s2":32,"s3":19,"s4":7,"h1":"1458367412-1593426716","h2":"1863071624-1902347825","h3":"2091548318-2097143921","h4":"2112573893-2147191025","i1":""}} - {"name":"via-foreign","type":"ss","server":"f.example.com","port":8388,"cipher":"aes-256-gcm","password":"x","dialer-proxy":"FOREIGN"} # copies of own servers for the chains (SVC__CHAIN, POOL__UPLINK): the same # server dialing through another entry, named " ⟶ " (group " ⟶ ") - {"dialer-proxy": "WL", "name":"🇩🇪 de 1 ⟶ WL","type":"vless","server":"x.example.com","port":"443","uuid":"00000000-0000-0000-0000-000000000001","udp":true,"tls":true,"client-fingerprint":"chrome","servername":"www.example.com","reality-opts":{"public-key":"Nc9ZSDuQMwHN4M6TeDHjfJhgZ6SBTBbfMwx5iHQZ1ns","short-id":"ab"},"xudp":true,"network":"xhttp","xhttp-opts":{"path":"/x"}} - {"dialer-proxy": "WL", "name":"hy-own ⟶ WL","type":"hysteria2","server":"h.example.net","port":8443,"password":"a\u0024b","obfs":"salamander","obfs-password":"o","up":"50 mbps"} - {"dialer-proxy": "FOREIGN", "name":"🇩🇪 de 1 ⟶ FOREIGN","type":"vless","server":"x.example.com","port":"443","uuid":"00000000-0000-0000-0000-000000000001","udp":true,"tls":true,"client-fingerprint":"chrome","servername":"www.example.com","reality-opts":{"public-key":"Nc9ZSDuQMwHN4M6TeDHjfJhgZ6SBTBbfMwx5iHQZ1ns","short-id":"ab"},"xudp":true,"network":"xhttp","xhttp-opts":{"path":"/x"}} - {"dialer-proxy": "FOREIGN", "name":"tr \"q\" ⟶ FOREIGN","type":"trojan","server":"t.example.org","port":"443","password":"p\u0024w","udp":true,"skip-cert-verify":false,"sni":"t.example.org","network":"grpc","grpc-opts":{"grpc-service-name":"g"},"client-fingerprint":"chrome"} - {"dialer-proxy": "FOREIGN", "name":"hy-own ⟶ FOREIGN","type":"hysteria2","server":"h.example.net","port":8443,"password":"a\u0024b","obfs":"salamander","obfs-password":"o","up":"50 mbps"} - {"dialer-proxy": "FOREIGN", "name":"awg-own ⟶ FOREIGN","type":"wireguard","server":"203.0.113.10","port":47613,"ip":"10.8.1.2","private-key":"fTo2df+b5vCuulh7pOXMWiWJY2VwSe2Kuup2nA34tfI=","public-key":"vGYpG72gCXPNfYzr/0iNfSoL83vbrVSGUC+v+MKRVyE=","pre-shared-key":"6ut/J6EuaJ97RMFcZuiJkzIo7a5uxR98htK5NdWJW6E=","persistent-keepalive":25,"udp":true,"amnezia-wg-option":{"jc":4,"jmin":10,"jmax":50,"s1":98,"s2":32,"s3":19,"s4":7,"h1":"1458367412-1593426716","h2":"1863071624-1902347825","h3":"2091548318-2097143921","h4":"2112573893-2147191025","i1":""}} - {"dialer-proxy": "FOREIGN", "name":"via-foreign ⟶ FOREIGN","type":"ss","server":"f.example.com","port":8388,"cipher":"aes-256-gcm","password":"x"} proxy-providers: example: type: http url: "https://sub.example.com/sub/aaa" path: ./providers/example.yaml interval: 3600 proxy: BOOT-AUTO exclude-filter: "(?i)app not supported|приложение не|свяжитесь|\\[MY\\]" override: dialer-proxy: UPLINK header: User-Agent: ["mihomo"] # one check per provider: the groups over it (use:) only add their URLs to it, # so the interval and lazy here are what counts for RU/FOREIGN/TORRENT/MY-EXIT. # lite: every 10 min and skipped while no traffic used the provider health-check: enable: true url: "https://www.gstatic.com/generate_204" interval: 300 timeout: 3000 lazy: false example2: type: http url: "https://sub2.example.com/x?a=1&b=2" path: ./providers/example2.yaml interval: 3600 proxy: BOOT-AUTO exclude-filter: "(?i)app not supported|приложение не|свяжитесь|\\[MY\\]" override: dialer-proxy: UPLINK header: User-Agent: ["mihomo"] # one check per provider: the groups over it (use:) only add their URLs to it, # so the interval and lazy here are what counts for RU/FOREIGN/TORRENT/MY-EXIT. # lite: every 10 min and skipped while no traffic used the provider health-check: enable: true url: "https://www.gstatic.com/generate_204" interval: 300 timeout: 3000 lazy: false # own servers kept in the subscription, named "[MY] ...", for group MY (the main # provider leaves them out); a provider of its own because on whitelist and the # phone they go through MY-EXIT. Router: not a second download, reads the file the # main provider saves (mihomo watches it; ./providers exists before the start, # ovpn_routes_write). Phone: FlClash moves provider files to paths of its own, # so the subscription is fetched once more. Nodes with an entry of their own # (MY_NODE_ENTRIES) are left out here for -my-via- (providers/16-myvia). example-my: type: file path: ./providers/example.yaml filter: "(?i)\\[MY\\]" override: dialer-proxy: MY-EXIT health-check: enable: true url: "https://www.gstatic.com/generate_204" interval: 300 timeout: 3000 lazy: false # own servers kept in the subscription, named "[MY] ...", for group MY (the main # provider leaves them out); a provider of its own because on whitelist and the # phone they go through MY-EXIT. Router: not a second download, reads the file the # main provider saves (mihomo watches it; ./providers exists before the start, # ovpn_routes_write). Phone: FlClash moves provider files to paths of its own, # so the subscription is fetched once more. Nodes with an entry of their own # (MY_NODE_ENTRIES) are left out here for -my-via- (providers/16-myvia). example2-my: type: file path: ./providers/example2.yaml filter: "(?i)\\[MY\\]" override: dialer-proxy: MY-EXIT health-check: enable: true url: "https://www.gstatic.com/generate_204" interval: 300 timeout: 3000 lazy: false # own servers as links (MY_LINKS, LuCI "Свои серверы (ссылки)"): kit writes them to # this file on build, mihomo parses vless/vmess/trojan/ss/hysteria2/tuic/anytls links # like a subscription; group MY, named "[MY] ..." like the [MY] nodes of the subscriptions my-links: type: file path: ./providers/my-links.txt override: additional-prefix: "[MY] " dialer-proxy: MY-EXIT health-check: enable: true url: "https://www.gstatic.com/generate_204" interval: 300 timeout: 3000 lazy: false # example for the chains through DIRECT: the same nodes, named "... ⟶ DIRECT" example@DIRECT: type: file path: ./providers/example.yaml exclude-filter: "(?i)app not supported|приложение не|свяжитесь|\\[MY\\]" override: additional-suffix: " ⟶ DIRECT" health-check: enable: true url: "https://www.gstatic.com/generate_204" interval: 300 timeout: 3000 lazy: false # example for the chains through WL: the same nodes, named "... ⟶ WL" example@WL: type: file path: ./providers/example.yaml exclude-filter: "(?i)app not supported|приложение не|свяжитесь|\\[MY\\]" override: additional-suffix: " ⟶ WL" dialer-proxy: WL health-check: enable: true url: "https://www.gstatic.com/generate_204" interval: 300 timeout: 3000 lazy: false # example2-my for the chains through WL: the same nodes, named "... ⟶ WL" example2-my@WL: type: file path: ./providers/example2.yaml filter: "(?i)\\[MY\\]" override: additional-suffix: " ⟶ WL" dialer-proxy: WL health-check: enable: true url: "https://www.gstatic.com/generate_204" interval: 300 timeout: 3000 lazy: false # example-my for the chains through FOREIGN: the same nodes, named "... ⟶ FOREIGN" example-my@FOREIGN: type: file path: ./providers/example.yaml filter: "(?i)\\[MY\\]" override: additional-suffix: " ⟶ FOREIGN" dialer-proxy: FOREIGN health-check: enable: true url: "https://www.gstatic.com/generate_204" interval: 300 timeout: 3000 lazy: false # example2-my for the chains through FOREIGN: the same nodes, named "... ⟶ FOREIGN" example2-my@FOREIGN: type: file path: ./providers/example2.yaml filter: "(?i)\\[MY\\]" override: additional-suffix: " ⟶ FOREIGN" dialer-proxy: FOREIGN health-check: enable: true url: "https://www.gstatic.com/generate_204" interval: 300 timeout: 3000 lazy: false # my-links for the chains through FOREIGN: the same nodes, named "... ⟶ FOREIGN" my-links@FOREIGN: type: file path: ./providers/my-links.txt override: additional-prefix: "[MY] " additional-suffix: " ⟶ FOREIGN" dialer-proxy: FOREIGN health-check: enable: true url: "https://www.gstatic.com/generate_204" interval: 300 timeout: 3000 lazy: false rule-providers: # Russian services (geosite ru-inside of russia-only, as .mrs): an ordinary # http rule-set, so every client fetches it with the config, no geodata setup ru-inside: type: http behavior: domain format: mrs 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: type: http behavior: domain format: mrs url: "https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geosite/anthropic.mrs" path: ./ruleset/geosite-anthropic.mrs interval: 86400 # services (SERVICES): geosite list openai of MetaCubeX/meta-rules-dat geosite-openai: type: http behavior: domain format: mrs url: "https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@meta/geo/geosite/openai.mrs" path: ./ruleset/geosite-openai.mrs interval: 86400 # service yt: domains of its hostlists (SVC__HOSTLIST, e.g. zapret's # /opt/zapret2/ipset/*.txt), read when the profile is built: rebuild to pick up changes hostlist-yt: type: inline behavior: domain payload: - "+.youtube.com" - "+.youtu.be" - "+.googlevideo.com" - "exact.example" - "+.wild.example" - "+.dot.example" - "+.ggpht.com" sniffer: enable: true force-dns-mapping: true parse-pure-ip: true override-destination: false # ECH: browsers show the outer name cloudflare-ech.com instead of the site behind # Cloudflare; the sniffed name wins in the rules, so .ru / own lists would miss the # site. Skipped: the rules see the name from mihomo's DNS (fake-ip / DNS mapping). skip-domain: - "+.cloudflare-ech.com" sniff: HTTP: ports: [80, 8080-8880] TLS: ports: [443, 8443] # lite: no QUIC (fake-ip already gives the domain; pure-IP QUIC goes by IP) QUIC: ports: [443, 8443] dns: enable: true ipv6: false respect-rules: true enhanced-mode: fake-ip fake-ip-range: 198.18.0.1/16 fake-ip-filter: - '*.lan' - '*.local' - '+.ru' - '+.xn--p1ai' - rule-set:ru-inside # tailnet names: real 100.x addresses from MagicDNS (nameserver-policy below) - '+.ts.net' default-nameserver: - 77.88.8.8 - 1.1.1.1 proxy-server-nameserver: - https://77.88.8.8/dns-query direct-nameserver: - 77.88.8.8 - 77.88.8.1 nameserver: - https://1.1.1.1/dns-query - https://dns.google/dns-query # MagicDNS of the embedded Tailscale (the proxy named "tailscale") nameserver-policy: '+.ts.net': tailscale://tailscale proxy-groups: # BOOT: whitelisted entry nodes (BOOT_LINKS), the first alive one - name: BOOT type: fallback proxies: [seed] url: "https://www.gstatic.com/generate_204" interval: 300 lazy: false # default for downloading subscriptions: BOOT (if set), else the nodes of the # saved subscriptions (providers are cached on disk), else direct. FOREIGN goes # before DIRECT: the health check of DIRECT (gstatic) passes in Russia even when # the subscription site itself is blocked. - name: BOOT-AUTO type: fallback proxies: [BOOT, FOREIGN, DIRECT] url: "https://www.gstatic.com/generate_204" interval: 300 lazy: false - name: RU type: url-test use: [example, example2] filter: "(?i)🇷🇺|\\bru\\b|russia|росси|моск" # lite: the provider's URL, so RU nodes are not tested a second time url: "https://ya.ru" interval: 300 tolerance: 50 lazy: false - name: FOREIGN type: url-test use: [example, example2] exclude-filter: "(?i)🇷🇺|\\bru\\b|russia|росси|моск" url: "https://www.gstatic.com/generate_204" interval: 300 tolerance: 50 lazy: false - name: TORRENT type: url-test use: [example, example2] filter: "(?i)torrent|\\[tor\\]" url: "https://www.gstatic.com/generate_204" interval: 300 timeout: 6000 tolerance: 500 max-failed-times: 5 lazy: false # pool de (POOLS, POOL_*): own servers and subscription nodes picked in the settings; # filter / exclude-filter apply to the subscriptions' nodes only - name: DE type: url-test proxies: ["🇩🇪 de 1", "hy-own"] use: [example, example2-my] filter: "(?i)🇩🇪|\\bde\\b" exclude-filter: "(?i)tor" url: "https://www.gstatic.com/generate_204" interval: 300 tolerance: 50 lazy: false # pool gone (POOLS, POOL_*): own servers and subscription nodes picked in the settings; # filter / exclude-filter apply to the subscriptions' nodes only - name: GONE type: select proxies: [REJECT] # pool wl (POOLS, POOL_*): own servers and subscription nodes picked in the settings; # filter / exclude-filter apply to the subscriptions' nodes only - name: WL type: fallback use: [example] filter: "\\[WL\\]" url: "https://www.gstatic.com/generate_204" interval: 300 lazy: false # own servers: those of the settings (proxies/30-own_srv) and the "[MY] ..." nodes of # the subscriptions (providers -my); the fastest alive one; pin one in the dashboard if needed - name: MY type: url-test proxies: ["🇩🇪 de 1", "tr \"q\"", "hy-own", "awg-own", "via-foreign"] use: [example-my, example2-my, my-links] url: "https://www.gstatic.com/generate_204" interval: 300 tolerance: 50 lazy: false # whitelist and mobile (my_exit): what own servers are reached through; switches only when the node is # clearly worse or dead (each switch breaks everything going through MY) - name: MY-EXIT type: url-test use: [example, example2] exclude-filter: "(?i)🇷🇺|\\bru\\b|russia|росси|моск" url: "https://www.gstatic.com/generate_204" interval: 300 tolerance: 300 lazy: false # service claude (SERVICES, SVC_*): its own way, whatever MAIN is - name: CLAUDE type: select proxies: ["DE ⟶ WL", DE, MY, FOREIGN, RU, DIRECT] # service chat (SERVICES, SVC_*): its own way, whatever MAIN is - name: CHAT type: select proxies: ["MY ⟶ FOREIGN", MY, FOREIGN, RU, DIRECT] # service yt (SERVICES, SVC_*): its own way, whatever MAIN is - name: YT type: select proxies: [RU, MY, FOREIGN, DIRECT] # WL through DIRECT (SVC__CHAIN, POOL__UPLINK): its servers and # nodes, each dialing through DIRECT - name: "WL ⟶ DIRECT" type: fallback use: [example@DIRECT] filter: "\\[WL\\]" url: "https://www.gstatic.com/generate_204" interval: 300 lazy: false # DE through WL (SVC__CHAIN, POOL__UPLINK): its servers and # nodes, each dialing through WL - name: "DE ⟶ WL" type: url-test proxies: ["🇩🇪 de 1 ⟶ WL", "hy-own ⟶ WL"] use: [example@WL, example2-my@WL] filter: "(?i)🇩🇪|\\bde\\b" exclude-filter: "(?i)tor" url: "https://www.gstatic.com/generate_204" interval: 300 tolerance: 50 lazy: false # MY through FOREIGN (SVC__CHAIN, POOL__UPLINK): its servers and # nodes, each dialing through FOREIGN - name: "MY ⟶ FOREIGN" type: fallback proxies: ["🇩🇪 de 1 ⟶ FOREIGN", "tr \"q\" ⟶ FOREIGN", "hy-own ⟶ FOREIGN", "awg-own ⟶ FOREIGN", "via-foreign ⟶ FOREIGN"] use: [example-my@FOREIGN, example2-my@FOREIGN, my-links@FOREIGN] url: "https://www.gstatic.com/generate_204" interval: 300 lazy: false # url (TS_CHECK_URL, optional): a tailnet service for the dashboard's delay test - name: TAILSCALE type: select proxies: [tailscale] url: "http://100.69.216.50:8080" interval: 0 # UPLINK: what the subscription nodes, BOOT seeds and own servers connect # through. DIRECT - as before; CSQTT - through csqtt0 first (out of the # whitelist); a pool (POOL__UPLINK=1) - through its servers, they themselves # direct; then FOREIGN / MY / RU work on top of it as usual. # On whitelist own servers go MY-EXIT -> node -> UPLINK. - name: UPLINK type: select proxies: [DIRECT, "WL ⟶ DIRECT"] - name: MAIN type: select proxies: [FOREIGN, MY, RU, DIRECT] - name: TORRENT-SEL type: select proxies: [TORRENT, FOREIGN, DIRECT] - name: PUSH type: select proxies: [MY, FOREIGN, DIRECT] rules: # Tailscale: tailnet IPs and MagicDNS names (resolved by tailscale itself) - IP-CIDR,100.64.0.0/10,TAILSCALE,no-resolve - DOMAIN-SUFFIX,ts.net,TAILSCALE - IP-CIDR,192.168.0.0/16,DIRECT,no-resolve - IP-CIDR,10.0.0.0/8,DIRECT,no-resolve - IP-CIDR,172.16.0.0/12,DIRECT,no-resolve # push notifications (Apple APNs, Google FCM): long-lived connections on a # stable path - group PUSH (main/foreign: DIRECT, whitelist: MY) - DOMAIN-SUFFIX,push.apple.com,PUSH - IP-CIDR,17.249.0.0/16,PUSH,no-resolve - IP-CIDR,17.252.0.0/16,PUSH,no-resolve - IP-CIDR,17.57.144.0/22,PUSH,no-resolve - IP-CIDR,17.188.128.0/18,PUSH,no-resolve - IP-CIDR,17.188.20.0/23,PUSH,no-resolve - DOMAIN-REGEX,^(alt[0-9]+-)?mtalk[0-9]*\.google\.com$,PUSH - DST-PORT,5228-5230,PUSH # service claude: above the own lists, below the tunnels, LAN and push - RULE-SET,geosite-anthropic,CLAUDE - DOMAIN-SUFFIX,claude.example,CLAUDE # service chat: above the own lists, below the tunnels, LAN and push - RULE-SET,geosite-openai,CHAT - RULE-SET,geosite-anthropic,CHAT - IP-CIDR,1.2.3.4/32,CHAT # service yt: above the own lists, below the tunnels, LAN and push - RULE-SET,hostlist-yt,YT # own lists from the settings: above torrents, ru-inside, .ru and MATCH; below the # tunnels, LAN and push. Domains (DOMAIN-SUFFIX: the domain and all subdomains) # before IPs; first match wins: MY, then FOREIGN, then RU. # RU on main (home, own white IP): reachable directly; whitelist/abroad: through RU - IP-CIDR,194.190.191.112/32,RU - SRC-PORT,20000-20199,TORRENT-SEL - RULE-SET,ru-inside,DIRECT # 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