[PR #5162] [MERGED] feat: add inbound share address strategy #5798

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5162
Author: @yuanzhidao
Created: 6/10/2026
Status: ✅ Merged
Merged: 6/11/2026
Merged by: @MHSanaei

Base: main ← Head: feat/node-inbound-share-address-strategy


📝 Commits (7)

  • e6d58c7 feat: add inbound share address strategy
  • e0c8270 fix: preserve inbound share address settings
  • 3b8fb18 fix: keep share address strategy out of subscriptions
  • f5d7c14 fix: address share address review feedback
  • 516a764 fix: validate custom share address
  • c2faabd Merge branch 'main' into feat/node-inbound-share-address-strategy
  • 9f985c3 fix

📊 Changes

40 files changed (+872 additions, -38 deletions)

View changed files

📝 frontend/public/openapi.json (+15 -0)
📝 frontend/src/generated/examples.ts (+2 -0)
📝 frontend/src/generated/schemas.ts (+13 -0)
📝 frontend/src/generated/types.ts (+2 -0)
📝 frontend/src/generated/zod.ts (+2 -0)
📝 frontend/src/lib/xray/inbound-form-adapter.ts (+16 -1)
📝 frontend/src/lib/xray/inbound-from-db.ts (+4 -0)
📝 frontend/src/lib/xray/inbound-link.ts (+71 -14)
📝 frontend/src/models/dbinbound.ts (+6 -0)
📝 frontend/src/pages/inbounds/InboundsPage.tsx (+2 -0)
📝 frontend/src/pages/inbounds/form/InboundFormModal.tsx (+57 -0)
📝 frontend/src/schemas/api/inbound.ts (+2 -0)
📝 frontend/src/schemas/forms/inbound-form.ts (+4 -0)
📝 frontend/src/test/__snapshots__/inbound-form-modal.test.tsx.snap (+10 -0)
📝 frontend/src/test/__snapshots__/inbound-full.test.ts.snap (+16 -0)
📝 frontend/src/test/inbound-form-adapter.test.ts (+13 -0)
📝 frontend/src/test/inbound-link.test.ts (+52 -0)
📝 internal/database/model/model.go (+10 -8)
📝 internal/sub/service.go (+2 -2)
📝 internal/web/runtime/remote.go (+8 -0)

...and 20 more files

📄 Description

Summary

Adds a per-inbound share address strategy so directly exported share links and QR codes can use the node address, the inbound listen address, or a custom endpoint.

Why

Node-managed inbounds currently export the node panel address first. In multi-node deployments where one sub-node has multiple inbounds bound to different public IPs, directly exported links can point clients at the wrong address.

Refs #5161
Refs #4891

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 build ./...
  • go test ./...
  • cd frontend && npm run test
  • cd frontend && npm run typecheck
  • cd frontend && npm run lint
  • cd frontend && npm run build

Screenshots / recordings

N/A

Breaking changes

None. Existing inbounds default to the node strategy, preserving the previous node-address-first behavior for directly exported share links and QR codes. Subscription links are not affected.

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/5162 **Author:** [@yuanzhidao](https://github.com/yuanzhidao) **Created:** 6/10/2026 **Status:** ✅ Merged **Merged:** 6/11/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `feat/node-inbound-share-address-strategy` --- ### 📝 Commits (7) - [`e6d58c7`](https://github.com/MHSanaei/3x-ui/commit/e6d58c7ddf285b1f877ad9b0e026bad69003d0df) feat: add inbound share address strategy - [`e0c8270`](https://github.com/MHSanaei/3x-ui/commit/e0c8270f638985c6eb5504fbfb9f73a74e0cb02a) fix: preserve inbound share address settings - [`3b8fb18`](https://github.com/MHSanaei/3x-ui/commit/3b8fb18e6e69ab41df4ea90595a5a6852f1e200f) fix: keep share address strategy out of subscriptions - [`f5d7c14`](https://github.com/MHSanaei/3x-ui/commit/f5d7c14477679babee3761e818686066e5ddafe0) fix: address share address review feedback - [`516a764`](https://github.com/MHSanaei/3x-ui/commit/516a76419d73e7d23b0049df8790512791a54aa7) fix: validate custom share address - [`c2faabd`](https://github.com/MHSanaei/3x-ui/commit/c2faabd54b4d12d19afaeeecce089ffba9711529) Merge branch 'main' into feat/node-inbound-share-address-strategy - [`9f985c3`](https://github.com/MHSanaei/3x-ui/commit/9f985c39bc480b09e62c0ac08473ebd9ef038661) fix ### 📊 Changes **40 files changed** (+872 additions, -38 deletions) <details> <summary>View changed files</summary> 📝 `frontend/public/openapi.json` (+15 -0) 📝 `frontend/src/generated/examples.ts` (+2 -0) 📝 `frontend/src/generated/schemas.ts` (+13 -0) 📝 `frontend/src/generated/types.ts` (+2 -0) 📝 `frontend/src/generated/zod.ts` (+2 -0) 📝 `frontend/src/lib/xray/inbound-form-adapter.ts` (+16 -1) 📝 `frontend/src/lib/xray/inbound-from-db.ts` (+4 -0) 📝 `frontend/src/lib/xray/inbound-link.ts` (+71 -14) 📝 `frontend/src/models/dbinbound.ts` (+6 -0) 📝 `frontend/src/pages/inbounds/InboundsPage.tsx` (+2 -0) 📝 `frontend/src/pages/inbounds/form/InboundFormModal.tsx` (+57 -0) 📝 `frontend/src/schemas/api/inbound.ts` (+2 -0) 📝 `frontend/src/schemas/forms/inbound-form.ts` (+4 -0) 📝 `frontend/src/test/__snapshots__/inbound-form-modal.test.tsx.snap` (+10 -0) 📝 `frontend/src/test/__snapshots__/inbound-full.test.ts.snap` (+16 -0) 📝 `frontend/src/test/inbound-form-adapter.test.ts` (+13 -0) 📝 `frontend/src/test/inbound-link.test.ts` (+52 -0) 📝 `internal/database/model/model.go` (+10 -8) 📝 `internal/sub/service.go` (+2 -2) 📝 `internal/web/runtime/remote.go` (+8 -0) _...and 20 more files_ </details> ### 📄 Description ## Summary Adds a per-inbound share address strategy so directly exported share links and QR codes can use the node address, the inbound listen address, or a custom endpoint. ## Why Node-managed inbounds currently export the node panel address first. In multi-node deployments where one sub-node has multiple inbounds bound to different public IPs, directly exported links can point clients at the wrong address. Refs #5161 Refs #4891 ## Type of change - [ ] Bug fix - [x] New feature - [ ] Refactoring (no behavior change) - [ ] Documentation - [x] 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 - [x] Database / migrations - [ ] Install / upgrade script - [ ] Docker image - [x] Multi-node (sub-nodes) - [ ] Telegram bot ## How was this tested? - `go build ./...` - `go test ./...` - `cd frontend && npm run test` - `cd frontend && npm run typecheck` - `cd frontend && npm run lint` - `cd frontend && npm run build` ## Screenshots / recordings N/A ## Breaking changes None. Existing inbounds default to the `node` strategy, preserving the previous node-address-first behavior for directly exported share links and QR codes. Subscription links are not affected. ## 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. - [ ] 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>
bsakaguchi 2026-11-02 04:04:09 +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#5798
No description provided.