mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[GH-ISSUE #6445] [Feature]: Remove liinks from subscription page #4364
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#4364
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?
Originally created by @indx0 on GitHub (Sep 10, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6445
Is your feature request related to a problem?
Currently, you can limit your sub by HWID, but links still can be copied, which bypasses the limit.
Describe the solution you'd like
Add a toggle to remove an inbound from subpage or remove all when HWID is enabled automatically.
Alternatives you've considered
No response
Concrete use case
No response
Mockups, screenshots, or examples
No response
Which parts of the panel would this affect?
No response
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Sep 10, 2026):
Your reading of the panel is correct: the HTML subscription page is served before the device-limit check, so the config links (with copy and QR buttons) are shown regardless of how many HWIDs are already registered. That ordering is deliberate today, not an oversight, and there is no built-in toggle for it — but a custom subscription theme removes the link list right now, and there is one scope caveat below about how far that gets you.
(I could not open the attached image; nothing here depends on it — the link list is confirmed in the source.)
Where the behaviour lives
internal/sub/controller.go:401-413— the HTML branch returns before the gate:The page view-model carries the configs —
"links": page.Result,(internal/sub/controller.go:629) — andfrontend/src/pages/sub/SubPage.tsx:518-560renders one copy/QR row per config plus a "copy all configs" button.The ordering is pinned by a test:
TestSubscriptionHwidGateSkipsHtmlInfoPage(internal/sub/hwid_controller_test.go:136) fails if the page ever becomes gated —t.Fatalf("HTML sub page should not be HWID-gated: %#v", rec.Header()). It was reaffirmed in commitf17e4684("fix(sub): apply the device limit to?view=raw"), whose message reads: "Gate the raw branch and leave the other gate where it was, below maybeServeSubPage, so the HTML info page stays ungated as before."One scope point worth knowing
The HWID limit only counts subscription fetches.
EnforceHwidForSubID(internal/web/service/client_hwid.go:79) records oneClientHwidrow perX-HWIDheader persub_id, and nothing in the Xray connection path consults it. So hiding the links raises the bar but does not cap devices: any device that is already registered can still export the same config out of its client app. If you want a limit that bites at connection time, the existing lever is the per-clientlimitIpfield plus the IP-limit job (internal/web/job/check_client_ip_job.go) — under Docker it needsNET_ADMINandNET_RAW.Workaround available today
A custom subscription theme that simply never renders the links:
/etc/3x-ui/sub_templates/no-links/.index.html(orsub.html) in it — a Gohtml/templateusing any of the documented fields (.used,.remained,.expire,.subUrl,.subTitle, …) but never ranging over{{ .links }}.The template is re-parsed whenever its modification time changes (
loadSubTemplate,internal/sub/controller.go:687), so no restart is needed. Full field list:docs/custom-subscription-templates.mdand Config → Subscription.Caveat: it applies to every subscription on the panel, not per-inbound and not only when a HWID limit is set — which is exactly the toggle you are asking for, so the request stands.
For the maintainer
The "page data without links" shape already exists:
maybeServeSubInfobuilds the same map and doesdelete(info, "links")(internal/sub/controller.go:349), so asubHideLinkssetting — or a rule keyed onlimit_hwid > 0— would reuse an existing path insubPageContextrather than need new plumbing.Related, but different asks and not duplicates: #6331 (placeholder configs instead of 404 once the limit is reached) and #6357 (read-only device-slot status on the subscription API).
Verdict: Feature request
This reply was generated automatically; a maintainer may follow up.