Repository navigation
feat: source_mac_address / source_hostname route matchers with LAN picker - #13
Merged
Merged
Conversation
added 2 commits
September 27, 2026 16:45
…cker - Add the sing-box 1.14 route matchers source_mac_address and source_hostname via a compatibility overlay on the pinned 1.12 inventory (routeRuleMatcherInventory.ts). - Gate them on new GET /core capabilities (route_source_mac_address, route_source_hostname) computed by core.CapabilitiesForCoreVersion; a value a rule already holds stays visible so it can be cleared. - GET /system/lan-clients (platform/lanclients): on OpenWrt, merge dnsmasq leases, static uci dhcp hosts and /proc/net/arp by MAC. The rule dialog picks MACs / hostnames from it, with manual entry kept for offline devices and a chips fallback elsewhere. - GET /outbounds also lists top-level endpoints; the outbound picker offers them and rule validation accepts endpoint tags. - Normalise every list-shaped matcher from scalar to array on load, driven by the inventory instead of a hand-kept key list.
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
source_mac_address/source_hostname(sing-box 1.14+), added through a compatibility overlay on the pinned 1.12 inventory.core.CapabilitiesForCoreVersionnow reportsroute_source_mac_address/route_source_hostname, served byGET /core. The rule dialog hides both below 1.14. A value a rule already holds stays visible so it can be cleared.GET /system/lan-clients(platform/lanclients) merges dnsmasq leases, staticuci dhcphosts and/proc/net/arpby MAC on OpenWrt. Both fields pick from it, show online/offline, keep manual entry for devices that are off, and fall back to plain text boxes elsewhere.GET /outboundsalso returns top-levelendpoints. The outbound picker offers them, and rule validation no longer rejects"outbound": "<wireguard endpoint>".Test plan
go test ./...: new tests for lanclients parsers and merge (fixtures from a real iStoreOS 24.10 router), endpoint listing, and core capabilitiesbun test(413) +vue-tsc: matcher gating, LAN picker options, MAC normalisationGET /coreagainst sing-box 1.14.0 reports both capabilities{source_mac_address, outbound: <endpoint>}and confirmsing-box checkpasses