Repository navigation
Preserve panel order in opted-in Mihomo proxy groups - #94
Conversation
Expand automatic local members in the rendered template so Mihomo keeps the panel order. Leave external providers and cross-source filter priority to the core. Refs Mistgate#92.
Keep native Mihomo auto-inclusion unchanged. Use x-mistgate-ordered-proxies in new templates and strip it from the emitted YAML. Refs Mistgate#92.
Keep directive removal within groups and their defaults. Match the core’s option lookup and scalar types, and reject provider-name conflicts. Validate boolean opt-in and source locations; bound regexp polling and surface preview timeouts without exposing filter or node text.
Pin the upstream regexp2 v1.12.0 source with its MIT license. Poll monotonic time on wasm, where background goroutines cannot preempt the interpreter. Test deadline expiry without yielding under the Go js/wasm runner.
The admin Worker validates and previews unsaved templates using the same regexp2 matching as subscription rendering. Moving it to the public Worker would require a cross-Worker RPC for an owner-only operation. The release-style admin build is 49.4 MiB. Raise only its budget from 49 to 50 MiB, below the 64 MiB Cloudflare ceiling.
|
Thanks for this — the ordering work is careful, and the test against a real Mihomo core is great. I checked the group composition against Mihomo's own parser and found no ordering, dedupe, filter, Must change
Should change
Nits (optional)
Size: by my build, admin goes 48.8 → 49.4 MiB and public 29.2 → 29.8 MiB (233 KiB left under its limit). We'll take the admin bump on our side, but please mention the public number in the script comment. Happy to re-review once the fork is gone. Thanks again! |
- Use upstream regexp2 and document the Cloudflare Worker CPU limit. - Fail subscription refresh and draft preview when matching times out; validate a long sample name on save. - Cover the failure paths and keep a native group in the golden fixture.
|
Thanks for the review, @limeflash. I pushed the fixes in
The native render stopped the pathological filter in about 240 ms. Tests with Mihomo v1.19.34 and js/wasm passed, as did the full Go and web checks. The public Worker is 29.8 MiB with 228 KiB of headroom; the admin Worker is under its 50 MiB limit. Ready for another look when you have time. |
|
Thanks, @Morvex885 — everything from the review is addressed: the fork is gone, a timeout now fails the refresh with |
Closes #92.
Что изменилось
mistgate-ordered-proxies: trueвключает порядок панели для группы в шаблоне Mihomo. В готовой группе сначала идут явно заданные участники, затем серверы пользователя в порядке панели и после них — прокси из шаблона. Сам флаг не попадает в YAML превью и подписки.include-all-proxies,include-allиuseне меняется; внешние провайдеры по-прежнему загружает Mihomo. В одной группе нельзя одновременно включить два способа автоматического добавления локальных прокси. Заготовки новых шаблонов используют новый флаг, сохранённые шаблоны не мигрируют.regexp2зафиксирована на v1.12.0. В локальной копии исправлен контроль времени в однопоточном WebAssembly: срок выполнения проверяется и во время сопоставления.Проверки
ProfileOrderи работы с шаблонами через MCP и ассистента..allс новым флагом и без него, выбор первого доступного прокси вfallback, порядок внешних провайдеров, приоритет KZ, исключения, числовые параметры и совместимость с существующими шаблонами.js/wasm.scripts/check-edge-sizes.sh: все шесть сборок проходят. Admin Worker занимает 49,4 MiB при бюджете 50 MiB; лимиты остальных Worker не менялись.