Skip to content

feat(subscription): recognize InHive → xray (full config), not sing_box (#658 follow-up) - #689

Merged
ImMohammad20000 merged 2 commits into
PasarGuard:devfrom
TwilgateLabs:revert-inhive-singbox-rule
Jul 14, 2026
Merged

feat(subscription): recognize InHive → xray (full config), not sing_box (#658 follow-up)#689
ImMohammad20000 merged 2 commits into
PasarGuard:devfrom
TwilgateLabs:revert-inhive-singbox-rule

Conversation

@twilgate

@twilgate twilgate commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Follow-up to my earlier merged PR #658, which added [Ii]n[Hh]ive to the default sing_box rule. That was the wrong target — the sing_box generator (app/subscription/singbox.py) drops kcp/xhttp/splithttp:

if inbound.network in ("kcp", "splithttp", "xhttp"):
    return

InHive is a universal client (a sing-box fork with Xray-parity) that ingests raw share-links and Xray-JSON natively. This PR:

  1. Removes InHive from the sing_box rule.
  2. Adds an explicit ^[Ii]n[Hh]ivexray rule, so InHive is recognized by name and served the full Xray config (app/subscription/xray.py carries xhttp/splithttp, kcp, quic, reality, Hysteria2, WireGuard — no transport stripping).

This mirrors how Happ is handled elsewhere (recognized explicitly, served a full config) rather than relying on the catch-all.

Notes

Summary by CodeRabbit

  • Bug Fixes
    • Improved request routing for InHive and universal client connections.
    • InHive traffic is now directed to the Xray target, while Sing-box traffic continues to use its existing routing behavior.

…asarGuard#658 follow-up)

Follow-up to PasarGuard#658. The sing_box generator (app/subscription/singbox.py) drops
kcp/xhttp/splithttp. InHive is a universal client that ingests raw share-links
natively, so removing it from the sing_box rule lets its UA fall through to the
links_base64 catch-all — the full, unstripped format.

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The migration removes InHive matching from the sing_box rule and adds a dedicated xray rule for InHive inputs, while preserving the existing sing-box pattern matching.

Changes

Sing-box and InHive routing

Layer / File(s) Summary
Separate InHive routing
app/db/migrations/versions/9af04c077ede_init_settings.py
The sing_box rule retains its existing sing-box matching, while a new xray rule matches [Ii]n[Hh]ive inputs and routes them to xray.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Poem

I’m a small rabbit checking the rule,
InHive hops to xray—routing is cool.
Sing-box names still race through the gate,
One neat split makes the paths feel straight.
Hop hop hooray, the change is bright!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: routing InHive subscriptions to xray instead of sing_box.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Follow-up to PasarGuard#658. Instead of silently falling through to the links_base64
catch-all, add an explicit InHive rule targeting the xray generator, which
carries the full transport set (xhttp/kcp/reality/hysteria2) — same intent as
Happ getting structured configs. The sing_box generator drops kcp/xhttp/splithttp.

Co-Authored-By: Claude <noreply@anthropic.com>
@twilgate twilgate changed the title fix(subscription): route InHive to links_base64 instead of sing_box (#658 follow-up) feat(subscription): recognize InHive → xray (full config), not sing_box (#658 follow-up) Jul 9, 2026
@ImMohammad20000
ImMohammad20000 changed the base branch from main to dev July 14, 2026 11:27
@ImMohammad20000
ImMohammad20000 merged commit a81ea0d into PasarGuard:dev Jul 14, 2026
9 checks passed
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.

2 participants