[PR #6311] [MERGED] feat(nord): support multi-server NordLynx outbounds #6216

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6311
Author: @Masterain98
Created: 8/25/2026
Status: ✅ Merged
Merged: 9/2/2026
Merged by: @MHSanaei

Base: main ← Head: pr/nord-multi-outbounds


📝 Commits (2)

  • 255a428 feat(nord): support multi-server NordLynx outbounds
  • 3923903 fix(nord): address verified PR review findings

📊 Changes

23 files changed (+1181 additions, -210 deletions)

View changed files

📝 docs/content/docs/en/operations/outbounds-routing.mdx (+8 -1)
📝 docs/content/docs/fa/operations/outbounds-routing.mdx (+8 -1)
📝 docs/content/docs/ru/operations/outbounds-routing.mdx (+9 -1)
📝 docs/content/docs/zh/operations/outbounds-routing.mdx (+7 -1)
📝 frontend/src/pages/xray/XrayPage.tsx (+0 -15)
📝 frontend/src/pages/xray/overrides/NordModal.css (+300 -14)
📝 frontend/src/pages/xray/overrides/NordModal.tsx (+289 -139)
➕ frontend/src/test/nord-modal.test.tsx (+427 -0)
📝 internal/web/service/integration/nord.go (+7 -25)
➕ internal/web/service/integration/nord_test.go (+74 -0)
📝 internal/web/translation/ar-EG.json (+4 -1)
📝 internal/web/translation/en-US.json (+4 -1)
📝 internal/web/translation/es-ES.json (+4 -1)
📝 internal/web/translation/fa-IR.json (+4 -1)
📝 internal/web/translation/id-ID.json (+4 -1)
📝 internal/web/translation/ja-JP.json (+4 -1)
📝 internal/web/translation/pt-BR.json (+4 -1)
📝 internal/web/translation/ru-RU.json (+4 -1)
📝 internal/web/translation/tr-TR.json (+4 -1)
📝 internal/web/translation/uk-UA.json (+4 -1)

...and 3 more files

📄 Description

Summary

Add multi-server NordVPN NordLynx outbound management.

Users can add multiple unique NordVPN WireGuard outbounds from the same modal, inspect each server's hostname, endpoint IP, and load, reset individual NordLynx private keys, and continue managing existing outbounds without closing the dialog.

Why

The existing NordVPN integration only handled the first nord-* outbound and did not provide a practical way to configure multiple NordLynx server routes.

This PR addresses the core request from Issue #4101 by bringing the NordVPN modal closer to the existing PIA multi-line workflow.

Resolve #4101

Type of change

  • New feature
  • Bug fix
  • 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

What changed

NordVPN multi-outbound workflow

  • Enumerate all existing nord-* outbounds while preserving their real indexes in the complete outbound list.
  • Keep the NordVPN modal open after adding an outbound.
  • Allow multiple different NordVPN servers to be added consecutively.
  • Use nord-<hostname> as the stable outbound tag.
  • Disable adding when the selected server already exists.
  • Display all existing NordVPN outbounds in an added-server list.
  • Reset only the selected outbound's settings.secretKey.
  • Preserve the existing tag, peer, endpoint, routes, and custom settings during reset.
  • Keep malformed or non-resettable NordVPN rows visible while disabling their Reset action.
  • Keep logout credential-only; existing outbounds and routing rules are not removed.

Server selection and presentation

  • Filter NordVPN countries and servers using the descriptive wireguard_udp technology identifier.
  • Preserve low-load servers returned by the NordVPN API.
  • Default the city selection to All Cities.
  • Add localized country names and country flags.
  • Display server load percentages with status styling.
  • Display the server hostname and WireGuard endpoint IP on one line.
  • Display the persisted endpoint alongside each added outbound.
  • Include endpoint IP addresses in server search text.
  • Keep the load indicator aligned to the right side of the picker.
  • Retain a compact single-line layout while providing narrow-screen fallbacks.

Compatibility

  • No database migration is required.
  • No new NordVPN backend endpoint is introduced.
  • Existing NordVPN credentials and persistence format remain unchanged.
  • Existing nord-* tags are not renamed.
  • Existing Xray WireGuard outbound structure remains unchanged.
  • Existing outbounds and routes are preserved when logging out.

How was this tested?

Automated frontend tests

From the frontend directory:

npm run test -- src/test/nord-modal.test.tsx
npm run typecheck
npm run lint
npm run format:check

The focused NordVPN modal test suite passes all 9 tests.

The test coverage includes:

  • Access-token and manual-private-key login entry points.
  • Adding two different NordLynx servers consecutively.
  • Keeping the modal open after adding an outbound.
  • Generating unique hostname-based tags.
  • Generating server-specific endpoint and public-key values.
  • Displaying server endpoint IP addresses.
  • Displaying server load values.
  • Disabling duplicate server additions.
  • Correct handling of mixed outbound arrays and real outbound indexes.
  • Resetting only the selected outbound private key.
  • Preserving tags, peers, endpoints, routes, and custom settings.
  • Keeping configured outbounds after NordVPN logout.
  • Rejecting servers without a valid NordLynx public key.
  • Displaying All Cities after loading a country.

Manual verification

  1. Open the Xray outbound settings page.
  2. Open the NordVPN NordLynx dialog.
  3. Log in using an access token or provide a manual NordLynx private key.
  4. Select a country and confirm that the country flag is displayed.
  5. Confirm that City defaults to All Cities.
  6. Open the server selector and verify that each row shows:
    • server name;
    • hostname;
    • endpoint IP and port;
    • load percentage aligned on the right.
  7. Add one server and confirm that the dialog remains open.
  8. Add a second server and confirm that both rows appear in the added-server list.
  9. Select an already-added server and confirm that the Add outbound button is disabled.
  10. Reset one existing server and confirm that only its private key changes.
  11. Log out and confirm that existing outbounds and routing rules remain unchanged.

Screenshots / recordings

image image

Breaking changes

None.

The public NordVPN API actions, persisted credential format, outbound tags, Xray WireGuard settings, and existing routing references remain compatible with previous configurations.

Validation notes

The focused frontend tests, TypeScript type checking, linting, formatting, and git diff --check pass locally.

The full Go build and integration suite should be run in a Linux or Windows environment with a working CGO compiler. The current Windows checkout does not have GCC configured for the SQLite dependency.

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/6311 **Author:** [@Masterain98](https://github.com/Masterain98) **Created:** 8/25/2026 **Status:** ✅ Merged **Merged:** 9/2/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `pr/nord-multi-outbounds` --- ### 📝 Commits (2) - [`255a428`](https://github.com/MHSanaei/3x-ui/commit/255a4280bd31be13bdc98ffc60834895e8ef84ef) feat(nord): support multi-server NordLynx outbounds - [`3923903`](https://github.com/MHSanaei/3x-ui/commit/3923903a5de4d84f8006929e899c45cbfe39e893) fix(nord): address verified PR review findings ### 📊 Changes **23 files changed** (+1181 additions, -210 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/en/operations/outbounds-routing.mdx` (+8 -1) 📝 `docs/content/docs/fa/operations/outbounds-routing.mdx` (+8 -1) 📝 `docs/content/docs/ru/operations/outbounds-routing.mdx` (+9 -1) 📝 `docs/content/docs/zh/operations/outbounds-routing.mdx` (+7 -1) 📝 `frontend/src/pages/xray/XrayPage.tsx` (+0 -15) 📝 `frontend/src/pages/xray/overrides/NordModal.css` (+300 -14) 📝 `frontend/src/pages/xray/overrides/NordModal.tsx` (+289 -139) ➕ `frontend/src/test/nord-modal.test.tsx` (+427 -0) 📝 `internal/web/service/integration/nord.go` (+7 -25) ➕ `internal/web/service/integration/nord_test.go` (+74 -0) 📝 `internal/web/translation/ar-EG.json` (+4 -1) 📝 `internal/web/translation/en-US.json` (+4 -1) 📝 `internal/web/translation/es-ES.json` (+4 -1) 📝 `internal/web/translation/fa-IR.json` (+4 -1) 📝 `internal/web/translation/id-ID.json` (+4 -1) 📝 `internal/web/translation/ja-JP.json` (+4 -1) 📝 `internal/web/translation/pt-BR.json` (+4 -1) 📝 `internal/web/translation/ru-RU.json` (+4 -1) 📝 `internal/web/translation/tr-TR.json` (+4 -1) 📝 `internal/web/translation/uk-UA.json` (+4 -1) _...and 3 more files_ </details> ### 📄 Description ## Summary Add multi-server NordVPN NordLynx outbound management. Users can add multiple unique NordVPN WireGuard outbounds from the same modal, inspect each server's hostname, endpoint IP, and load, reset individual NordLynx private keys, and continue managing existing outbounds without closing the dialog. ## Why The existing NordVPN integration only handled the first `nord-*` outbound and did not provide a practical way to configure multiple NordLynx server routes. This PR addresses the core request from Issue #4101 by bringing the NordVPN modal closer to the existing PIA multi-line workflow. Resolve #4101 ## Type of change - [x] New feature - [x] Bug fix - [ ] Refactoring (no behavior change) - [ ] Documentation - [ ] Tests only - [ ] Build / CI / tooling - [ ] Other ## Areas affected - [x] Frontend (UI / panel pages) - [x] Backend (API endpoints, login, settings) - [x] Xray config generation - [ ] Subscription (share links / Clash / JSON) - [ ] Statistics / traffic counters - [ ] Database / migrations - [ ] Install / upgrade script - [ ] Docker image - [ ] Multi-node (sub-nodes) - [ ] Telegram bot ## What changed ### NordVPN multi-outbound workflow - Enumerate all existing `nord-*` outbounds while preserving their real indexes in the complete outbound list. - Keep the NordVPN modal open after adding an outbound. - Allow multiple different NordVPN servers to be added consecutively. - Use `nord-<hostname>` as the stable outbound tag. - Disable adding when the selected server already exists. - Display all existing NordVPN outbounds in an added-server list. - Reset only the selected outbound's `settings.secretKey`. - Preserve the existing tag, peer, endpoint, routes, and custom settings during reset. - Keep malformed or non-resettable NordVPN rows visible while disabling their Reset action. - Keep logout credential-only; existing outbounds and routing rules are not removed. ### Server selection and presentation - Filter NordVPN countries and servers using the descriptive `wireguard_udp` technology identifier. - Preserve low-load servers returned by the NordVPN API. - Default the city selection to `All Cities`. - Add localized country names and country flags. - Display server load percentages with status styling. - Display the server hostname and WireGuard endpoint IP on one line. - Display the persisted endpoint alongside each added outbound. - Include endpoint IP addresses in server search text. - Keep the load indicator aligned to the right side of the picker. - Retain a compact single-line layout while providing narrow-screen fallbacks. ### Compatibility - No database migration is required. - No new NordVPN backend endpoint is introduced. - Existing NordVPN credentials and persistence format remain unchanged. - Existing `nord-*` tags are not renamed. - Existing Xray WireGuard outbound structure remains unchanged. - Existing outbounds and routes are preserved when logging out. ## How was this tested? ### Automated frontend tests From the `frontend` directory: ```bash npm run test -- src/test/nord-modal.test.tsx npm run typecheck npm run lint npm run format:check ``` The focused NordVPN modal test suite passes all 9 tests. The test coverage includes: - Access-token and manual-private-key login entry points. - Adding two different NordLynx servers consecutively. - Keeping the modal open after adding an outbound. - Generating unique hostname-based tags. - Generating server-specific endpoint and public-key values. - Displaying server endpoint IP addresses. - Displaying server load values. - Disabling duplicate server additions. - Correct handling of mixed outbound arrays and real outbound indexes. - Resetting only the selected outbound private key. - Preserving tags, peers, endpoints, routes, and custom settings. - Keeping configured outbounds after NordVPN logout. - Rejecting servers without a valid NordLynx public key. - Displaying `All Cities` after loading a country. ### Manual verification 1. Open the Xray outbound settings page. 2. Open the NordVPN NordLynx dialog. 3. Log in using an access token or provide a manual NordLynx private key. 4. Select a country and confirm that the country flag is displayed. 5. Confirm that City defaults to `All Cities`. 6. Open the server selector and verify that each row shows: - server name; - hostname; - endpoint IP and port; - load percentage aligned on the right. 7. Add one server and confirm that the dialog remains open. 8. Add a second server and confirm that both rows appear in the added-server list. 9. Select an already-added server and confirm that the Add outbound button is disabled. 10. Reset one existing server and confirm that only its private key changes. 11. Log out and confirm that existing outbounds and routing rules remain unchanged. <!-- Add browser name and version here if desired. --> ## Screenshots / recordings <img width="961" height="894" alt="image" src="https://github.com/user-attachments/assets/f4273b02-fa1f-4423-aa5b-e35d41ebb215" /> <img width="1089" height="1098" alt="image" src="https://github.com/user-attachments/assets/b4dd4ede-6a09-4479-a1e3-5f14ced221b7" /> ## Breaking changes None. The public NordVPN API actions, persisted credential format, outbound tags, Xray WireGuard settings, and existing routing references remain compatible with previous configurations. ## Validation notes The focused frontend tests, TypeScript type checking, linting, formatting, and `git diff --check` pass locally. The full Go build and integration suite should be run in a Linux or Windows environment with a working CGO compiler. The current Windows checkout does not have GCC configured for the SQLite dependency. ## 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. - [x] 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:07: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#6216
No description provided.