Repository navigation
Conversation
Proxy import extracted only `proxies` from a payload, so an airport's split-DNS routing tables were dropped whenever a subscription was reduced to its nodes. The client had no way to merge them into the main configuration, so the DNS routing policy silently disappeared. Surface `dns.nameserver-policy` and `dns.proxy-server-nameserver-policy` in the import report so the caller can carry them into the main config. Both tables are omitted when absent, so a payload without a dns section reports exactly what it did before.
|
Thanks for digging into this. We're closing it because the Client no longer needs these tables from the import report. The case that actually breaks is a subscription whose nodes' domains have to be resolved by the provider's own DNS ( If a subscription still resolves wrongly on the current Client, please open an issue with its |
Summary
Proxy import reduced a subscription to its
proxiesonly. When a payload was extracted node-by-node, the airport'sdns.nameserver-policyanddns.proxy-server-nameserver-policywere discarded along with the rest of thednssection, so the airport's DNS routing policy never reached the running configuration.This adds both tables to the import report so the caller can carry them into the main configuration:
proxyImportReport.DNSNameServerPolicy/DNSProxyServerNameserverPolicy, bothomitemptyextractProxyImportDNSPolicylifts them from a decoded mihomo documentmihomo-json) are decoded for theirdnssection too; the YAML path already holds the decoded documentNo merge semantics change here.
MergeOverrideForIOSalready unions these maps with the user's own patch on the winning side, so the client only had to stop throwing the data away.A payload without a
dnssection reports exactly what it did before, and the report encoding is unchanged for existing consumers (encodeProxyImportReportmarshals the struct as a whole).Testing
New tests in
bind/clash/proxy_import_dns_test.go:TestProxyImportCarriesDNSNameServerPolicy— YAML payload, both tables extractedTestProxyImportCarriesDNSNameServerPolicyFromJSONContainer—mihomo-jsonpayload reaches the same tablesTestProxyImportWithoutDNSLeavesPolicyNil— nodnssection leaves both nilTestProxyImportDNSMergesUnderUserOverride— end-to-end: the airport table reaches the node document, thenmergeOverrideDocumentunions it with a user patch so shared domains resolve to the user's entry while airport-only domains survivego test ./ -count=1reports two failures,TestBindClashInitStaysWithinItsBudgetandTestJSONToYamlRefusesRunawayNesting. Both fail identically on the unmodified base commit (verified viagit stash), so they are pre-existing and unrelated to this change.Related client-side change: ProjectClash/Clash-Client#56