From 59762b04666e8a0ee78a25e4cf011a673d75eec2 Mon Sep 17 00:00:00 2001 From: Bethuel Mmbaga Date: Fri, 19 Sep 2025 14:09:58 +0300 Subject: [PATCH] security/netbird: Fix service startup and add syslog support (#4942) * add syslog configuration options and update service reconfiguration endpoint * enable syslog by default and expand log level options * add plugin revision * update service configuration and logging options * update syslog log level options and change config sync target * revert default config file * Fix log level settings * refactor * Update security/netbird/Makefile Co-authored-by: Franco Fichtner * Update security/netbird/src/opnsense/service/templates/OPNsense/Netbird/netbird Co-authored-by: Franco Fichtner * bump setting model version and use syslog always * Update security/netbird/src/opnsense/service/templates/OPNsense/Netbird/netbird Co-authored-by: Franco Fichtner --------- Co-authored-by: Franco Fichtner --- security/netbird/Makefile | 2 +- .../OPNsense/Netbird/forms/settings.xml | 10 ++++++++++ .../mvc/app/models/OPNsense/Netbird/Settings.xml | 16 +++++++++++++++- .../mvc/app/views/OPNsense/Netbird/settings.volt | 2 +- .../service/templates/OPNsense/Netbird/netbird | 3 +++ 5 files changed, 30 insertions(+), 3 deletions(-) diff --git a/security/netbird/Makefile b/security/netbird/Makefile index ac9352a27..94edc0d4f 100644 --- a/security/netbird/Makefile +++ b/security/netbird/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= netbird -PLUGIN_VERSION= 1.0 +PLUGIN_VERSION= 1.1 PLUGIN_DEPENDS= netbird PLUGIN_COMMENT= Peer-to-peer VPN that seamlessly connects your devices PLUGIN_MAINTAINER= dev@netbird.io diff --git a/security/netbird/src/opnsense/mvc/app/controllers/OPNsense/Netbird/forms/settings.xml b/security/netbird/src/opnsense/mvc/app/controllers/OPNsense/Netbird/forms/settings.xml index 4d9f69bb2..2f5f4224f 100644 --- a/security/netbird/src/opnsense/mvc/app/controllers/OPNsense/Netbird/forms/settings.xml +++ b/security/netbird/src/opnsense/mvc/app/controllers/OPNsense/Netbird/forms/settings.xml @@ -90,4 +90,14 @@ checkbox Enable Rosenpass permissive mode + + header + + + + settings.syslog.logLevel + + dropdown + Set the syslog logging level. Setting a certain log level will cause all messages of the specified and more severe log levels to be logged. + diff --git a/security/netbird/src/opnsense/mvc/app/models/OPNsense/Netbird/Settings.xml b/security/netbird/src/opnsense/mvc/app/models/OPNsense/Netbird/Settings.xml index 0d9fa123c..a99ce9985 100644 --- a/security/netbird/src/opnsense/mvc/app/models/OPNsense/Netbird/Settings.xml +++ b/security/netbird/src/opnsense/mvc/app/models/OPNsense/Netbird/Settings.xml @@ -1,7 +1,7 @@ //OPNsense/netbird/settings NetBird settings - 1.0.0 + 1.1.0 @@ -62,5 +62,19 @@ Y + + + Y + info + + fatal + error + warn + info + debug + trace + + + diff --git a/security/netbird/src/opnsense/mvc/app/views/OPNsense/Netbird/settings.volt b/security/netbird/src/opnsense/mvc/app/views/OPNsense/Netbird/settings.volt index ba255057c..97bb7e39d 100644 --- a/security/netbird/src/opnsense/mvc/app/views/OPNsense/Netbird/settings.volt +++ b/security/netbird/src/opnsense/mvc/app/views/OPNsense/Netbird/settings.volt @@ -54,4 +54,4 @@
{{ partial("layout_partials/base_form",['fields':settingsForm,'id':'frmSettings']) }}
-{{ partial('layout_partials/base_apply_button', {'data_endpoint': '/api/netbird/settings/sync', 'data_service_widget': 'netbird'}) }} +{{ partial('layout_partials/base_apply_button', {'data_endpoint': '/api/netbird/service/reconfigure', 'data_service_widget': 'netbird'}) }} diff --git a/security/netbird/src/opnsense/service/templates/OPNsense/Netbird/netbird b/security/netbird/src/opnsense/service/templates/OPNsense/Netbird/netbird index d4d96d22c..e6191178e 100644 --- a/security/netbird/src/opnsense/service/templates/OPNsense/Netbird/netbird +++ b/security/netbird/src/opnsense/service/templates/OPNsense/Netbird/netbird @@ -1,5 +1,8 @@ {% if OPNsense.netbird.settings.general.enable == '1' %} netbird_enable="YES" +netbird_setup="/usr/local/sbin/pluginctl -c netbird_sync_config" +netbird_logfile="syslog" +netbird_loglevel="{{ OPNsense.netbird.settings.syslog.logLevel }}" {% else %} netbird_enable="NO" {% endif %}