[PR #5935] [MERGED] feat(sub): allow identity tokens on every subscription link #6032

Closed
opened 2026-11-02 04:05:53 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5935
Author: @H-TTTTT
Created: 7/13/2026
Status: ✅ Merged
Merged: 7/28/2026
Merged by: @MHSanaei

Base: main ← Head: feat/5659-sub-identity-all-links


📝 Commits (1)

  • 5806b74 feat(sub): allow identity tokens on every subscription link

📊 Changes

29 files changed (+190 additions, -9 deletions)

View changed files

📝 docs/public/openapi.json (+8 -0)
📝 frontend/public/openapi.json (+8 -0)
📝 frontend/src/generated/examples.ts (+2 -0)
📝 frontend/src/generated/schemas.ts (+8 -0)
📝 frontend/src/generated/types.ts (+2 -0)
📝 frontend/src/generated/zod.ts (+2 -0)
📝 frontend/src/models/setting.ts (+1 -0)
📝 frontend/src/pages/settings/SubscriptionGeneralTab.tsx (+10 -0)
📝 frontend/src/schemas/setting.ts (+1 -0)
➕ frontend/src/test/setting-sub-identity.test.ts (+22 -0)
📝 internal/sub/remark_vars.go (+5 -1)
📝 internal/sub/remark_vars_test.go (+37 -0)
📝 internal/sub/service.go (+8 -3)
📝 internal/web/entity/entity.go (+6 -5)
📝 internal/web/service/setting.go (+5 -0)
➕ internal/web/service/setting_sub_identity_test.go (+39 -0)
📝 internal/web/translation/ar-EG.json (+2 -0)
📝 internal/web/translation/en-US.json (+2 -0)
📝 internal/web/translation/es-ES.json (+2 -0)
📝 internal/web/translation/fa-IR.json (+2 -0)

...and 9 more files

📄 Description

Summary

  • Add the subShowIdentityOnAllLinks boolean setting, defaulting to false, with persistence, generated API schemas, localized labels, and a settings switch.
  • Keep {{EMAIL}} and {{USERNAME}} on every raw, JSON, and Clash subscription-body link when enabled.
  • Preserve existing behavior when disabled or missing, and keep all usage/info tokens first-link-only in both modes.

Closes #5659

Rendered fixture

Template: {{INBOUND}}-{{EMAIL}}|{{USERNAME}}|📊{{TRAFFIC_LEFT}}|{{STATUS_EMOJI}}

  • Disabled: first DE-alice@x|alice@x|📊80.00GB|✅, second DE
  • Enabled: first DE-alice@x|alice@x|📊80.00GB|✅, second DE-alice@x|alice@x

Verification

  • go test ./internal/sub ./internal/web/service -run TestIdentityOnAllLinks -count=1 -v
  • go test ./internal/sub ./internal/web/service -count=1
  • golangci-lint run
  • go build ./...
  • npm test -- src/test/setting-sub-identity.test.ts
  • npm test -- --maxWorkers=1 (765 passed)
  • npm run typecheck
  • npm run lint
  • npm run build
  • npm run gen followed by a clean generated-file diff check

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/5935 **Author:** [@H-TTTTT](https://github.com/H-TTTTT) **Created:** 7/13/2026 **Status:** ✅ Merged **Merged:** 7/28/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `feat/5659-sub-identity-all-links` --- ### 📝 Commits (1) - [`5806b74`](https://github.com/MHSanaei/3x-ui/commit/5806b749b725c97f2d53ae9547d6476a85d434d9) feat(sub): allow identity tokens on every subscription link ### 📊 Changes **29 files changed** (+190 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `docs/public/openapi.json` (+8 -0) 📝 `frontend/public/openapi.json` (+8 -0) 📝 `frontend/src/generated/examples.ts` (+2 -0) 📝 `frontend/src/generated/schemas.ts` (+8 -0) 📝 `frontend/src/generated/types.ts` (+2 -0) 📝 `frontend/src/generated/zod.ts` (+2 -0) 📝 `frontend/src/models/setting.ts` (+1 -0) 📝 `frontend/src/pages/settings/SubscriptionGeneralTab.tsx` (+10 -0) 📝 `frontend/src/schemas/setting.ts` (+1 -0) ➕ `frontend/src/test/setting-sub-identity.test.ts` (+22 -0) 📝 `internal/sub/remark_vars.go` (+5 -1) 📝 `internal/sub/remark_vars_test.go` (+37 -0) 📝 `internal/sub/service.go` (+8 -3) 📝 `internal/web/entity/entity.go` (+6 -5) 📝 `internal/web/service/setting.go` (+5 -0) ➕ `internal/web/service/setting_sub_identity_test.go` (+39 -0) 📝 `internal/web/translation/ar-EG.json` (+2 -0) 📝 `internal/web/translation/en-US.json` (+2 -0) 📝 `internal/web/translation/es-ES.json` (+2 -0) 📝 `internal/web/translation/fa-IR.json` (+2 -0) _...and 9 more files_ </details> ### 📄 Description ## Summary - Add the `subShowIdentityOnAllLinks` boolean setting, defaulting to `false`, with persistence, generated API schemas, localized labels, and a settings switch. - Keep `{{EMAIL}}` and `{{USERNAME}}` on every raw, JSON, and Clash subscription-body link when enabled. - Preserve existing behavior when disabled or missing, and keep all usage/info tokens first-link-only in both modes. Closes #5659 ## Rendered fixture Template: `{{INBOUND}}-{{EMAIL}}|{{USERNAME}}|📊{{TRAFFIC_LEFT}}|{{STATUS_EMOJI}}` - Disabled: first `DE-alice@x|alice@x|📊80.00GB|✅`, second `DE` - Enabled: first `DE-alice@x|alice@x|📊80.00GB|✅`, second `DE-alice@x|alice@x` ## Verification - `go test ./internal/sub ./internal/web/service -run TestIdentityOnAllLinks -count=1 -v` - `go test ./internal/sub ./internal/web/service -count=1` - `golangci-lint run` - `go build ./...` - `npm test -- src/test/setting-sub-identity.test.ts` - `npm test -- --maxWorkers=1` (765 passed) - `npm run typecheck` - `npm run lint` - `npm run build` - `npm run gen` followed by a clean generated-file diff check --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:05:53 +07:00
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#6032
No description provided.