[GH-ISSUE #5448] [Bug]: Sub Configs only show {{INBOUND}} name #3810

Closed
opened 2026-10-31 20:35:07 +07:00 by bsakaguchi · 1 comment
Owner

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}}D

and 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

  1. open subscription link in browser
  2. go to configs
  3. copy or Qr

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

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
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}}D` and 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 1. open subscription link in browser 2. go to configs 3. copy or Qr ### 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 ```shell ``` ### 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 - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:35:07 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@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/html in the Accept header), internal/sub/controller.go sets subscriptionBody = true. The full remark template — including {{HOST}}, {{EMAIL}}, {{TRAFFIC_LEFT}}, etc. — is then expanded by genRemark / genHostRemark in internal/sub/service.go (line 1591) and internal/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.go sets subscriptionBody = false (lines 144–145). Both genRemark (service.go:1592–1597) and genHostRemark (remark_vars.go:323–326) then skip the template entirely and return just inbound.Remark — the raw inbound name. The code comments state the rationale explicitly:

// The remark template's per-client info is for the content a client app
// imports — the raw subscription body. A browser viewing the HTML info page
// gets clean, name-only remarks (usage is shown in the page summary).

and (service.go:1594–1596):

// Sub info page + panel link/QR displays: just the config name (no template,
// so no per-client email/usage leaks into the shown remark).

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 nameOnlyTemplate helper in internal/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 use nameOnlyTemplate instead of fallbackRemark. That is a behaviour change the maintainers would need to evaluate.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:4757440526 --> @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/html` in the `Accept` header), `internal/sub/controller.go` sets `subscriptionBody = true`. The full remark template — including `{{HOST}}`, `{{EMAIL}}`, `{{TRAFFIC_LEFT}}`, etc. — is then expanded by `genRemark` / `genHostRemark` in `internal/sub/service.go` (line 1591) and `internal/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.go` sets `subscriptionBody = false` (lines 144–145). Both `genRemark` (service.go:1592–1597) and `genHostRemark` (remark_vars.go:323–326) then skip the template entirely and return just `inbound.Remark` — the raw inbound name. The code comments state the rationale explicitly: ```go // The remark template's per-client info is for the content a client app // imports — the raw subscription body. A browser viewing the HTML info page // gets clean, name-only remarks (usage is shown in the page summary). ``` and (service.go:1594–1596): ```go // Sub info page + panel link/QR displays: just the config name (no template, // so no per-client email/usage leaks into the shown remark). ``` **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 `nameOnlyTemplate` helper in `internal/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 use `nameOnlyTemplate` instead of `fallbackRemark`. That is a behaviour change the maintainers would need to evaluate. *This reply was generated automatically; a maintainer may follow up.*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#3810
No description provided.