[PR #6951] feat(dns-tunnel): DNS tunnel page - StormDNS/dnstt profiles, WhiteDNS links, resolver test #6538

Open
opened 2026-11-02 04:09:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6951
Author: @Plus98ir
Created: 10/26/2026
Status: 🔄 Open

Base: main ← Head: feat/dns-tunnel


📝 Commits (10+)

  • 8c002ab feat(hosts): clean IP scanner that saves working Cloudflare IPs per ISP
  • 54e674c feat(hosts): full upload test and fragment finder for the clean IP scanner
  • 8ed6572 feat(hosts): clean IP scanner in five steps; warn when the visitor is on WARP/VPN
  • 6e41f32 fix(hosts): clean IP scanner rejects Cloudflare edge IPs that refuse the domain (error 1034)
  • cde7508 refactor(hosts): move the clean IP page's network lookup and step title into common.tsx
  • 1d651bf feat(hosts): show the datacenter city and country of each clean IP, with a country filter
  • 624fb48 fix(hosts): send empty lists, not null, in a clean IP report with no valid rows
  • f52b377 feat(hosts): scan your own IP list, find more IPs next to working ones, download CSV
  • b5f5eb5 style(hosts): keep the clean IP step titles readable on phones
  • cae5a37 chore(i18n): translate the clean IP scanner into every panel language

📊 Changes

62 files changed (+11690 additions, -34 deletions)

View changed files

➕ docs/content/docs/en/reference/api/clean-ip-scanner.mdx (+64 -0)
➕ docs/content/docs/en/reference/api/dns-tunnel.mdx (+63 -0)
📝 docs/content/docs/en/reference/api/meta.json (+2 -0)
📝 docs/public/openapi.json (+1058 -17)
📝 frontend/public/openapi.json (+1058 -17)
📝 frontend/src/components/command-palette/CommandPalette.tsx (+2 -0)
📝 frontend/src/generated/examples.ts (+143 -0)
📝 frontend/src/generated/schemas.ts (+449 -0)
📝 frontend/src/generated/types.ts (+104 -0)
📝 frontend/src/generated/zod.ts (+118 -0)
📝 frontend/src/pages/api-docs/endpoints.ts (+105 -0)
➕ frontend/src/pages/clean-ip/CleanIpPage.css (+264 -0)
➕ frontend/src/pages/clean-ip/CleanIpPage.tsx (+1074 -0)
➕ frontend/src/pages/clean-ip/FragmentStep.tsx (+216 -0)
➕ frontend/src/pages/clean-ip/RangePicker.tsx (+82 -0)
➕ frontend/src/pages/clean-ip/colos.ts (+165 -0)
➕ frontend/src/pages/clean-ip/common.tsx (+92 -0)
➕ frontend/src/pages/clean-ip/report.ts (+47 -0)
➕ frontend/src/pages/clean-ip/scan.ts (+285 -0)
➕ frontend/src/pages/dns-tunnel/DnsTunnelPage.tsx (+562 -0)

...and 42 more files

📄 Description

Summary

Adds a DNS tunnel page (/dns-tunnel). It keeps the profiles of the DNS tunnel servers that run beside the panel (StormDNS / dnstt), gives users a WhiteDNS import link and QR code for StormDNS, and finds which DNS resolvers carry the tunnel on each ISP.

Depends on the Clean IP scanner PR (#6950). It reuses that page's ISP lookup, numbered steps and one-day command flow (clean-ip/common.tsx, CleanIpService.LookupNetwork). Until that PR is merged, this diff also shows its commits. The DNS tunnel part is the last five commits.

Why

During internet shutdowns the international links are cut, but the ISP's DNS resolvers still answer. A DNS tunnel (StormDNS / dnstt) keeps users connected in that situation. Admins need two things: a way to hand out the client settings, and to know which public or ISP resolvers pass the tunnel on each ISP. Both change per network.

What changes

  • Tunnel servers: a list of profiles (StormDNS or dnstt; domain, key, encryption method), stored in the new dnsTunnelProfiles setting (default []).
    • StormDNS profiles get a stormdns:// WhiteDNS import link and a QR code.
    • "Read from this server" fills a profile from the StormDNS install on this machine. It reads server_config.toml (DOMAIN, DATA_ENCRYPTION_METHOD, ENCRYPTION_KEY_FILE) in the chosen folder (default /opt/stormdns), so the key does not have to be copied by hand.
  • Resolver test: the same one-day command pattern as the clean IP scanner (curl … | python3 -). It runs on a device on the ISP, checks which resolvers answer for the tunnel zone, and reports back per ISP with its token alone.
  • Routes:
    • GET/POST /panel/api/dnstunnel/profiles
    • GET /panel/api/dnstunnel/detect
    • POST /panel/api/dnstunnel/command
    • GET /panel/api/dnstunnel/command/:token
    • public, token-only: GET <base>dnstunnel/run/:token/script.py and POST <base>dnstunnel/run/:token/report
  • All routes are documented in endpoints.ts, openapi.json and the docs MDX. The page is translated into all 14 languages.

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Documentation
  • Tests only
  • Build / CI / tooling
  • Other

Areas affected

  • Frontend (UI / panel pages)
  • Backend (API endpoints, login, settings)
  • Xray config generation
  • Subscription (share links / Clash / JSON)
  • Statistics / traffic counters
  • Database / migrations
  • Install / upgrade script
  • Docker image
  • Multi-node (sub-nodes)
  • Telegram bot

How was this tested?

  • Go tests (internal/web/service/dnstunnel_test.go) cover:
    • profile validation;
    • reading a StormDNS server_config.toml and its key file;
    • script placeholders;
    • report sanitizing, including an empty list instead of null.
  • Frontend tests: dns-tunnel-links.test.ts covers the stormdns:// link format.
  • Checks: make gen is clean, docs MDX regenerated, and go test ./internal/web/..., typecheck, lint, format and build all pass.
  • Production: running on a production panel (v3.11.0) next to a real StormDNS server since 2026-10-25.

Screenshots / recordings

Tunnel server with its WhiteDNS QR code (example domain and key):

DNS tunnel page

Breaking changes

None. It is a new page, new routes and one new setting with an empty default.

Checklist

  • I tested the change locally and confirmed the described behavior.
  • I added or updated tests for the new behavior (when applicable).
  • go build ./... and the test suite pass locally.
  • For frontend changes: npm run lint, npm run typecheck, and npm run build pass.
  • I updated the Wiki / README / API docs if user-facing behavior changed.
  • My commits follow the project's existing message style.
  • I have no unrelated changes mixed into this PR.

🔄 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/6951 **Author:** [@Plus98ir](https://github.com/Plus98ir) **Created:** 10/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/dns-tunnel` --- ### 📝 Commits (10+) - [`8c002ab`](https://github.com/MHSanaei/3x-ui/commit/8c002ab993a558fdf29571eb22ec936159fc6725) feat(hosts): clean IP scanner that saves working Cloudflare IPs per ISP - [`54e674c`](https://github.com/MHSanaei/3x-ui/commit/54e674cb5bdf36b2b2cee3f8c9fa0422203e845d) feat(hosts): full upload test and fragment finder for the clean IP scanner - [`8ed6572`](https://github.com/MHSanaei/3x-ui/commit/8ed65725614fdf8f087d49a12866ebb446e4eb23) feat(hosts): clean IP scanner in five steps; warn when the visitor is on WARP/VPN - [`6e41f32`](https://github.com/MHSanaei/3x-ui/commit/6e41f328e2a185a7b91bc5cabf0b24ef4fad925b) fix(hosts): clean IP scanner rejects Cloudflare edge IPs that refuse the domain (error 1034) - [`cde7508`](https://github.com/MHSanaei/3x-ui/commit/cde7508e2c85df9f8f3fe3df107fa0b874f756a3) refactor(hosts): move the clean IP page's network lookup and step title into common.tsx - [`1d651bf`](https://github.com/MHSanaei/3x-ui/commit/1d651bf633e4e092ffe808160ae4af575e66d034) feat(hosts): show the datacenter city and country of each clean IP, with a country filter - [`624fb48`](https://github.com/MHSanaei/3x-ui/commit/624fb48326d9d5cdc77f5e6fd5581dd1bd4d9e1f) fix(hosts): send empty lists, not null, in a clean IP report with no valid rows - [`f52b377`](https://github.com/MHSanaei/3x-ui/commit/f52b377ba76e544881dc2a6a3a8c68bdb503438e) feat(hosts): scan your own IP list, find more IPs next to working ones, download CSV - [`b5f5eb5`](https://github.com/MHSanaei/3x-ui/commit/b5f5eb5f4b2f6e7d9a29437011de818a734501e0) style(hosts): keep the clean IP step titles readable on phones - [`cae5a37`](https://github.com/MHSanaei/3x-ui/commit/cae5a37b74b96b8736a8d1e525e1f616a15a6765) chore(i18n): translate the clean IP scanner into every panel language ### 📊 Changes **62 files changed** (+11690 additions, -34 deletions) <details> <summary>View changed files</summary> ➕ `docs/content/docs/en/reference/api/clean-ip-scanner.mdx` (+64 -0) ➕ `docs/content/docs/en/reference/api/dns-tunnel.mdx` (+63 -0) 📝 `docs/content/docs/en/reference/api/meta.json` (+2 -0) 📝 `docs/public/openapi.json` (+1058 -17) 📝 `frontend/public/openapi.json` (+1058 -17) 📝 `frontend/src/components/command-palette/CommandPalette.tsx` (+2 -0) 📝 `frontend/src/generated/examples.ts` (+143 -0) 📝 `frontend/src/generated/schemas.ts` (+449 -0) 📝 `frontend/src/generated/types.ts` (+104 -0) 📝 `frontend/src/generated/zod.ts` (+118 -0) 📝 `frontend/src/pages/api-docs/endpoints.ts` (+105 -0) ➕ `frontend/src/pages/clean-ip/CleanIpPage.css` (+264 -0) ➕ `frontend/src/pages/clean-ip/CleanIpPage.tsx` (+1074 -0) ➕ `frontend/src/pages/clean-ip/FragmentStep.tsx` (+216 -0) ➕ `frontend/src/pages/clean-ip/RangePicker.tsx` (+82 -0) ➕ `frontend/src/pages/clean-ip/colos.ts` (+165 -0) ➕ `frontend/src/pages/clean-ip/common.tsx` (+92 -0) ➕ `frontend/src/pages/clean-ip/report.ts` (+47 -0) ➕ `frontend/src/pages/clean-ip/scan.ts` (+285 -0) ➕ `frontend/src/pages/dns-tunnel/DnsTunnelPage.tsx` (+562 -0) _...and 42 more files_ </details> ### 📄 Description ## Summary Adds a **DNS tunnel** page (`/dns-tunnel`). It keeps the profiles of the DNS tunnel servers that run beside the panel (StormDNS / dnstt), gives users a WhiteDNS import link and QR code for StormDNS, and finds which DNS resolvers carry the tunnel on each ISP. > **Depends on the Clean IP scanner PR (#6950).** It reuses that page's ISP lookup, numbered steps and one-day command flow (`clean-ip/common.tsx`, `CleanIpService.LookupNetwork`). Until that PR is merged, this diff also shows its commits. The DNS tunnel part is the last five commits. ## Why During internet shutdowns the international links are cut, but the ISP's DNS resolvers still answer. A DNS tunnel (StormDNS / dnstt) keeps users connected in that situation. Admins need two things: a way to hand out the client settings, and to know which public or ISP resolvers pass the tunnel on each ISP. Both change per network. ## What changes - **Tunnel servers**: a list of profiles (StormDNS or dnstt; domain, key, encryption method), stored in the new `dnsTunnelProfiles` setting (default `[]`). - StormDNS profiles get a `stormdns://` WhiteDNS import link and a QR code. - "Read from this server" fills a profile from the StormDNS install on this machine. It reads `server_config.toml` (`DOMAIN`, `DATA_ENCRYPTION_METHOD`, `ENCRYPTION_KEY_FILE`) in the chosen folder (default `/opt/stormdns`), so the key does not have to be copied by hand. - **Resolver test**: the same one-day command pattern as the clean IP scanner (`curl … | python3 -`). It runs on a device on the ISP, checks which resolvers answer for the tunnel zone, and reports back per ISP with its token alone. - Routes: - `GET/POST /panel/api/dnstunnel/profiles` - `GET /panel/api/dnstunnel/detect` - `POST /panel/api/dnstunnel/command` - `GET /panel/api/dnstunnel/command/:token` - public, token-only: `GET <base>dnstunnel/run/:token/script.py` and `POST <base>dnstunnel/run/:token/report` - All routes are documented in `endpoints.ts`, `openapi.json` and the docs MDX. The page is translated into all 14 languages. ## Type of change - [ ] Bug fix - [x] New feature - [ ] Refactoring (no behavior change) - [x] Documentation - [ ] Tests only - [ ] Build / CI / tooling - [ ] Other ## Areas affected - [x] Frontend (UI / panel pages) - [x] Backend (API endpoints, login, settings) - [ ] Xray config generation - [ ] Subscription (share links / Clash / JSON) - [ ] Statistics / traffic counters - [ ] Database / migrations - [ ] Install / upgrade script - [ ] Docker image - [ ] Multi-node (sub-nodes) - [ ] Telegram bot ## How was this tested? - **Go tests** (`internal/web/service/dnstunnel_test.go`) cover: - profile validation; - reading a StormDNS `server_config.toml` and its key file; - script placeholders; - report sanitizing, including an empty list instead of `null`. - **Frontend tests**: `dns-tunnel-links.test.ts` covers the `stormdns://` link format. - **Checks**: `make gen` is clean, docs MDX regenerated, and `go test ./internal/web/...`, typecheck, lint, format and build all pass. - **Production**: running on a production panel (v3.11.0) next to a real StormDNS server since 2026-10-25. ## Screenshots / recordings Tunnel server with its WhiteDNS QR code (example domain and key): ![DNS tunnel page](https://raw.githubusercontent.com/Plus98ir/3x-ui/9b3442f5556fd9bac2925164c20072428277d57c/dns-tunnel.png) ## Breaking changes None. It is a new page, new routes and one new setting with an empty default. ## Checklist - [x] I tested the change locally and confirmed the described behavior. - [x] I added or updated tests for the new behavior (when applicable). - [x] `go build ./...` and the test suite pass locally. - [x] For frontend changes: `npm run lint`, `npm run typecheck`, and `npm run build` pass. - [x] I updated the Wiki / README / API docs if user-facing behavior changed. - [x] My commits follow the project's existing message style. - [x] I have no unrelated changes mixed into this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#6538
No description provided.