diff --git a/netbird/Makefile b/netbird/Makefile index 4d01611..9e6664c 100644 --- a/netbird/Makefile +++ b/netbird/Makefile @@ -1,6 +1,6 @@ PORTNAME= netbird DISTVERSIONPREFIX= v -DISTVERSION= 0.49.0 +DISTVERSION= 0.51.1 CATEGORIES= security net net-vpn MAINTAINER= hakan.external@netbird.io diff --git a/pfSense-pkg-NetBird/files/usr/local/pkg/netbird/netbird.inc b/pfSense-pkg-NetBird/files/usr/local/pkg/netbird/netbird.inc index 0e3b994..e0720f4 100644 --- a/pfSense-pkg-NetBird/files/usr/local/pkg/netbird/netbird.inc +++ b/pfSense-pkg-NetBird/files/usr/local/pkg/netbird/netbird.inc @@ -38,8 +38,9 @@ function netbird_resync_config() return; } - if (!empty($_POST['wireguardport'])) { - $config['WgPort'] = (int)$_POST['wireguardport']; + $settings = config_get_path('installedpackages/netbird/config/0', []); + if (!empty($settings['wireguardport'])) { + $config['WgPort'] = (int)$settings['wireguardport']; } $config_map = [ @@ -54,9 +55,11 @@ function netbird_resync_config() 'rosenpasspermissive' => ['RosenpassPermissive', true], ]; - foreach ($config_map as $post_key => [$json_key, $enabled_val]) { - $checked = ($_POST[$post_key] ?? '') === 'on'; - $config[$json_key] = ($checked === $enabled_val); + foreach ($config_map as $key => [$json_key, $enabled_val]) { + if (array_key_exists($key, $settings)) { + $checked = $settings[$key] === 'on'; + $config[$json_key] = ($checked === $enabled_val); + } } file_put_contents(NETBIRD_CONFIG, json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));