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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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