Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion netbird/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PORTNAME= netbird
DISTVERSIONPREFIX= v
DISTVERSION= 0.49.0
DISTVERSION= 0.51.1
CATEGORIES= security net net-vpn

MAINTAINER= [email protected]
Expand Down
13 changes: 8 additions & 5 deletions pfSense-pkg-NetBird/files/usr/local/pkg/netbird/netbird.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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));
Expand Down