Skip to content
Open
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 security/netbird/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PLUGIN_NAME= netbird
PLUGIN_VERSION= 1.3
PLUGIN_REVISION= 3
PLUGIN_REVISION= 4
PLUGIN_DEPENDS= netbird
PLUGIN_COMMENT= Peer-to-peer VPN that seamlessly connects your devices
PLUGIN_MAINTAINER= dev@netbird.io
Expand Down
2 changes: 2 additions & 0 deletions security/netbird/pkg-descr
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ Plugin Changelog
* Added IP Mapping option and authentication banner (contributed by Konstantinos Spartalis)
* Fix quantum peer state display (contributed by Konstantinos Spartalis)
* Fix setupKey usage after UpdateOnlyTextField introduction
* Say on the settings page that Apply restarts the daemon and drops the tunnel
* Ask for confirmation before disconnecting NetBird
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@
let message;
let type;
if (!isEnabled) {
message = "Enable NetBird first";
message = "{{ lang._('Enable NetBird first') }}";
type = "warning";
} else {
message = isConnected ? "NetBird is connected" : "NetBird is not connected";
message = isConnected
? "{{ lang._('NetBird is connected') }}"
: "{{ lang._('NetBird is not connected') }}";
type = isConnected ? "info" : "warning";
}

Expand Down Expand Up @@ -91,6 +93,45 @@
});

$("#disconnectBtn").SimpleActionButton({
/*
* One click here takes the tunnel offline, and an admin who reaches
* this firewall through NetBird is on it. SimpleActionButton has no
* confirm of its own; it runs the endpoint when this deferred
* resolves, so rejecting it is how the action is called off.
*/
onPreAction: () => {
const dfObj = new $.Deferred();
BootstrapDialog.show({
type: BootstrapDialog.TYPE_WARNING,
title: "{{ lang._('Disconnect NetBird') }}",
message: "{{ lang._('This takes the tunnel offline. If you are reaching this firewall through NetBird, this session ends here and you will need another way in to reconnect it.') }}",
buttons: [
{
label: "{{ lang._('Cancel') }}",
action: (dialog) => {
/* settle before closing: the onhide below fires on the way out */
dfObj.reject();
dialog.close();
}
},
{
label: "{{ lang._('Disconnect') }}",
cssClass: 'btn-warning',
action: (dialog) => {
dfObj.resolve();
dialog.close();
}
}
],
/* closing any other way - backdrop, escape, the X - is a decision not to
disconnect; a deferred the buttons already settled ignores this */
onhide: () => {
dfObj.reject();
}
});

return dfObj;
},
onAction: () => {
updateServiceControlUI('netbird');
updateNetBirdStatusUI();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,11 @@
<div class="content-box">
{{ partial("layout_partials/base_form",['fields':settingsForm,'id':'frmSettings']) }}
</div>
{{ partial('layout_partials/base_apply_button', {'data_endpoint': '/api/netbird/service/reconfigure', 'data_service_widget': 'netbird'}) }}
{{ partial(
'layout_partials/base_apply_button',
{
'data_endpoint': '/api/netbird/service/reconfigure',
'data_service_widget': 'netbird',
'data_change_message_content': lang._('Apply restarts the NetBird service: the tunnel goes down and comes back up. If you are reaching this firewall through NetBird, you will lose access for a moment, so make sure you have another way in before applying.')
}
) }}