mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5407] [Feature]: Clone inbound to any node (not only local panel) #3785
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3785
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jshir700 on GitHub (Jun 17, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5407
Is your feature request related to a problem?
Currently the "Clone" action on the Inbounds page always creates the cloned inbound on the local panel — there is no way to clone an inbound directly to a remote node without manual copy-paste through the "Add inbound" form. Users with many nodes (e.g. 10+ geographically distributed servers) have to:
This is tedious and error-prone when repeating for many inbounds across many nodes.
Describe the solution you'd like
Frontend: extend the Clone confirmation dialog
Current clone dialog (
InboundsPage.tsx→onClone) is amodal.confirm()with a text confirmation. Replace it with a custom modal that includes:1. Target node selector
A
Selectdropdown listing all online nodes plus "Local panel" (the default). The default selection should be the current node of the inbound being cloned:This mirrors the "Deploy to" field in the Add/Edit inbound form (
InboundFormModal.tsxline 532), reusing the sameselectableNodesdata that's already available.2. Port handling (conflict-aware)
The current clone always assigns a random port (
RandomUtil.randomInteger(10000, 60000)). Change this to:The port conflict check is already implemented server-side (
checkPortConflictinport_conflict.go), so we can either:3. Other fields
remark"{original remark} (clone)"enablefalseclients[])nodeIdnullfor local panelshareAddrStrategyshareAddrBackend: conflict-based port fallback in AddInbound (optional enhancement)
The backend
AddInboundalready callscheckPortConflictand returns a 400 error on conflict. The frontend could catch this and retry with a random port. Alternatively,AddInboundcould accept a new optional query parameter?autoResolvePort=truethat makes it pick a random port on conflict instead of failing.Alternatives you've considered
Manual clone → Edit → Change node — works but requires 3 extra clicks per inbound. For a 12-node deployment with 6 inbounds each, that's 216 extra clicks per full deployment.
Export JSON → manually edit nodeId → re-import — works for advanced users but is not user-friendly and requires knowing the nodeId integer values.
Bulk-import via /panel/api/inbounds/import — only imports to local panel, no nodeId support.
Concrete use case
I manage a multi-node 3x-ui deployment with 17 panels (1 local + 16 remote nodes across US, EU, APAC, ME). Each node carries 6 standard inbounds (tcp, xhttp, grpc, noenc, CF-xhttp, hy2) sharing the same port scheme (41881, 41872, 41878, 41879, 23474, 41882).
When provisioning a new node, I need to clone each of the 6 reference inbounds to it. With the current workflow:
With the proposed feature:
Mockups, screenshots, or examples
Which parts of the panel would this affect?
Frontend (UI / panel pages), Multi-node (sub-nodes)
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Jun 17, 2026):
This request covers the same feature as #5337 ("Cross-Node Inbound Cloning"), which is already open and accepted on the backlog. Please follow and add any additional context there; the discussion will continue in that thread.
For completeness, the investigation below confirms the current behaviour and validates that the feature is technically feasible as described.
What the code currently does
The clone handler in
frontend/src/pages/inbounds/InboundsPage.tsx(lines 433-475) builds the clone payload without anodeIdfield, so the inbound always lands on the local panel. The port is always randomised viaRandomUtil.randomInteger(10000, 60000)(line 463), ignoring the source port. The Add/Edit form (InboundFormModal.tsx, lines 531-544) already has a working "Deploy to" node selector backed byselectableNodes, but it is only reachable from the full add-inbound flow, not the clone shortcut.Why the proposed approach is sound
AddInbound(backend,internal/web/service/inbound.go) acceptsnodeIdin the payload and already callscheckPortConflict(internal/web/service/port_conflict.go, line 573) before saving, scoped to the target node, so the same port on a different node is not a conflict.internal/web/controller/inbound.go, lines 377-383) already validates and preservesnodeIdwhen the referenced node exists, confirming the data model supports this end-to-end.isNodeEligiblecheck inInboundFormModal.tsx(lines 189-194); any clone-to-node implementation should apply the same guard.This reply was generated automatically; a maintainer may follow up.