[PR #5631] [CLOSED] fix(wireguard): address review feedback #5939

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5631
Author: @mrAntonD
Created: 6/28/2026
Status: ❌ Closed

Base: main ← Head: codex/wg-review-feedback


📝 Commits (10+)

  • 1e9290f feat(wireguard): manage WG peers as clients on the Clients page
  • 67ed0c8 fix(wg): fix peer data loss, delete error, QR/info for WireGuard clients
  • 053200e feat(wg): show config text and download button in QR modal
  • f7c09e4 fix(wg): next IP suggestion, QR public key, and malformed JSON on add
  • 236e49c fix(wg): toggle enable/disable and show config in QR modal
  • 9231c00 feat(wg): download config in info/edit modals, preserve wgPeer on hydrate
  • fe18197 feat(wg): hide subscription/links blocks for WireGuard clients
  • 13ff78a perf(wg): patch peers[] in-place instead of full DB rebuild on add/update/del
  • f4317c9 fix(ci): register WgPeerSettings in codegen and document WG client endpoints
  • 962b9a3 fix(ci): regenerate openapi.json after adding WG client endpoint docs

📊 Changes

54 files changed (+3081 additions, -534 deletions)

View changed files

📝 frontend/public/openapi.json (+236 -2)
📝 frontend/src/generated/examples.ts (+13 -2)
📝 frontend/src/generated/schemas.ts (+43 -1)
📝 frontend/src/generated/types.ts (+10 -0)
📝 frontend/src/generated/zod.ts (+11 -0)
📝 frontend/src/hooks/useClients.ts (+3 -0)
📝 frontend/src/lib/xray/inbound-defaults.ts (+9 -9)
📝 frontend/src/pages/api-docs/endpoints.ts (+30 -0)
📝 frontend/src/pages/clients/ClientFormModal.tsx (+355 -122)
📝 frontend/src/pages/clients/ClientInfoModal.css (+8 -0)
📝 frontend/src/pages/clients/ClientInfoModal.tsx (+223 -96)
📝 frontend/src/pages/clients/ClientQrModal.tsx (+113 -13)
📝 frontend/src/pages/clients/ClientsPage.tsx (+96 -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 (+18 -86)
📝 frontend/src/pages/inbounds/qr/QrCodeModal.tsx (+3 -2)
📝 frontend/src/pages/inbounds/useInbounds.ts (+15 -2)
📝 frontend/src/schemas/client.ts (+10 -0)
📝 go.mod (+1 -1)

...and 34 more files

📄 Description

Follow-up to MHSanaei/3x-ui#5623.

This PR addresses the review feedback from the closed WireGuard clients PR and keeps the same feature direction: WireGuard peers are managed as first-class clients while settings.peers[] remains the runtime projection for Xray.

What changed

  • Preserve WG client comments across panel restarts by storing email separately from the real peer comment.
  • Keep disabled WG clients attached to their inbound during startup reconciliation, so disabling stays reversible after restart.
  • Rebuild WG settings.peers[] from linked clients on inbound updates, runtime API updates, and cold-start config generation instead of trusting stale inbound form snapshots.
  • Merge wgSettings during client record merge, with redacted conflict reporting.
  • Complete the new WG i18n keys across all 13 locale files and route WG UI strings/tab labels through t().
  • Derive the next WG peer IP from existing peer addresses instead of assuming only 10.0.0.0/24.
  • Fix the inbound list WG active-client counter by reading peer.email with legacy fallback to peer.comment.

Validation

  • go test ./... -timeout=300s
  • npm run typecheck
  • npm run build with Node 22.23.0
  • git diff --check

Notes

The previous PR review threads are still unresolved on GitHub because MHSanaei/3x-ui#5623 is closed, but each actionable item from that review is covered here.


🔄 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/5631 **Author:** [@mrAntonD](https://github.com/mrAntonD) **Created:** 6/28/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/wg-review-feedback` --- ### 📝 Commits (10+) - [`1e9290f`](https://github.com/MHSanaei/3x-ui/commit/1e9290f864245246070acd5b5ef52c6e4ae6a01a) feat(wireguard): manage WG peers as clients on the Clients page - [`67ed0c8`](https://github.com/MHSanaei/3x-ui/commit/67ed0c842d35bb814401845116c5e8d1e8c36761) fix(wg): fix peer data loss, delete error, QR/info for WireGuard clients - [`053200e`](https://github.com/MHSanaei/3x-ui/commit/053200ed71f996c9a9ab3336819409a03e2da509) feat(wg): show config text and download button in QR modal - [`f7c09e4`](https://github.com/MHSanaei/3x-ui/commit/f7c09e4214bac8fa56eb7685acf8c5b9278f6b10) fix(wg): next IP suggestion, QR public key, and malformed JSON on add - [`236e49c`](https://github.com/MHSanaei/3x-ui/commit/236e49cf1ae4e6921b402cc74102b4b0b9e3e133) fix(wg): toggle enable/disable and show config in QR modal - [`9231c00`](https://github.com/MHSanaei/3x-ui/commit/9231c00062348abd066a9e36423f248381728e7f) feat(wg): download config in info/edit modals, preserve wgPeer on hydrate - [`fe18197`](https://github.com/MHSanaei/3x-ui/commit/fe18197d30bc0c05d243c080069cffa58c2679f4) feat(wg): hide subscription/links blocks for WireGuard clients - [`13ff78a`](https://github.com/MHSanaei/3x-ui/commit/13ff78a8a4c8025cf65a7f794cd9127a0b2d3b19) perf(wg): patch peers[] in-place instead of full DB rebuild on add/update/del - [`f4317c9`](https://github.com/MHSanaei/3x-ui/commit/f4317c997222512b9b5d8b0d7b5e9e99912cca0c) fix(ci): register WgPeerSettings in codegen and document WG client endpoints - [`962b9a3`](https://github.com/MHSanaei/3x-ui/commit/962b9a3bc1d0d08cc0c8b690e33b6e0a10a03b12) fix(ci): regenerate openapi.json after adding WG client endpoint docs ### 📊 Changes **54 files changed** (+3081 additions, -534 deletions) <details> <summary>View changed files</summary> 📝 `frontend/public/openapi.json` (+236 -2) 📝 `frontend/src/generated/examples.ts` (+13 -2) 📝 `frontend/src/generated/schemas.ts` (+43 -1) 📝 `frontend/src/generated/types.ts` (+10 -0) 📝 `frontend/src/generated/zod.ts` (+11 -0) 📝 `frontend/src/hooks/useClients.ts` (+3 -0) 📝 `frontend/src/lib/xray/inbound-defaults.ts` (+9 -9) 📝 `frontend/src/pages/api-docs/endpoints.ts` (+30 -0) 📝 `frontend/src/pages/clients/ClientFormModal.tsx` (+355 -122) 📝 `frontend/src/pages/clients/ClientInfoModal.css` (+8 -0) 📝 `frontend/src/pages/clients/ClientInfoModal.tsx` (+223 -96) 📝 `frontend/src/pages/clients/ClientQrModal.tsx` (+113 -13) 📝 `frontend/src/pages/clients/ClientsPage.tsx` (+96 -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` (+18 -86) 📝 `frontend/src/pages/inbounds/qr/QrCodeModal.tsx` (+3 -2) 📝 `frontend/src/pages/inbounds/useInbounds.ts` (+15 -2) 📝 `frontend/src/schemas/client.ts` (+10 -0) 📝 `go.mod` (+1 -1) _...and 34 more files_ </details> ### 📄 Description Follow-up to MHSanaei/3x-ui#5623. This PR addresses the review feedback from the closed WireGuard clients PR and keeps the same feature direction: WireGuard peers are managed as first-class clients while `settings.peers[]` remains the runtime projection for Xray. ## What changed - Preserve WG client comments across panel restarts by storing `email` separately from the real peer `comment`. - Keep disabled WG clients attached to their inbound during startup reconciliation, so disabling stays reversible after restart. - Rebuild WG `settings.peers[]` from linked clients on inbound updates, runtime API updates, and cold-start config generation instead of trusting stale inbound form snapshots. - Merge `wgSettings` during client record merge, with redacted conflict reporting. - Complete the new WG i18n keys across all 13 locale files and route WG UI strings/tab labels through `t()`. - Derive the next WG peer IP from existing peer addresses instead of assuming only `10.0.0.0/24`. - Fix the inbound list WG active-client counter by reading `peer.email` with legacy fallback to `peer.comment`. ## Validation - `go test ./... -timeout=300s` - `npm run typecheck` - `npm run build` with Node `22.23.0` - `git diff --check` ## Notes The previous PR review threads are still unresolved on GitHub because MHSanaei/3x-ui#5623 is closed, but each actionable item from that review is covered here. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:05:10 +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#5939
No description provided.