Skip to content

feat(singboxdiscover): enrich primary sb-list path with chain/line data#4

Merged
lr00rl merged 1 commit into
mainfrom
feat/singbox-primary-enrich
Jul 7, 2026
Merged

feat(singboxdiscover): enrich primary sb-list path with chain/line data#4
lr00rl merged 1 commit into
mainfrom
feat/singbox-primary-enrich

Conversation

@lr00rl

@lr00rl lr00rl commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

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 where sb works. Build+test green.

https://claude.ai/code/session_01K3G7UAfcWNQkATYevDvnVM

`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.
@lr00rl lr00rl merged commit ccc5a4f into main Jul 7, 2026
@lr00rl lr00rl deleted the feat/singbox-primary-enrich branch July 7, 2026 09: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