feat(singboxdiscover): enrich primary sb-list path with chain/line data#4
Merged
Conversation
`sb --json list` emits only per-inbound fields (name, protocol, port, etc.) — no outbound/routing and no `_lattice.line_id`. Since most nodes have a working `sb`, the primary path runs in production and left the just-shipped jump_edges producer empty. After the primary `sb --json list` succeeds, best-effort enrich each returned node from the on-box config files, matched by inbound tag (node.Name == config inbound tag / filename): - OutboundRef from the route map (inbound tag -> outbound tag) - OutboundServer/Port/Type from the outbound map (terminal/logical outbounds keep empty server/port) - LineID / NodeIdentityUUID from each inbound's `_lattice` block Never overwrites a non-empty value sb already provided; silently skips if the config is unreadable (primary path still returns sb data). Factors the "locate + read + parse config files" logic out of the fallback path into loadSingBoxRuntimeConfigFiles, reused by both paths, and adds singBoxLatticeByInbound for the tag -> identity map.
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.
Completes the jump_edges producer: after
sb --json list(the production discovery path, which emits no outbound/routing/_lattice), backfill each inbound's OutboundRef/OutboundServer/Port/Type + LineID from the on-box config, matched by inbound tag. Without this the server-side jump_edges resolver stays empty on nodes wheresbworks. Build+test green.https://claude.ai/code/session_01K3G7UAfcWNQkATYevDvnVM