Skip to content

Commit d7c1698

Browse files
hakansamlsmaycon
andauthored
add disable profiles docs (#410)
* Enhance CLI and Profiles documentation with environment variable examples and details on disabling profiles feature * Remove deprecated environment variable examples and notes related to the profiles feature in CLI documentation * Enhance CLI and Profiles documentation with additional environment variable examples and details on disabling update settings functionality * Update cli.mdx --------- Co-authored-by: Maycon Santos <[email protected]>
1 parent a2f38e9 commit d7c1698

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed

src/pages/how-to/cli.mdx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,21 @@ netbird up
4747
```
4848
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`.
4949

50+
Here are some additional examples of environment variables:
51+
```shell
52+
# Disable profiles feature
53+
export NB_DISABLE_PROFILES=true
54+
55+
# Disable update settings functionality
56+
export NB_DISABLE_UPDATE_SETTINGS=true
57+
58+
# Set custom log level
59+
export NB_LOG_LEVEL=debug
60+
61+
# Set custom daemon address
62+
export NB_DAEMON_ADDR="tcp://localhost:8080"
63+
```
64+
5065
## Commands
5166
### up
5267
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,19 @@ You can set a custom configuration path with the flag `--config`
432447
sudo netbird service install --config /opt/netbird/config.json
433448
```
434449

450+
#### Service-specific flags
451+
```shell
452+
--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
453+
--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
454+
455+
```
456+
457+
<Note>
458+
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.
459+
460+
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.
461+
</Note>
462+
435463
### service uninstall
436464
The uninstall uninstalls the daemon service from the system.
437465
#### Usage
@@ -448,6 +476,10 @@ The minimal form of running the command is:
448476
sudo netbird service start
449477
```
450478

479+
<Note>
480+
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.
481+
</Note>
482+
451483
### service stop
452484
Stops the daemon service
453485
#### Usage
@@ -456,6 +488,34 @@ The minimal form of running the command is:
456488
sudo netbird service stop
457489
```
458490

491+
### service restart
492+
Restarts the daemon service
493+
#### Usage
494+
The minimal form of running the command is:
495+
```shell
496+
sudo netbird service restart
497+
```
498+
499+
### service status
500+
Shows the status of the daemon service
501+
#### Usage
502+
The minimal form of running the command is:
503+
```shell
504+
sudo netbird service status
505+
```
506+
507+
### service reconfigure
508+
Reconfigures the daemon service with current settings
509+
#### Usage
510+
The minimal form of running the command is:
511+
```shell
512+
sudo netbird service reconfigure
513+
```
514+
515+
<Note>
516+
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.
517+
</Note>
518+
459519
### debug
460520
The `debug` command provides tools for diagnosing and understanding the internal operations of the NetBird daemon.
461521

src/pages/how-to/profiles.mdx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,38 @@ If you're upgrading from NetBird below version `0.52.0` that did not support pro
7777
copied to a new profile named `default`.
7878
* The `default` profile is set as active, and you can start using it immediately.
7979

80+
## Disabling Profiles Feature
81+
82+
In some environments, you may want to disable the profiles feature entirely. This can be useful for:
83+
84+
* **Managed environments** where users should not be able to switch between different NetBird accounts
85+
* **Security policies** that require a single, fixed configuration
86+
* **Automated deployments** where profile switching could interfere with operations
87+
88+
To disable the profiles feature, you can use the `--disable-profiles` flag when installing the service:
89+
90+
```shell
91+
sudo netbird service install --disable-profiles
92+
```
93+
94+
Alternatively, you can set the `NB_DISABLE_PROFILES` environment variable:
95+
96+
```shell
97+
export NB_DISABLE_PROFILES=true
98+
sudo netbird service install
99+
```
100+
101+
When profiles are disabled:
102+
* Users cannot create, switch, or remove profiles
103+
* The profile management UI is disabled
104+
* All profile-related CLI commands are disabled
105+
* The client operates with a single, fixed configuration
106+
* Profile switching is completely prevented
107+
108+
<Note>
109+
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.
110+
</Note>
111+
80112
---
81113

82114
## Profile CLI Commands

0 commit comments

Comments
 (0)