[PR #5896] [client] Add --disable-networks flag to block network selection #28727

Closed
opened 2026-08-05 08:06:50 -04:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/netbirdio/netbird/pull/5896

State: closed
Merged: Yes


Describe your changes

Add a --disable-networks service flag that blocks network and exit node selection at the daemon level. For deployments where users should not modify routing.

  • Block ListNetworks, SelectNetworks, and DeselectNetworks RPCs when the flag is set, returning a gRPC Unavailable error
  • Add disable_networks to the GetFeaturesResponse proto so the UI can hide the Networks and Exit Node menus
  • Persist the flag in service.json across reinstalls, following the same pattern as --disable-profiles and --disable-update-settings

Usage: netbird service install --disable-networks

Stack

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)

Flag follows the exact same pattern as existing --disable-profiles and --disable-update-settings which are already documented. Can be added to the same docs page.

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__

Summary by CodeRabbit

  • New Features

    • Added --disable-networks CLI flag to disable network listing, selection, and deselection
    • Network-disable setting is persisted and retained across restarts
    • Daemon now reports network-disable capability so clients can react
  • Bug Fixes / UX

    • Networks and Exit Node menu items enable/disable dynamically based on feature availability
    • Attempts to use networks when disabled now return a clear "networks disabled" error
**Original Pull Request:** https://github.com/netbirdio/netbird/pull/5896 **State:** closed **Merged:** Yes --- ## Describe your changes Add a `--disable-networks` service flag that blocks network and exit node selection at the daemon level. For deployments where users should not modify routing. - Block ListNetworks, SelectNetworks, and DeselectNetworks RPCs when the flag is set, returning a gRPC Unavailable error - Add `disable_networks` to the GetFeaturesResponse proto so the UI can hide the Networks and Exit Node menus - Persist the flag in service.json across reinstalls, following the same pattern as `--disable-profiles` and `--disable-update-settings` Usage: `netbird service install --disable-networks` ## Issue ticket number and link ## Stack <!-- branch-stack --> ### Checklist - [ ] 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) Flag follows the exact same pattern as existing --disable-profiles and --disable-update-settings which are already documented. Can be added to the same docs page. ### Docs PR URL (required if "docs added" is checked) Paste the PR link from https://github.com/netbirdio/docs here: https://github.com/netbirdio/docs/pull/__ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added --disable-networks CLI flag to disable network listing, selection, and deselection * Network-disable setting is persisted and retained across restarts * Daemon now reports network-disable capability so clients can react * **Bug Fixes / UX** * Networks and Exit Node menu items enable/disable dynamically based on feature availability * Attempts to use networks when disabled now return a clear "networks disabled" error <!-- end of auto-generated comment: release notes by coderabbit.ai -->
saavagebueno added the pull-request label 2026-08-05 08:06:50 -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#28727