From a3a6449d4edeef56e7771cda8bd27470bc9bb9a8 Mon Sep 17 00:00:00 2001 From: Sam Latsin Date: Wed, 21 Oct 2026 13:16:39 +0300 Subject: [PATCH] Fixed mobile config for my servers --- README.md | 3 ++- templates/providers/15-sub.each.yaml | 20 +++++++++++++++----- web/index.html | 2 +- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0402cbc..7016c76 100644 --- a/README.md +++ b/README.md @@ -217,7 +217,8 @@ BOOT — whitelisted seed-ноды для скачивания подписок: обновлении провайдера (раз в час или кнопкой в дашборде). Устроено так: основной провайдер `<имя>` такие ноды отбрасывает, а рядом file-провайдер `<имя>-my` читает тот же скачанный файл `providers/<имя>.yaml` (mihomo следит за ним, второго скачивания нет) и берёт -только их — свой провайдер нужен, чтобы на `whitelist` и телефоне ходить к ним через +только их (на телефоне FlClash переносит файлы провайдеров к себе, поэтому там `<имя>-my` +качает ту же ссылку ещё раз) — свой провайдер нужен, чтобы на `whitelist` и телефоне ходить к ним через `MY-EXIT`. Группа `MY` теперь есть всегда; без hysteria2 и без `[MY]`-нод она пустая, и `PUSH` на `whitelist` тогда по умолчанию `FOREIGN`. diff --git a/templates/providers/15-sub.each.yaml b/templates/providers/15-sub.each.yaml index 38b31ae..8342207 100644 --- a/templates/providers/15-sub.each.yaml +++ b/templates/providers/15-sub.each.yaml @@ -1,15 +1,25 @@ # own servers kept in the subscription, named "[MY] ...", for group MY (the main - # provider leaves them out). Not a second download: reads the file the main - # provider saves (mihomo watches it); a provider of its own because on whitelist - # they go through MY-EXIT. ./providers exists before the start (ovpn_routes_write). + # 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. ${SUB_NAME}-my: - type: file - path: ./providers/${SUB_NAME}.yaml + type: file #@router + path: ./providers/${SUB_NAME}.yaml #@router + type: http #@mobile + url: "${SUB_URL}" #@mobile + path: ./providers/${SUB_NAME}-my.yaml #@mobile + interval: 3600 #@mobile + proxy: ${@SUB_PROXY} #@mobile filter: "(?i)\\[MY\\]" override: #@my_exit dialer-proxy: MY-EXIT #@my_exit override: #@csqtt,!my_exit dialer-proxy: UPLINK #@csqtt,!my_exit + header: #@mobile + User-Agent: ["${SUB_UA}"] #@mobile + ${@@SUB_HEADERS} #@mobile health-check: enable: true url: "https://www.gstatic.com/generate_204" diff --git a/web/index.html b/web/index.html index ef29ecc..66e74dd 100644 --- a/web/index.html +++ b/web/index.html @@ -532,7 +532,7 @@ const TEMPLATES = { "groups/92-push.yaml": " - name: PUSH\n type: select\n proxies: [DIRECT, MY, FOREIGN] #@!whitelist\n proxies: [MY, FOREIGN, DIRECT] #@whitelist,hy2\n # no hysteria2: MY may be empty (no [MY] nodes in the subscriptions) #@whitelist,!hy2\n proxies: [FOREIGN, MY, DIRECT] #@whitelist,!hy2\n", "head/10-lite.yaml": "# LITE=1 (weak routers). nikki's mixin overrides keys whose uci options are set\n# (mihomo-kit.sh puts log_level / match_process there); these cover the rest\nlog-level: warning\nfind-process-mode: off #@!csqtt\ntcp-concurrent: false\nunified-delay: false\ngeo-auto-update: 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|приложение не|свяжитесь|\\\\[MY\\\\]\"\n override: #@csqtt\n dialer-proxy: UPLINK #@csqtt\n header:\n User-Agent: [\"${SUB_UA}\"]\n ${@@SUB_HEADERS}\n # one check per provider: the groups over it (use:) only add their URLs to it,\n # so the interval and lazy here are what counts for RU/FOREIGN/TORRENT/MY-EXIT.\n # lite: every 10 min and skipped while no traffic used the provider\n health-check:\n enable: true\n url: \"https://www.gstatic.com/generate_204\"\n interval: 300 #@!lite\n interval: 600 #@lite\n timeout: 3000\n lazy: false #@!lite\n lazy: true #@lite\n", - "providers/15-sub.each.yaml": " # own servers kept in the subscription, named \"[MY] ...\", for group MY (the main\n # provider leaves them out). Not a second download: reads the file the main\n # provider saves (mihomo watches it); a provider of its own because on whitelist\n # they go through MY-EXIT. ./providers exists before the start (ovpn_routes_write).\n ${SUB_NAME}-my:\n type: file\n path: ./providers/${SUB_NAME}.yaml\n filter: \"(?i)\\\\[MY\\\\]\"\n override: #@my_exit\n dialer-proxy: MY-EXIT #@my_exit\n override: #@csqtt,!my_exit\n dialer-proxy: UPLINK #@csqtt,!my_exit\n health-check:\n enable: true\n url: \"https://www.gstatic.com/generate_204\"\n interval: 300 #@!lite\n interval: 600 #@lite\n timeout: 3000\n lazy: false #@!lite\n lazy: true #@lite\n", + "providers/15-sub.each.yaml": " # own servers kept in the subscription, named \"[MY] ...\", for group MY (the main\n # provider leaves them out); a provider of its own because on whitelist and the\n # phone they go through MY-EXIT. Router: not a second download, reads the file the\n # main provider saves (mihomo watches it; ./providers exists before the start,\n # ovpn_routes_write). Phone: FlClash moves provider files to paths of its own,\n # so the subscription is fetched once more.\n ${SUB_NAME}-my:\n type: file #@router\n path: ./providers/${SUB_NAME}.yaml #@router\n type: http #@mobile\n url: \"${SUB_URL}\" #@mobile\n path: ./providers/${SUB_NAME}-my.yaml #@mobile\n interval: 3600 #@mobile\n proxy: ${@SUB_PROXY} #@mobile\n filter: \"(?i)\\\\[MY\\\\]\"\n override: #@my_exit\n dialer-proxy: MY-EXIT #@my_exit\n override: #@csqtt,!my_exit\n dialer-proxy: UPLINK #@csqtt,!my_exit\n header: #@mobile\n User-Agent: [\"${SUB_UA}\"] #@mobile\n ${@@SUB_HEADERS} #@mobile\n health-check:\n enable: true\n url: \"https://www.gstatic.com/generate_204\"\n interval: 300 #@!lite\n interval: 600 #@lite\n timeout: 3000\n lazy: false #@!lite\n lazy: true #@lite\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/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",