From f6aa97a65951777b29eaa6d7a35a2212303463d2 Mon Sep 17 00:00:00 2001 From: Hakan Sariman Date: Tue, 12 Aug 2025 20:04:53 +0300 Subject: [PATCH 1/4] Enhance CLI and Profiles documentation with environment variable examples and details on disabling profiles feature --- src/pages/how-to/cli.mdx | 57 +++++++++++++++++++++++++++++++++++ src/pages/how-to/profiles.mdx | 28 +++++++++++++++++ 2 files changed, 85 insertions(+) diff --git a/src/pages/how-to/cli.mdx b/src/pages/how-to/cli.mdx index 1f49cd66..74ff92bb 100644 --- a/src/pages/how-to/cli.mdx +++ b/src/pages/how-to/cli.mdx @@ -47,6 +47,18 @@ netbird up ``` The `up` command would process the variables, read the configuration file on `/opt/netbird/config.json` and attempt to connect to the management service running at `https://api.self-hosted.com:33073`. +Here are some additional examples of environment variables: +```shell +# Disable profiles feature +export NB_DISABLE_PROFILES=true + +# Set custom log level +export NB_LOG_LEVEL=debug + +# Set custom daemon address +export NB_DAEMON_ADDR="tcp://localhost:8080" +``` + ## Commands ### up Single command to log in and start the NetBird client. It can send a signal to the daemon service or run in the foreground with the flag `--foreground-mode`. @@ -432,6 +444,15 @@ You can set a custom configuration path with the flag `--config` sudo netbird service install --config /opt/netbird/config.json ``` +#### Service-specific flags +```shell + --disable-profiles Disables profiles feature. If enabled, the client will not be able to change or edit any profile. +``` + + + The `--disable-profiles` flag can also be set using the `NB_DISABLE_PROFILES` environment variable. Set it to any value (e.g., `true`, `1`, `yes`) to enable this feature. + + ### service uninstall The uninstall uninstalls the daemon service from the system. #### Usage @@ -448,6 +469,10 @@ The minimal form of running the command is: sudo netbird service start ``` + + If you installed the service with `--disable-profiles`, this setting will persist and profiles will remain disabled when the service starts. + + ### service stop Stops the daemon service #### Usage @@ -456,6 +481,38 @@ The minimal form of running the command is: sudo netbird service stop ``` +### service restart +Restarts the daemon service +#### Usage +The minimal form of running the command is: +```shell +sudo netbird service restart +``` + + + If you installed the service with `--disable-profiles`, this setting will persist and profiles will remain disabled when the service restarts. + + +### service status +Shows the status of the daemon service +#### Usage +The minimal form of running the command is: +```shell +sudo netbird service status +``` + +### service reconfigure +Reconfigures the daemon service with current settings +#### Usage +The minimal form of running the command is: +```shell +sudo netbird service reconfigure +``` + + + If you installed the service with `--disable-profiles`, this setting will persist and profiles will remain disabled after reconfiguration. + + ### debug The `debug` command provides tools for diagnosing and understanding the internal operations of the NetBird daemon. diff --git a/src/pages/how-to/profiles.mdx b/src/pages/how-to/profiles.mdx index 6753a179..0ab95fe2 100644 --- a/src/pages/how-to/profiles.mdx +++ b/src/pages/how-to/profiles.mdx @@ -77,6 +77,34 @@ If you're upgrading from NetBird below version `0.52.0` that did not support pro copied to a new profile named `default`. * The `default` profile is set as active, and you can start using it immediately. +## Disabling Profiles Feature + +In some environments, you may want to disable the profiles feature entirely. This can be useful for: + +* **Managed environments** where users should not be able to switch between different NetBird accounts +* **Security policies** that require a single, fixed configuration +* **Automated deployments** where profile switching could interfere with operations + +To disable the profiles feature, you can use the `--disable-profiles` flag when installing the service: + +```shell +sudo netbird service install --disable-profiles +``` + +Alternatively, you can set the `NB_DISABLE_PROFILES` environment variable: + +```shell +export NB_DISABLE_PROFILES=true +sudo netbird service install +``` + +When profiles are disabled: +* Users cannot create, switch, or remove profiles +* The profile management UI is disabled +* All profile-related CLI commands are disabled +* The client operates with a single, fixed configuration +* Profile switching is completely prevented + --- ## Profile CLI Commands From e7108899ae75ab5782b8f62d98587110b8e35eb1 Mon Sep 17 00:00:00 2001 From: Hakan Sariman Date: Tue, 12 Aug 2025 20:08:04 +0300 Subject: [PATCH 2/4] Remove deprecated environment variable examples and notes related to the profiles feature in CLI documentation --- src/pages/how-to/cli.mdx | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/src/pages/how-to/cli.mdx b/src/pages/how-to/cli.mdx index 74ff92bb..674fe1ca 100644 --- a/src/pages/how-to/cli.mdx +++ b/src/pages/how-to/cli.mdx @@ -47,18 +47,6 @@ netbird up ``` The `up` command would process the variables, read the configuration file on `/opt/netbird/config.json` and attempt to connect to the management service running at `https://api.self-hosted.com:33073`. -Here are some additional examples of environment variables: -```shell -# Disable profiles feature -export NB_DISABLE_PROFILES=true - -# Set custom log level -export NB_LOG_LEVEL=debug - -# Set custom daemon address -export NB_DAEMON_ADDR="tcp://localhost:8080" -``` - ## Commands ### up Single command to log in and start the NetBird client. It can send a signal to the daemon service or run in the foreground with the flag `--foreground-mode`. @@ -444,15 +432,6 @@ You can set a custom configuration path with the flag `--config` sudo netbird service install --config /opt/netbird/config.json ``` -#### Service-specific flags -```shell - --disable-profiles Disables profiles feature. If enabled, the client will not be able to change or edit any profile. -``` - - - The `--disable-profiles` flag can also be set using the `NB_DISABLE_PROFILES` environment variable. Set it to any value (e.g., `true`, `1`, `yes`) to enable this feature. - - ### service uninstall The uninstall uninstalls the daemon service from the system. #### Usage @@ -469,10 +448,6 @@ The minimal form of running the command is: sudo netbird service start ``` - - If you installed the service with `--disable-profiles`, this setting will persist and profiles will remain disabled when the service starts. - - ### service stop Stops the daemon service #### Usage @@ -489,10 +464,6 @@ The minimal form of running the command is: sudo netbird service restart ``` - - If you installed the service with `--disable-profiles`, this setting will persist and profiles will remain disabled when the service restarts. - - ### service status Shows the status of the daemon service #### Usage From 7cdde5977343500a1c7cdeb4278f9124a1d1bada Mon Sep 17 00:00:00 2001 From: Hakan Sariman Date: Wed, 13 Aug 2025 08:04:16 +0300 Subject: [PATCH 3/4] Enhance CLI and Profiles documentation with additional environment variable examples and details on disabling update settings functionality --- src/pages/how-to/cli.mdx | 33 ++++++++++++++++++++++++++++++++- src/pages/how-to/profiles.mdx | 4 ++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/pages/how-to/cli.mdx b/src/pages/how-to/cli.mdx index 674fe1ca..00dd649f 100644 --- a/src/pages/how-to/cli.mdx +++ b/src/pages/how-to/cli.mdx @@ -47,6 +47,21 @@ netbird up ``` The `up` command would process the variables, read the configuration file on `/opt/netbird/config.json` and attempt to connect to the management service running at `https://api.self-hosted.com:33073`. +Here are some additional examples of environment variables: +```shell +# Disable profiles feature +export NB_DISABLE_PROFILES=true + +# Disable update settings functionality +export NB_DISABLE_UPDATE_SETTINGS=true + +# Set custom log level +export NB_LOG_LEVEL=debug + +# Set custom daemon address +export NB_DAEMON_ADDR="tcp://localhost:8080" +``` + ## Commands ### up Single command to log in and start the NetBird client. It can send a signal to the daemon service or run in the foreground with the flag `--foreground-mode`. @@ -432,6 +447,18 @@ You can set a custom configuration path with the flag `--config` sudo netbird service install --config /opt/netbird/config.json ``` +#### Service-specific flags +```shell + --disable-profiles Disables profiles feature. If enabled, the client will not be able to change or edit any profile. + --disable-update-settings Disables update settings functionality. If enabled, the client will not be able to change or edit any configuration settings. +``` + + + The `--disable-profiles` flag can also be set using the `NB_DISABLE_PROFILES` environment variable. Set it to any value (e.g., `true`, `1`, `yes`) to enable this feature. + + The `--disable-update-settings` flag can also be set using the `NB_DISABLE_UPDATE_SETTINGS` environment variable. Set it to any value (e.g., `true`, `1`, `yes`) to enable this feature. + + ### service uninstall The uninstall uninstalls the daemon service from the system. #### Usage @@ -448,6 +475,10 @@ The minimal form of running the command is: sudo netbird service start ``` + + If you installed the service with `--disable-profiles` or `--disable-update-settings`, these settings will persist and the respective features will remain disabled when the service starts. + + ### service stop Stops the daemon service #### Usage @@ -481,7 +512,7 @@ sudo netbird service reconfigure ``` - If you installed the service with `--disable-profiles`, this setting will persist and profiles will remain disabled after reconfiguration. + If you installed the service with `--disable-profiles` or `--disable-update-settings`, these settings will persist and the respective features will remain disabled after reconfiguration. ### debug diff --git a/src/pages/how-to/profiles.mdx b/src/pages/how-to/profiles.mdx index 0ab95fe2..44ee254d 100644 --- a/src/pages/how-to/profiles.mdx +++ b/src/pages/how-to/profiles.mdx @@ -105,6 +105,10 @@ When profiles are disabled: * The client operates with a single, fixed configuration * Profile switching is completely prevented + + You can also disable update settings functionality using the `--disable-update-settings` flag or `NB_DISABLE_UPDATE_SETTINGS` environment variable. This prevents users from modifying any configuration settings, providing an additional layer of control in managed environments. + + --- ## Profile CLI Commands From 96d8c746426058526c7323b112d3b26cb665ae79 Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Wed, 13 Aug 2025 19:26:00 +0200 Subject: [PATCH 4/4] Update cli.mdx --- src/pages/how-to/cli.mdx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/how-to/cli.mdx b/src/pages/how-to/cli.mdx index 00dd649f..bfc65c15 100644 --- a/src/pages/how-to/cli.mdx +++ b/src/pages/how-to/cli.mdx @@ -449,8 +449,9 @@ sudo netbird service install --config /opt/netbird/config.json #### Service-specific flags ```shell - --disable-profiles Disables profiles feature. If enabled, the client will not be able to change or edit any profile. - --disable-update-settings Disables update settings functionality. If enabled, the client will not be able to change or edit any configuration settings. + --disable-profiles Disables profiles feature. If enabled, the client will not be able to change or edit any profile. To persist this setting, use: netbird service install --disable-profiles + --disable-update-settings Disables update settings feature. If enabled, the client will not be able to change or edit any settings. To persist this setting, use: netbird service install --disable-update-settings + ```