[PR #6472] [CLOSED] feat(sub): make JSON subscription DNS configurable #6294

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6472
Author: @mrchatam
Created: 9/11/2026
Status: ❌ Closed

Base: main ← Head: feat/sub-json-configurable-dns


📝 Commits (2)

  • 6cdcac9 feat(sub): make JSON subscription DNS configurable
  • 0177adf style(frontend): oxfmt SubscriptionFormatsTab DNS tab label

📊 Changes

28 files changed (+373 additions, -20 deletions)

View changed files

📝 docs/public/openapi.json (+16 -0)
📝 frontend/public/openapi.json (+16 -0)
📝 frontend/src/generated/examples.ts (+4 -0)
📝 frontend/src/generated/schemas.ts (+16 -0)
📝 frontend/src/generated/types.ts (+4 -0)
📝 frontend/src/generated/zod.ts (+4 -0)
📝 frontend/src/models/setting.ts (+2 -0)
📝 frontend/src/pages/settings/SubscriptionFormatsTab.tsx (+33 -0)
📝 frontend/src/schemas/setting.ts (+2 -0)
📝 internal/sub/controller.go (+18 -7)
➕ internal/sub/json_dns_test.go (+84 -0)
📝 internal/sub/json_service.go (+72 -0)
📝 internal/sub/sub.go (+12 -0)
📝 internal/web/entity/entity.go (+2 -0)
📝 internal/web/service/setting.go (+10 -0)
📝 internal/web/translation/ar-EG.json (+6 -1)
📝 internal/web/translation/en-US.json (+6 -1)
📝 internal/web/translation/es-ES.json (+6 -1)
📝 internal/web/translation/fa-IR.json (+6 -1)
📝 internal/web/translation/id-ID.json (+6 -1)

...and 8 more files

📄 Description

Summary

  • Adds panel settings subJsonDNSServers (default 8.8.8.8) and subJsonDNSQueryStrategy (default UseIP) so generated JSON subscriptions no longer need a binary sed patch for client DNS.
  • Plumbs settings through entity → SettingService → subscription server → SubJsonService.SetDNSConfig, with a DNS tab under Settings → Sub Formats and i18n coverage.
  • Preserves current behavior when unset; invalid query strategies fall back to UseIP. Baked Happ/INCY routing profiles still own their DNS subtree.

Scope / non-goals

  • Addresses #6342 for the DNS slice only (not the raw subJsonRules textarea).
  • Overlaps #4850 for subJsonDNSServers + subJsonDNSQueryStrategy.
  • Follow-up: subJsonDomainStrategy, and the raw subJsonRules editor requested in #6342.

Test plan

  • go test ./internal/sub/ ./internal/web/service/
  • Panel UI: Settings → Sub Formats → DNS — set 1.1.1.1, UseIPv4, save, restart/reload sub server
  • Fetch /json/<subId> and confirm dns.servers / queryStrategy match
  • Clear fields / leave defaults and confirm 8.8.8.8 + UseIP

🔄 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/6472 **Author:** [@mrchatam](https://github.com/mrchatam) **Created:** 9/11/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/sub-json-configurable-dns` --- ### 📝 Commits (2) - [`6cdcac9`](https://github.com/MHSanaei/3x-ui/commit/6cdcac9dd960a9e0a6bdc41206292f9b70fefdb5) feat(sub): make JSON subscription DNS configurable - [`0177adf`](https://github.com/MHSanaei/3x-ui/commit/0177adf1cd7a000213c56ce3fcb40ed4038a042e) style(frontend): oxfmt SubscriptionFormatsTab DNS tab label ### 📊 Changes **28 files changed** (+373 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `docs/public/openapi.json` (+16 -0) 📝 `frontend/public/openapi.json` (+16 -0) 📝 `frontend/src/generated/examples.ts` (+4 -0) 📝 `frontend/src/generated/schemas.ts` (+16 -0) 📝 `frontend/src/generated/types.ts` (+4 -0) 📝 `frontend/src/generated/zod.ts` (+4 -0) 📝 `frontend/src/models/setting.ts` (+2 -0) 📝 `frontend/src/pages/settings/SubscriptionFormatsTab.tsx` (+33 -0) 📝 `frontend/src/schemas/setting.ts` (+2 -0) 📝 `internal/sub/controller.go` (+18 -7) ➕ `internal/sub/json_dns_test.go` (+84 -0) 📝 `internal/sub/json_service.go` (+72 -0) 📝 `internal/sub/sub.go` (+12 -0) 📝 `internal/web/entity/entity.go` (+2 -0) 📝 `internal/web/service/setting.go` (+10 -0) 📝 `internal/web/translation/ar-EG.json` (+6 -1) 📝 `internal/web/translation/en-US.json` (+6 -1) 📝 `internal/web/translation/es-ES.json` (+6 -1) 📝 `internal/web/translation/fa-IR.json` (+6 -1) 📝 `internal/web/translation/id-ID.json` (+6 -1) _...and 8 more files_ </details> ### 📄 Description ## Summary - Adds panel settings `subJsonDNSServers` (default `8.8.8.8`) and `subJsonDNSQueryStrategy` (default `UseIP`) so generated JSON subscriptions no longer need a binary sed patch for client DNS. - Plumbs settings through entity → SettingService → subscription server → `SubJsonService.SetDNSConfig`, with a DNS tab under Settings → Sub Formats and i18n coverage. - Preserves current behavior when unset; invalid query strategies fall back to `UseIP`. Baked Happ/INCY routing profiles still own their DNS subtree. ## Scope / non-goals - **Addresses #6342** for the DNS slice only (not the raw `subJsonRules` textarea). - **Overlaps #4850** for `subJsonDNSServers` + `subJsonDNSQueryStrategy`. - Follow-up: `subJsonDomainStrategy`, and the raw `subJsonRules` editor requested in #6342. ## Test plan - [x] `go test ./internal/sub/ ./internal/web/service/` - [ ] Panel UI: Settings → Sub Formats → DNS — set `1.1.1.1`, `UseIPv4`, save, restart/reload sub server - [ ] Fetch `/json/<subId>` and confirm `dns.servers` / `queryStrategy` match - [ ] Clear fields / leave defaults and confirm `8.8.8.8` + `UseIP` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:07:44 +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#6294
No description provided.