[PR #6609] [MERGED] fix(sub): drop legacy freedom.domainStrategy from JSON sub template #6376

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6609
Author: @mrchatam
Created: 9/19/2026
Status: ✅ Merged
Merged: 9/26/2026
Merged by: @MHSanaei

Base: main ← Head: fix/sub-json-drop-legacy-freedom-domainStrategy


📝 Commits (3)

  • cb3ed39 fix(sub): drop legacy freedom.domainStrategy from JSON sub template
  • 0d1f418 test(sub): lock default.json freedom outbound off legacy domainStrategy
  • ecd9680 style(sub): keep the default.json test comment to two lines

📊 Changes

2 files changed (+40 additions, -2 deletions)

View changed files

📝 internal/sub/default.json (+1 -2)
➕ internal/sub/default_json_test.go (+39 -0)

📄 Description

Summary

  • Remove settings.domainStrategy from the direct freedom outbound in the embedded JSON-subscription template (internal/sub/default.json).
  • Routing's domainStrategy is unchanged (different key).
  • Add TestDefaultJSON_FreedomOutboundHasNoLegacyDomainStrategy so CI covers the embed (path filters skip JSON-only diffs).

Follow-up to #6515, which moved the panel Xray template / Basics tab / outbound editor onto streamSettings.sockopt.domainStrategy and seeded existing DB templates. The JSON-sub embed still carried the legacy freedom settings key.

AsIs is the core default when the key is absent, so omitting it is behavior-preserving and avoids the deprecated placement entirely.

Fixes #6482

Test plan

  • Inspect internal/sub/default.json — freedom outbound has no domainStrategy; routing still has domainStrategy: AsIs
  • go test ./internal/sub/ -count=1 -run 'TestDefaultJSON_FreedomOutboundHasNoLegacyDomainStrategy'
  • go test ./internal/sub/ -count=1 -run 'TestBuild|TestSubJson|TestMutation|TestDefault'
  • Fresh JSON subscription fetch includes a freedom outbound without settings.domainStrategy

🔄 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/6609 **Author:** [@mrchatam](https://github.com/mrchatam) **Created:** 9/19/2026 **Status:** ✅ Merged **Merged:** 9/26/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `fix/sub-json-drop-legacy-freedom-domainStrategy` --- ### 📝 Commits (3) - [`cb3ed39`](https://github.com/MHSanaei/3x-ui/commit/cb3ed3937aa0878964163935a546db440362b528) fix(sub): drop legacy freedom.domainStrategy from JSON sub template - [`0d1f418`](https://github.com/MHSanaei/3x-ui/commit/0d1f4182b81c532ec418142e20e58d42f81bd765) test(sub): lock default.json freedom outbound off legacy domainStrategy - [`ecd9680`](https://github.com/MHSanaei/3x-ui/commit/ecd968091d907a36ead54a1ed3878a41a679fc8c) style(sub): keep the default.json test comment to two lines ### 📊 Changes **2 files changed** (+40 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `internal/sub/default.json` (+1 -2) ➕ `internal/sub/default_json_test.go` (+39 -0) </details> ### 📄 Description ## Summary - Remove `settings.domainStrategy` from the `direct` freedom outbound in the embedded JSON-subscription template (`internal/sub/default.json`). - Routing's `domainStrategy` is unchanged (different key). - Add `TestDefaultJSON_FreedomOutboundHasNoLegacyDomainStrategy` so CI covers the embed (path filters skip JSON-only diffs). Follow-up to #6515, which moved the panel Xray template / Basics tab / outbound editor onto `streamSettings.sockopt.domainStrategy` and seeded existing DB templates. The JSON-sub embed still carried the legacy freedom settings key. `AsIs` is the core default when the key is absent, so omitting it is behavior-preserving and avoids the deprecated placement entirely. Fixes #6482 ## Test plan - [x] Inspect `internal/sub/default.json` — freedom outbound has no `domainStrategy`; routing still has `domainStrategy: AsIs` - [x] `go test ./internal/sub/ -count=1 -run 'TestDefaultJSON_FreedomOutboundHasNoLegacyDomainStrategy'` - [x] `go test ./internal/sub/ -count=1 -run 'TestBuild|TestSubJson|TestMutation|TestDefault'` - [ ] Fresh JSON subscription fetch includes a freedom outbound without `settings.domainStrategy` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:08:20 +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#6376
No description provided.