Skip to content

feat: source_mac_address / source_hostname route matchers with LAN picker - #13

Merged
SealinGp merged 2 commits into
mainfrom
feat/route-rule-lan-source-matchers
Sep 27, 2026
Merged

SealinGp merged 2 commits into
mainfrom
feat/route-rule-lan-source-matchers

Conversation

@SealinGp

@SealinGp SealinGp commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Route rule matchers source_mac_address / source_hostname (sing-box 1.14+), added through a compatibility overlay on the pinned 1.12 inventory.
  • Gated on the installed core: core.CapabilitiesForCoreVersion now reports route_source_mac_address / route_source_hostname, served by GET /core. The rule dialog hides both below 1.14. A value a rule already holds stays visible so it can be cleared.
  • LAN client picker: GET /system/lan-clients (platform/lanclients) merges dnsmasq leases, static uci dhcp hosts and /proc/net/arp by 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.
  • Endpoints as route targets: GET /outbounds also returns top-level endpoints. The outbound picker offers them, and rule validation no longer rejects "outbound": "<wireguard endpoint>".
  • List-shaped matchers are converted from a single value to a list on load, for every such field, instead of a hand-kept list of 16.
  • About card links to the GitHub repository.

Test plan

  • go test ./...: new tests for lanclients parsers and merge (fixtures from a real iStoreOS 24.10 router), endpoint listing, and core capabilities
  • bun test (413) + vue-tsc: matcher gating, LAN picker options, MAC normalisation
  • Collector run on a real OpenWrt router: 28 clients, no warnings
  • GET /core against sing-box 1.14.0 reports both capabilities
  • Open a rule dialog on OpenWrt and pick a MAC / hostname from the list
  • Save rule {source_mac_address, outbound: <endpoint>} and confirm sing-box check passes
  • On a 1.13 core, confirm both fields are hidden and the note explains why

leozhang 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.
@SealinGp
SealinGp merged commit 9a75d39 into main Sep 27, 2026
1 of 2 checks passed
@SealinGp
SealinGp deleted the feat/route-rule-lan-source-matchers branch October 7, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant