# mihomo-kit profile. On the router: # /etc/nikki/profiles.d/common.env shared part (secrets: subscriptions, BOOT) # /etc/nikki/profiles.d/.env per profile, overrides common.env # e.g. main.env = "LOCATION=main", whitelist.env = "LOCATION=whitelist". # Then: mihomo-kit.sh build && mihomo-kit.sh use main # chmod 600: this file holds secrets. # router | mobile (mobile: no torrent/OpenVPN/Tailscale, FlClash-style DNS) TARGET=router # main: normal use (home in Russia or abroad), OpenVPN/Tailscale/own servers go direct; # whitelist: OpenVPN through OVPN-EXIT (RU node), own servers through MY-EXIT, Tailscale through MY; # foreign (abroad): ru-inside and .ru through RU, the rest direct, OpenVPN through OVPN-EXIT LOCATION=main # subscription URLs, space separated. Provider name = id from the domain # (https://sub.kittyvpn.com/x -> kittyvpn; repeats -> kittyvpn2), or "name=url" SUBS="https://sub.example.com/sub/xxxx" # per subscription, ID = its id in upper case (- -> _), all optional: #SUB_EXAMPLE_PROXY=DIRECT # fetch through: BOOT (default with BOOT=1) | DIRECT | FOREIGN | any proxy/group | none #SUB_EXAMPLE_UA="v2rayN/9.99" # User-Agent, default mihomo (with HWID: HWID_UA) #SUB_EXAMPLE_HWID=1 # send the HWID_* headers below (device-limited subscriptions) #SUB_EXAMPLE_HEADERS="x-foo=bar; x-baz=two words" # any extra headers # (old index keys SUB0_*, SUB1_* ... still work) # HWID headers, shared by all subscriptions with SUB__HWID=1 #HWID_UA="v2rayN/9.99" #HWID_OS=OpenWrt # x-device-os #HWID_OS_VER=24.10.3 # x-ver-os #HWID_MODEL="Huasifei WH3000 Pro" # x-device-model #HWID_ID=xxxxxxxxxxxxxxxx # x-hwid: keep the one the provider already knows # BOOT: whitelisted vless reality node used to download the subscriptions BOOT=1 BOOT_SERVER=1.2.3.4 BOOT_PORT=443 BOOT_UUID=00000000-0000-0000-0000-000000000000 BOOT_SNI=eh.vk.ru BOOT_PBK=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx BOOT_SID=xxxxxxxxxxxxxxxx # torrent group for clients using source ports 20000-20199 TORRENT=1 # own lists, space separated, above torrents / ru-inside / .ru / MAIN; first match: # MY, FOREIGN, RU. RU on main (home, own white IP) goes directly. IPs: CIDR (bare IP = /32); # domains: with subdomains ("example.com" = "*.example.com"); MY_*: group MY (HY2 and "[MY] ..." nodes of the subscriptions) RU_IPS="194.190.191.112/32" #FOREIGN_IPS="1.2.3.0/24" #MY_IPS="10.8.0.0/24" #RU_DOMAINS="example.ru *.example.com" #FOREIGN_DOMAINS="example.org" #MY_DOMAINS="home.example.org" #LOCAL_HOSTS="example.org=192.168.1.10" # own servers in this router's LAN: domain (+ subdomains)=LAN IP # services: a site or app that always takes its own way and has its own group (name in # upper case); rules above the own lists. GEOSITE: lists of MetaCubeX/meta-rules-dat; # VIA: MY (default; the first alive own server - one exit IP), FOREIGN, RU, DIRECT, MAIN #SERVICES="claude" #SVC_CLAUDE_GEOSITE="anthropic" #SVC_CLAUDE_DOMAINS="" #SVC_CLAUDE_IPS="" #SVC_CLAUDE_VIA=MY # or a pool's group: DE #SVC_CLAUDE_SERVER="my-de" # fixed exit in every profile; empty = group above #SVC_CLAUDE_PROVIDER="" # empty = own server; or provider ID, e.g. sam_hub-my #SVC_CLAUDE_CHAIN=WL # entry for VIA = MY / a pool: DIRECT FOREIGN RU MY MY-EXIT or a pool # pools: own servers and subscription nodes picked by hand, a group each (the name in upper # case) for the services' VIA. TYPE: fallback (default) | url-test | select; SERVERS: own # servers by name, ";" between; SUBS: "" (nodes without [MY]) / "-my" (only [MY]); # FILTER / EXCLUDE: mihomo regex over the subscription nodes' names #POOLS="de" #POOL_DE_TYPE=fallback #POOL_DE_SERVERS="de-1; nl-2" #POOL_DE_SUBS="sam_hub sam_hub-my" #POOL_DE_FILTER='(?i)🇩🇪|\bde\b' #POOL_DE_EXCLUDE='(?i)torrent' #POOL_DE_UPLINK=1 # offer in UPLINK: everything through the pool first # [MY] nodes of the subscriptions with an entry of their own (LuCI: «Свои серверы» → # «Из подписок ([MY])»): "|-my|", ENTRY FOREIGN, RU, DIRECT or a pool #MY_NODE_1='FOREIGN|sam_hub-my|[MY] 🇩🇪 de-1' # OpenVPN by /etc/nikki/openvpn.ovpn, login in /etc/nikki/openvpn.env (ovpn.sh) OPENVPN=0 #OVPN_ROUTES="10.0.0.0/8 192.168.50.0/24" # what goes through the VPN (LuCI: the .ovpn's route lines) #OVPN_SERVER_HOST=vpn.example.com # default: the remote lines of the .ovpn #OVPN_SERVER_IPS="203.0.113.10" #OVPN_CHECK_URL=https://intranet.example.com # a page behind the VPN for the manual check # weak routers (256 MB RAM): health checks every 10 min and only with traffic, sniffer # without QUIC, quiet core; on apply also GOMEMLIMIT (LITE_GOMEMLIMIT, default 64MiB) # for mihomo, nikki log level warning, no process lookup, interception without TUN # (TCP redirect, UDP tproxy + kmod-nft-tproxy; LITE_TPROXY=0: leave nikki's modes alone) LITE=0 #LITE_GOMEMLIMIT=64MiB #LITE_TPROXY=0 # Tailscale (first login: URL in /var/log/nikki/core.log) TAILSCALE=0 TS_HOSTNAME=fudy-mihomo # split-DNS domains of the tailnet besides *.ts.net, space separated TS_DOMAINS="" # 1 = Tailscale through TS-EXIT (only ss/hysteria2/tuic nodes work for it) TS_EXIT=0