[PR #6158] [MERGED] [client] Allow wireguard port to be zero in UI and show port in status command #29109

Closed
opened 2026-08-05 08:07:27 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/6158
Author: @theodorsm
Created: 5/15/2026
Status: Merged
Merged: 6/4/2026
Merged by: @theodorsm

Base: mainHead: fix/wireguard-port-zero


📝 Commits (6)

📊 Changes

8 files changed (+40 additions, -13 deletions)

View changed files

📝 client/internal/engine.go (+1 -0)
📝 client/internal/peer/status.go (+2 -0)
📝 client/proto/daemon.pb.go (+11 -2)
📝 client/proto/daemon.proto (+1 -0)
📝 client/proto/generate.sh (+5 -6)
📝 client/status/status.go (+9 -0)
📝 client/status/status_test.go (+7 -1)
📝 client/ui/client_ui.go (+4 -4)

📄 Description

Describe your changes

When Wireguard port is set to 0 (in profile or default.json) the daemon picks a random free port at startup, but nothing in the client surfaced the actual port. The UI form refused 0 as input and to be shown, and netbird status had no field for the port at all. This PR makes 0 a valid configuration in the GUI and exposes the chosen port through status.

Screenshot from 2026-05-15 17-09-58 image

https://github.com/netbirdio/netbird/issues/4557

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Summary by CodeRabbit

  • New Features

    • Status output and summaries now display the local WireGuard listening port; the local peer state publishes the configured port.
    • Interface port configuration accepts 0 to request a random free port; UI now hints that 0 selects a random port and validates 0–65535.
  • Chores

    • Protobuf generation tooling updated and script made more robust.
  • Tests

    • Status conversion tests updated to include and validate the WireGuard port.

🔄 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/netbirdio/netbird/pull/6158 **Author:** [@theodorsm](https://github.com/theodorsm) **Created:** 5/15/2026 **Status:** ✅ Merged **Merged:** 6/4/2026 **Merged by:** [@theodorsm](https://github.com/theodorsm) **Base:** `main` ← **Head:** `fix/wireguard-port-zero` --- ### 📝 Commits (6) - [`ae034a7`](https://github.com/netbirdio/netbird/commit/ae034a7330f456ee9cc63c8ec295140ebe510e2c) Allow wireguard port to be set to 0 in UI - [`54445f9`](https://github.com/netbirdio/netbird/commit/54445f9e46eea1e009a5a3e492646829a172edcf) Add wireguard port to cmd status - [`81576f2`](https://github.com/netbirdio/netbird/commit/81576f25efc06e5f6bde09be8b5263ff4147a18d) Change protoc version - [`cba77dd`](https://github.com/netbirdio/netbird/commit/cba77dda6f81b7b2e27e004f15c27ffb394dfb6a) Fix error message in UI - [`a3fe534`](https://github.com/netbirdio/netbird/commit/a3fe5347cbd65ef411cca07436d3a6c9d08cccc2) Add tests - [`8b571a3`](https://github.com/netbirdio/netbird/commit/8b571a3c1d3cbb3ef4c3c709d8105d5fbe6a687a) Fix indentation ### 📊 Changes **8 files changed** (+40 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `client/internal/engine.go` (+1 -0) 📝 `client/internal/peer/status.go` (+2 -0) 📝 `client/proto/daemon.pb.go` (+11 -2) 📝 `client/proto/daemon.proto` (+1 -0) 📝 `client/proto/generate.sh` (+5 -6) 📝 `client/status/status.go` (+9 -0) 📝 `client/status/status_test.go` (+7 -1) 📝 `client/ui/client_ui.go` (+4 -4) </details> ### 📄 Description ## Describe your changes When Wireguard port is set to 0 (in profile or `default.json`) the daemon picks a random free port at startup, but nothing in the client surfaced the actual port. The UI form refused 0 as input and to be shown, and netbird status had no field for the port at all. This PR makes 0 a valid configuration in the GUI and exposes the chosen port through status. <img width="894" height="655" alt="Screenshot from 2026-05-15 17-09-58" src="https://github.com/user-attachments/assets/fe8ea781-119c-4ab2-a102-babb53a920fc" /> <img width="844" height="617" alt="image" src="https://github.com/user-attachments/assets/6bc0432c-e437-44b3-8a64-6f7a911ac9f4" /> ## Issue ticket number and link https://github.com/netbirdio/netbird/issues/4557 ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (explain why) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Status output and summaries now display the local WireGuard listening port; the local peer state publishes the configured port. * Interface port configuration accepts 0 to request a random free port; UI now hints that 0 selects a random port and validates 0–65535. * **Chores** * Protobuf generation tooling updated and script made more robust. * **Tests** * Status conversion tests updated to include and validate the WireGuard port. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 08:07:27 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#29109