mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #5458] [CLOSED] feat(wireguard): manage WireGuard peers as clients on the Clients tab #5887
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#5887
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?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/5458
Author: @mrAntonD
Created: 6/21/2026
Status: ❌ Closed
Base:
main← Head:main📝 Commits (10+)
1e9290ffeat(wireguard): manage WG peers as clients on the Clients page67ed0c8fix(wg): fix peer data loss, delete error, QR/info for WireGuard clients053200efeat(wg): show config text and download button in QR modalf7c09e4fix(wg): next IP suggestion, QR public key, and malformed JSON on add236e49cfix(wg): toggle enable/disable and show config in QR modal9231c00feat(wg): download config in info/edit modals, preserve wgPeer on hydratefe18197feat(wg): hide subscription/links blocks for WireGuard clients13ff78aperf(wg): patch peers[] in-place instead of full DB rebuild on add/update/delf4317c9fix(ci): register WgPeerSettings in codegen and document WG client endpoints962b9a3fix(ci): regenerate openapi.json after adding WG client endpoint docs📊 Changes
28 files changed (+1777 additions, -494 deletions)
View changed files
📝
frontend/public/openapi.json(+233 -2)📝
frontend/src/generated/examples.ts(+12 -2)📝
frontend/src/generated/schemas.ts(+39 -1)📝
frontend/src/generated/types.ts(+9 -0)📝
frontend/src/generated/zod.ts(+10 -0)📝
frontend/src/hooks/useClients.ts(+3 -0)📝
frontend/src/pages/api-docs/endpoints.ts(+31 -0)📝
frontend/src/pages/clients/ClientFormModal.tsx(+293 -110)📝
frontend/src/pages/clients/ClientInfoModal.tsx(+175 -96)📝
frontend/src/pages/clients/ClientQrModal.tsx(+111 -13)📝
frontend/src/pages/clients/ClientsPage.tsx(+33 -2)📝
frontend/src/pages/inbounds/form/InboundFormModal.tsx(+1 -7)📝
frontend/src/pages/inbounds/form/protocols/wireguard.tsx(+3 -123)📝
frontend/src/pages/inbounds/info/InboundInfoModal.tsx(+11 -84)📝
frontend/src/pages/inbounds/useInbounds.ts(+15 -2)📝
frontend/src/schemas/client.ts(+9 -0)📝
internal/database/model/model.go(+47 -22)📝
internal/web/controller/inbound.go(+92 -0)📝
internal/web/service/client_crud.go(+70 -6)📝
internal/web/service/client_link.go(+3 -0)...and 8 more files
📄 Description
Summary
settings.peers[]are migrated to theclientstable on first startup — no data lossKey changes
Backend
model.go—WgPeerSettingsstruct +wg_settingscolumn onClientRecord;MarshalJSON/UnmarshalJSONexpose it aswgPeerin API responsesclient_wg_apply.go—AddWgClient,UpdateWgClient,DelWgClient: full CRUD; each mutation rebuildssettings.peers[]from the clients tableclient_wg_peers.go—syncWgPeersFromClients,wgPeerToRecord,SyncWgInboundinbound.go—UpdateInboundpreservessettings.peers[]when the form omits them;inboundWgPublicKeyderives server public key fromsecretKeyvia curve25519;GetInboundOptionsexposeswgPublicKeyclient_crud.go—Delete()routes WG inbounds throughDelWgClient(fixes "invalid clients format" error)client_paging.go—ClientSlimincludeswgPeerso next-IP suggestion works from the paged listinbound_migration.go—MigrateWgPeerssyncs existing peers to clients table on startupinbound.gocontroller — WG CRUD endpoints under/panel/api/inbounds/wg/Frontend
ClientFormModal— WG fields (public/private key, PSK, allowed IPs, keepalive) when WG inbound selected; irrelevant fields hidden; auto-suggests next sequential IPClientQrModal— generates WireGuard.conf([Interface]+[Peer]); supports.confdownloadClientInfoModal— WG-specific fields shown; non-applicable ones hiddenuseInbounds— WireGuard added toTRACKED_PROTOCOLS; peer count read fromsettings.peersTest plan
.confwith correct keys and endpoint🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.