Commit Graph
9 Commits
Author SHA1 Message Date
Ivan RazinandClaude Sonnet 4.6 b846756a6d Fix clash.yaml: replace include-all with use for cross-client compatibility
include-all is Mihomo-only; explicit use: [sub] works in all Clash clients.
Also remove empty proxies blocks and non-standard remnawave field.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 19:54:27 +03:00
Ivan RazinandClaude Sonnet 4.6 35aa8e0084 Remove Smart proxy group and lgbm settings from clash.yaml template
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 19:20:32 +03:00
Ivan RazinandClaude Sonnet 4.6 aa6c744070 Fix proxy-providers: bypass clash.yaml for Mihomo provider refresh requests
When Mihomo fetches proxy-providers it sends a Clash UA, causing nginx to
return clash.yaml instead of the actual proxy list — resulting in empty groups.

Fix: proxy-providers in clash.yaml now send X-Proxy-Provider: true header.
nginx map checks combined key "$is_clash_ua:$http_x_proxy_provider":
- Clash UA with no header ("1:") → serve clash.yaml (initial import)
- Clash UA with header present  → pass through to x-ui sub port (provider refresh)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 14:43:32 +03:00
Ivan RazinandClaude Sonnet 4.6 33fef3b27b Remove empty proxies: block from clash.yaml template
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 14:33:47 +03:00
Ivan RazinandClaude Sonnet 4.6 c1923d5a6e Update clash.yaml template with new config
New rule set: Telegram, WhatsApp, Discord, YouTube groups; oisd_big ad block;
refilter + ru-bundle for Russian sites; torrent direct; Smart/Fastest groups.
Proxy-providers sub URL kept with ${DOMAIN}/${SUB_PATH}/${SUB_ID} placeholders.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 14:32:57 +03:00
Ivan RazinandClaude Sonnet 4.6 9bb6ed5d5c Serve per-client clash.yaml dynamically via mtr-backend
- clash.yaml template: proxy-provider URL uses ${SUB_ID} placeholder
- install_clash_sub() saves to clash.yaml.tpl (DOMAIN/SUB_PATH substituted, SUB_ID left)
- mtr-backend GET /api/clash?sub_id=xxx reads .tpl, fills in subscription ID, returns YAML
- nginx regex ^/sub_path/(?<clash_sub_id>[^/]*)$ proxies Clash UA to
  mtr-backend /api/clash?sub_id=$clash_sub_id; regular clients pass through to x-ui
- Removed static /__clash_sub internal location

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 14:03:30 +03:00
Ivan RazinandClaude Sonnet 4.6 d9a51d7199 Fix clash.yaml: move orphaned expected-status back into health-check block
expected-status: 204 ended up after the rules section instead of
inside proxy-providers.sub.health-check where it belongs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 13:49:43 +03:00
Ivan Razin 7aef10624d Update clash.yaml 2026-06-24 13:44:04 +03:00
Ivan RazinandClaude Sonnet 4.6 138e41574c Add Clash subscription with User-Agent routing
- clash.yaml template (proxy-providers -> x-ui base64 sub URL) in assets/clash/
- install_clash_sub() downloads and substitutes domain/sub_path at install time
- nginx: map $http_user_agent $is_clash_client detects Clash/Mihomo/Stash/Surfboard
- sub_path locations rewrite to internal /__clash_sub on UA match
- /__clash_sub serves /var/www/subpage/clash.yaml as text/yaml
- Regular clients still proxy to x-ui sub port unchanged
- Uninstall cleans /var/www/subpage/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 13:29:16 +03:00