mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[GH-ISSUE #6873] [Feature]: One-click clone/copy configuration for Clients and Inbounds with proper credential regeneration #4565
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#4565
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 @xiaobaZeo on GitHub (Oct 19, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6873
Is your feature request related to a problem?
/clients), there is currently no way to duplicate or clone an existing client. When administrators manage many clients sharing the same service tier (e.g. identical traffic quota, expiry duration, renewal frequency, IP/HWID limits, group, and attached inbounds), they must manually re-enter every field from scratch for each client./inbounds), while an inbound "Clone" action exists,buildClonePayloadcurrently only clears the client list (clients = []) and allocates a random port. It copies protocol-level credentials verbatim instead of re-randomizing them:secretKeyis copied, resulting in identical server private keys across inbounds.server.privateKey,server.publicKey, and DPI obfuscation parameters (Jc, Jmin, Jmax, S1, S2, H1..H4) are copied verbatim instead of generating fresh obfuscation and keys.password, HTTP/Mixedaccounts, and RealityshortIdsare not regenerated.Describe the solution you'd like
1. Add "Clone Client" Action to the Clients Page
ClientRowActions(/clients), add a Clone action button (icon:<CopyOutlined />).Clone client "{email}"?)./panel/api/clients/addfollowing these strict rules:totalGB), expiration (expiryTime), delayed start (delayedDays)trafficReset,trafficResetDay,reset,resetDay, etc.)limitIp,limitHwid,tgId)group,comment,enable)flow,security,reverseTag,externalLinks)inboundIds)email: newly generated viaRandomUtil.randomLowerAndNum(10)uuid/id: newly generated viaRandomUtil.randomUUID()subId: newly generated viaRandomUtil.randomLowerAndNum(16)password: newly generated viaRandomUtil.randomLowerAndNum(16)auth: newly generated viaRandomUtil.randomLowerAndNum(16)Wireguard.generateKeypair()secret: newly derived FakeTLS secret viagenerateMtprotoSecret(domain)allowedIPs: cleared so the backend automatically assigns the next available IP in the tunnel subnet.2. Harden Inbound Cloning (
buildClonePayload)buildClonePayloadininbound-clone.tsto ensure protocol-specific credentials and obfuscation parameters are re-randomized upon cloning:secretKey(Wireguard.generateKeypair().privateKey).generateAwgObfuscation()).passwordbased on the method.accountscredentials (userandpass).shortIds.Alternatives you've considered
Concrete use case
An administrator offers standard user profiles (e.g. "VIP Tier: 100 GB / 30-day auto-renew / 2 IPs / Attached to Inbound #1, #2 and #5 / Group: VIP"). When adding new customers to this tier, the administrator can simply click "Clone" on any existing VIP user to instantly provision a new client with unique credentials while perfectly retaining all tier policies.
Which parts of the panel would this affect?
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Oct 19, 2026):
This is a valid feature request, and both of its premises match the current code. The Clients page has no clone action. The inbound "Clone" action does copy protocol credentials verbatim; it only clears the client list and changes the port.
1. No clone action on
/clients.ClientRowActions(frontend/src/pages/clients/RowCells.tsx:17-24) takes onlyonShowQr,onShowInfo,onResetTraffic,onEditandonDelete, so there is nothing to duplicate a client with.Until a clone action exists, the closest thing is the Bulk add modal (
frontend/src/pages/clients/ClientBulkAddModal.tsx). It creates N clients in one go with a sharedgroup,comment,flow,limitIp,limitHwid,totalGB,expiryTime, renewal settings (reset,resetDay,trafficReset, …) andinboundIds(see itsEMPTYdefaults at lines 45-66). It does not prefill those values from an existing client, though, which is the gap you describe. An older request for the same thing, #137 (2023), was closed as not planned on the legacy panel.2. The inbound clone keeps credentials.
buildClonePayload(frontend/src/lib/xray/inbound-clone.ts:13-48) changes only the client list:streamSettingsis passed through as-is (lines 23-26). So everything else insettingsgets copied: the WireGuardsecretKey, the AmneziaWGserver.privateKey/publicKeyand obfuscation parameters, the Shadowsocks serverpassword, and the HTTP/Mixedaccounts. BecausestreamSettingsis copied too, RealityshortIds(and the Reality keys) carry over as well. The existing test pins this on purpose:inbound-clone.test.tsasserts that "the rest of the settings survive verbatim".For AmneziaWG specifically, copying the obfuscation parameters contradicts what the defaults say they are for.
frontend/src/lib/xray/inbound-defaults.tssays the parameters "are randomized per inbound (a static default would give every install the same DPI fingerprint)". Today a clone produces two inbounds with the same fingerprint and the same server key.Notes for whoever implements this:
createDefaultWireguardInboundSettings/createDefaultAmneziawgInboundSettingsininbound-defaults.ts, andgenerateAwgObfuscationinfrontend/src/lib/xray/amneziawg-obfuscation.ts. Reusing them is better than writing new random logic, because the Go generator (GenerateObfuscation31ininternal/amneziawg/params.go) has to stay in step with the TS one."rest of the settings survive verbatim"test would need to change to match the new behaviour./panel/api/clients/addpath, so no new route is needed. Any new UI string (button label, confirmation text) has to be added to all 13 locale files ininternal/web/translation/.shortIdsis a design decision for the maintainer. Regenerating it would change the public key that every share link of the clone uses.Verdict: Feature request
This reply was generated automatically; a maintainer may follow up.