Skip to content

feat(subscription): add InHive to default sing-box rule#658

Open
twilgate wants to merge 1 commit into
PasarGuard:devfrom
TwilgateLabs:add-inhive-client
Open

feat(subscription): add InHive to default sing-box rule#658
twilgate wants to merge 1 commit into
PasarGuard:devfrom
TwilgateLabs:add-inhive-client

Conversation

@twilgate

@twilgate twilgate commented Jun 26, 2026

Copy link
Copy Markdown

Adds InHive to the default sing-box rule in app/db/migrations/versions/9af04c077ede_init_settings.py:

- {"pattern": r"^(SFA|SFI|SFM|SFT|[Kk]aring|[Hh]iddify[Nn]ext)|.*[Ss]ing[\-b]?ox.*", "target": "sing_box"},
+ {"pattern": r"^(SFA|SFI|SFM|SFT|[Kk]aring|[Hh]iddify[Nn]ext|[Ii]n[Hh]ive)|.*[Ss]ing[\-b]?ox.*", "target": "sing_box"},

InHive is a public sing-box-based client (releases at github.com/TwilgateLabs) supporting hysteria2/TUIC/Reality; UA InHive/<ver> (<platform>; <hwid>). Its UA contains no singbox substring so the catch-all won't catch it — the explicit token is needed to route it to sing_box.

Summary by CodeRabbit

  • Bug Fixes
    • Expanded subscription routing detection so more app variants are matched during settings migration, including InHive alongside existing supported variants.
    • Improved case-insensitive matching for the updated app name pattern, helping routing rules apply more reliably.

InHive (https://inhive.ru) is a public sing-box-based VPN client
(github.com/TwilgateLabs: inhive-android, inhive-windows; iOS soon),
UA "InHive/<ver> (<platform>; <hwid>)", core supports hysteria2/TUIC/Reality.

Its UA has no "singbox" substring, so the catch-all in the sing-box rule
won't match it — add the InHive token to the alternation so it maps to
the sing_box target (structured JSON) instead of base64.

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

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dc890ec6-99c4-4c83-83cd-35bc07f2db63

📥 Commits

Reviewing files that changed from the base of the PR and between 1480cd8 and 4c1fbf2.

📒 Files selected for processing (1)
  • app/db/migrations/versions/9af04c077ede_init_settings.py

Walkthrough

The settings migration updates one subscription routing regex so sing_box also matches InHive. The migration flow and the other routing rules are unchanged.

Changes

Settings migration routing

Layer / File(s) Summary
sing_box pattern update
app/db/migrations/versions/9af04c077ede_init_settings.py
The sing_box rule pattern adds InHive to the existing alternation in the migration’s rules list.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A bunny hopped by, ears held high,
To see sing_box greet InHive nigh.
One tiny regex, neat and spry,
Now matches more names as they glide by.
Hoppity hop, code carries on 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding InHive support to the default sing-box routing rule.
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.
✨ 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.

@ImMohammad20000 ImMohammad20000 changed the base branch from main to dev June 27, 2026 07:30
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