mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6567] [MERGED] fix(sub): send stable X-HWID on external subscription fetch #6355
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6355
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6567
Author: @sdhfsl
Created: 9/16/2026
Status: ✅ Merged
Merged: 9/16/2026
Merged by: @MHSanaei
Base:
main← Head:fix-external-sub-hwid📝 Commits (7)
959e6fdfix(panel): accept 2FA codes from adjacent TOTP windowsf3096bbfix(panel): share TOTP skew tolerance with VerifyTwoFactorCode198ac75Merge branch 'main' into mainb2762e4fix(sub): send stable X-HWID on external subscription fetch227ed81fix(sub): address review on external X-HWID6d24fbfMerge branch 'main' into fix-external-sub-hwid0a8f116fix(sub): drop the SQL-only X-HWID opt-out📊 Changes
2 files changed (+110 additions, -4 deletions)
View changed files
➕
internal/sub/external_hwid_test.go(+67 -0)📝
internal/sub/external_subscription.go(+43 -4)📄 Description
Problem
Fixes #6559.
A Master panel fetching a donor's subscription link sends no
X-HWIDheader (doFetchSubscriptionLinkssets onlyUser-Agent). When the donor client has an HWID limit,EnforceHwidForSubIDrejects the empty HWID (NotSupported,Allowed=false) and the donor answers 404 — Master/Donor aggregation is broken for every HWID-limited client.Fix
doFetchSubscriptionLinksnow sendsX-HWIDfrom newserverHwid(): a stable per-installation id (3x-ui-server-<uuid>), created once and persisted in the settings table, so the donor registers exactly one device slot for the fetching panel (no per-request randomness burning slots; no header at all when the DB is unreachable).Tests
New
TestServerHwidStableAcrossCalls: non-empty, expected prefix, long enough for the donor's minimum length, stable across calls, persisted in settings. Fullinternal/subsuite passes,go vetand gofmt clean.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.