MetaCubeX / mihomo

A simple Python Pydantic model for Honkai: Star Rail parsed data from the Mihomo API.
https://wiki.metacubex.one
MIT License
16.64k stars 2.66k forks source link

[Bug] no-resolve compatibility issue #1532

Closed mashirozx closed 1 month ago

mashirozx commented 1 month ago

Verify steps

Operating System

MacOS, Windows, Android

System Version

general issue

Mihomo Version

https://github.com/MetaCubeX/mihomo/commit/38fd37108b22b0e937cae7743c562a2147c65cca

Configuration File

rules:
  - IP-CIDR,192.168.0.0/16,no-resolve

Description

Users used to configure as:

rules:
  - IP-CIDR,192.168.0.0/16,no-resolve

But with the changes in https://github.com/MetaCubeX/mihomo/commit/38fd37108b22b0e937cae7743c562a2147c65cca, such a config style will no longer work with the build of the alpha branch.

I personally understand that - IP-CIDR,192.168.0.0/16,direct,no-resolve is a better format, but there are still a lot of existing rule sets configured in this style, i.e., the famous ACL4SSR.

I think with such a breaking change, we should throw a more conspicuous error message, instead of error: proxy no-resolve not found, and what's more, it's better to provide compatibility for the old style.

Logs

No response

mashirozx commented 1 month ago

cc @wwqgtxx

xishang0128 commented 1 month ago

The format of IP class routing rules has always been type, content, proxy, additional parameters (optional). Are you sure your example is correct?

mashirozx commented 1 month ago

The format of IP class routing rules has always been type, content, proxy, additional parameters (optional). Are you sure your example is correct?

I don't know the history of this, but the rule set I've used for years is in this format, and it works well for a long time:

https://github.com/ACL4SSR/ACL4SSR/blob/master/Clash/Providers/LocalAreaNetwork.yaml#L14-L25

xishang0128 commented 1 month ago

The rule-provider and rules are not the same thing

mashirozx commented 1 month ago

Well, it seems to be pretty much the same thing, incompatible with the old:

https://github.com/MetaCubeX/mihomo/commit/763a127287697fe471f0e643e3bd3f5abfad85e9#diff-eb7196056bcd4b0f538c50fb88e2d11a4c61befa15277a4321a8c0cc95e858dcR82-R84

xishang0128 commented 1 month ago

The rule-provider and rules are not the same thing.

Do not use the content of the rule-provider for rules.

The format of IP class routing rules has always been type, content, proxy, additional parameters (optional).