netbird: move state file to reduce storage wear
authorWesley Gimenes <redacted>
Tue, 17 Feb 2026 07:04:06 +0000 (04:04 -0300)
committerWesley Gimenes <redacted>
Sun, 8 Mar 2026 23:55:06 +0000 (20:55 -0300)
Add `NB_DNS_STATE_FILE="/var/lib/netbird/state.json"` to the init
environment. This moves the state from the directory
`/root/.config/netbird` to the file `/var/lib/netbird/state.json` to
avoid storage wear. Note: the file is not preserved across reboots.

The state file contains information such as locally disabled routes and
other data primarily useful for desktop clients. In OpenWrt setups,
these changes are normally handled by the NetBird `management` server.
This matches the behavior prior to `netbird` v0.52.x, I have not
received any reports that this file caused problems before, so it is
unlikely to cause issues now.

The previous state file `/root/.config/netbird/state.json` can be removed.

Signed-off-by: Wesley Gimenes <redacted>
net/netbird/Makefile
net/netbird/files/netbird.init

index d349b525d2adcc8e7db0e57939855c9e3920a3ef..29d95a4d6bd40ad12e8459479a841b3d066e7971 100644 (file)
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=netbird
 PKG_VERSION:=0.60.8
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/netbirdio/netbird/tar.gz/v$(PKG_VERSION)?
index 6072e2d2c3438ed08c1cc66ba835dd96557eb7b0..533404a075412fb46dbaa35b95f8ffeac5492fe7 100755 (executable)
@@ -12,6 +12,7 @@ start_service() {
 
        procd_set_param env NB_STATE_DIR="/root/.config/netbird"
        procd_append_param env NB_DISABLE_SSH_CONFIG="1"
+       procd_append_param env NB_DNS_STATE_FILE="/var/lib/netbird/state.json"
 
        procd_set_param pidfile /var/run/netbird.pid
        procd_close_instance
git clone https://git.99rst.org/PROJECT