mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5448] [Bug]: Sub Configs only show {{INBOUND}} name #3810
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#3810
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 @ArrayKamko on GitHub (Jun 20, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5448
Describe the bug
Thank you for quickly fixing the previous issue: https://github.com/MHSanaei/3x-ui/issues/5443
Changes to the Remark Template are not applied when the subscription link is opened in the browser. , it shows the template tag {{INBOUND}} only .
However, even though I have enabled the following Remark Template:
{{INBOUND}}|{{HOST}}|{{EMAIL}}|📊{{TRAFFIC_LEFT}}|⏳{{DAYS_LEFT}}Dand it is correctly applied in the clients, when I open the subscription link in the browser, the configs do not include these variables. It only shows the
{{INBOUND}}as the config name.Just to emphasize again: When the subscription is imported in clients, everything displays correctly. The problem only exists in the web version of the subscription (when the link is opened in the browser).
How to reproduce the problem
Expected behavior
It should show the same Remark Template in web
Actual behavior
It's only show Remark Template when you import sub link to clients ( v2rayNg .... )
Relevant logs
Screenshots
No response
3x-ui version
3.3.1
Xray-core version
26.6.1
How did you install 3x-ui?
Manual build from source
Operating system
Ubuntu 24
Which parts of the panel are affected?
Subscription (share links / Clash / JSON)
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
Yes — Cloudflare Tunnel
Before submitting
@github-actions[bot] commented on GitHub (Jun 20, 2026):
This behavior is by design in the current code, not a regression. Here is what the code actually does and why.
What happens
When the subscription URL is fetched by a VPN client (no
text/htmlin theAcceptheader),internal/sub/controller.gosetssubscriptionBody = true. The full remark template — including{{HOST}},{{EMAIL}},{{TRAFFIC_LEFT}}, etc. — is then expanded bygenRemark/genHostRemarkininternal/sub/service.go(line 1591) andinternal/sub/remark_vars.go(line 323).When the same URL is opened in a browser (
Accept: text/html, or explicit?html=1/?view=html),controller.gosetssubscriptionBody = false(lines 144–145). BothgenRemark(service.go:1592–1597) andgenHostRemark(remark_vars.go:323–326) then skip the template entirely and return justinbound.Remark— the raw inbound name. The code comments state the rationale explicitly:and (service.go:1594–1596):
Why "only {{INBOUND}}"
In the browser view the remark embedded in each share link is
inbound.Remark(the name you gave the inbound, e.g. "MyServer"). That is exactly what{{INBOUND}}would expand to. The template is not applied at all, so{{HOST}},{{EMAIL}},{{TRAFFIC_LEFT}}, and{{DAYS_LEFT}}are all absent — hence the impression that "only{{INBOUND}}is used."Design rationale
The HTML subscription page already displays aggregate traffic, expiry, and upload/download totals in its summary section. Repeating that per-client data in each config-link fragment would be redundant, and would also leak email addresses and traffic figures into visible URL fragments if a user shares a screenshot.
What this means for your report
The template works as intended for VPN clients. The browser HTML view intentionally shows only the config name. There is a
nameOnlyTemplatehelper ininternal/sub/remark_vars.go(line 270) that strips traffic/expiry tokens while keeping name tokens (like{{INBOUND}}and{{HOST}}), but it is not currently applied to the browser page — only to the 2nd+ link of the same client in the raw subscription body.If you want the name-identifying tokens (
{{INBOUND}},{{HOST}},{{EMAIL}}) to be applied in the browser view as well (while still omitting the traffic/expiry tokens whose values already appear in the page summary), that would require extending the browser-view code path to usenameOnlyTemplateinstead offallbackRemark. That is a behaviour change the maintainers would need to evaluate.This reply was generated automatically; a maintainer may follow up.