mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
net/netbird: use "OPNsense.Netbird" where possible
Not changing the config.xml mountpoint.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
PLUGIN_NAME= netbird
|
||||
PLUGIN_VERSION= 0.1
|
||||
PLUGIN_DEPENDS= netbird
|
||||
PLUGIN_DEPENDS= netbird
|
||||
PLUGIN_COMMENT= Peer-to-peer VPN that seamlessly connects your devices
|
||||
PLUGIN_MAINTAINER= opn-netbird@sun-ri.se
|
||||
PLUGIN_WWW= https://netbird.io
|
||||
PLUGIN_DEVEL= yes
|
||||
PLUGIN_WWW= https://netbird.io
|
||||
PLUGIN_DEVEL= yes
|
||||
|
||||
.include "../../Mk/plugins.mk"
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
function netbird_enabled()
|
||||
{
|
||||
return !(new \OPNsense\netbird\Netbird())->general->Enabled->isEmpty();
|
||||
return !(new \OPNsense\Netbird\Netbird())->general->Enabled->isEmpty();
|
||||
}
|
||||
|
||||
function netbird_services()
|
||||
|
||||
@@ -33,17 +33,13 @@ require_once('util.inc');
|
||||
require_once('interfaces.inc');
|
||||
|
||||
|
||||
$model = new \OPNsense\netbird\Netbird();
|
||||
$enabled = $model->general->Enabled->__toString();
|
||||
$model = new \OPNsense\Netbird\Netbird();
|
||||
|
||||
|
||||
if(!$enabled) {
|
||||
if ($model->general->Enabled->isEmpty()) {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$carpif = $model->general->CarpIf->__toString();
|
||||
|
||||
if($carpif == '') {
|
||||
if (!$model->general->CarpIf->isEqual('')) {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -28,16 +28,16 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
namespace OPNsense\netbird\Api;
|
||||
namespace OPNsense\Netbird\Api;
|
||||
|
||||
use OPNsense\Base\ApiMutableModelControllerBase;
|
||||
|
||||
/**
|
||||
* netbird settings controller
|
||||
* @package OPNsense\netbird
|
||||
* @package OPNsense\Netbird
|
||||
*/
|
||||
class InitialController extends ApiMutableModelControllerBase
|
||||
{
|
||||
protected static $internalModelName = 'netbird';
|
||||
protected static $internalModelClass = 'OPNsense\netbird\Initial';
|
||||
protected static $internalModelClass = 'OPNsense\Netbird\Initial';
|
||||
}
|
||||
+7
-7
@@ -28,24 +28,24 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
namespace OPNsense\netbird\Api;
|
||||
namespace OPNsense\Netbird\Api;
|
||||
|
||||
use OPNsense\Base\ApiMutableServiceControllerBase;
|
||||
use OPNsense\Core\Backend;
|
||||
use OPNsense\Core\Config;
|
||||
use OPNsense\netbird\Initial;
|
||||
use OPNsense\netbird\Netbird;
|
||||
use OPNsense\Netbird\Initial;
|
||||
use OPNsense\Netbird\Netbird;
|
||||
|
||||
/**
|
||||
* Class ServiceController
|
||||
* @package OPNsense\netbird
|
||||
* @package OPNsense\Netbird
|
||||
*/
|
||||
class ServiceController extends ApiMutableServiceControllerBase
|
||||
{
|
||||
const NETBIRD_CONFIG_JSON = '/usr/local/etc/netbird/config.json';
|
||||
protected static $internalServiceClass = '\OPNsense\netbird\Netbird';
|
||||
protected static $internalServiceClass = '\OPNsense\Netbird\Netbird';
|
||||
protected static $internalServiceEnabled = 'general.Enabled';
|
||||
protected static $internalServiceTemplate = 'OPNsense/netbird';
|
||||
protected static $internalServiceTemplate = 'OPNsense/Netbird';
|
||||
protected static $internalServiceName = 'netbird';
|
||||
|
||||
public function conStatusAction(): string
|
||||
@@ -206,7 +206,7 @@ class ServiceController extends ApiMutableServiceControllerBase
|
||||
try {
|
||||
$mdlNetbird = new Netbird();
|
||||
$backend = new Backend();
|
||||
if (trim($backend->configdRun('template reload OPNsense/netbird')) == "OK") {
|
||||
if (trim($backend->configdRun('template reload OPNsense/Netbird')) == "OK") {
|
||||
$status = "ok";
|
||||
}
|
||||
|
||||
+4
-4
@@ -28,16 +28,16 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
namespace OPNsense\netbird\Api;
|
||||
namespace OPNsense\Netbird\Api;
|
||||
|
||||
use OPNsense\Base\ApiMutableModelControllerBase;
|
||||
|
||||
/**
|
||||
* netbird settings controller
|
||||
* @package OPNsense\netbird
|
||||
* Netbird settings controller
|
||||
* @package OPNsense\Netbird
|
||||
*/
|
||||
class SettingsController extends ApiMutableModelControllerBase
|
||||
{
|
||||
protected static $internalModelName = 'netbird';
|
||||
protected static $internalModelClass = 'OPNsense\netbird\Netbird';
|
||||
protected static $internalModelClass = 'OPNsense\Netbird\Netbird';
|
||||
}
|
||||
+3
-3
@@ -28,16 +28,16 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
namespace OPNsense\netbird;
|
||||
namespace OPNsense\Netbird;
|
||||
|
||||
/**
|
||||
* Class ConstatusController
|
||||
* @package OPNsense\netbird
|
||||
* @package OPNsense\Netbird
|
||||
*/
|
||||
class ConstatusController extends \OPNsense\Base\IndexController
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$this->view->pick('OPNsense/netbird/constatus');
|
||||
$this->view->pick('OPNsense/Netbird/constatus');
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -28,18 +28,18 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
namespace OPNsense\netbird;
|
||||
namespace OPNsense\Netbird;
|
||||
|
||||
/**
|
||||
* Class IndexController
|
||||
* @package OPNsense\netbird
|
||||
* @package OPNsense\Netbird
|
||||
*/
|
||||
class IndexController extends \OPNsense\Base\IndexController
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$this->view->generalForm = $this->getForm("general");
|
||||
$this->view->initialUpForm = $this->getForm("initialup");
|
||||
$this->view->pick('OPNsense/netbird/index');
|
||||
$this->view->generalForm = $this->getForm('general');
|
||||
$this->view->initialUpForm = $this->getForm('initialup');
|
||||
$this->view->pick('OPNsense/Netbird/index');
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
namespace OPNsense\netbird;
|
||||
namespace OPNsense\Netbird;
|
||||
|
||||
use OPNsense\Base\BaseModel;
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
namespace OPNsense\netbird;
|
||||
namespace OPNsense\Netbird;
|
||||
|
||||
use OPNsense\Base\BaseModel;
|
||||
|
||||
@@ -34,7 +34,7 @@ type:script
|
||||
message:set netbird up
|
||||
|
||||
[set-up-initial]
|
||||
command:/usr/local/opnsense/scripts/OPNsense/netbird/initialup.sh
|
||||
command:/usr/local/opnsense/scripts/OPNsense/Netbird/initialup.sh
|
||||
parameters: -m %s -k %s -n %s
|
||||
type:script_output
|
||||
message:setup netbird
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user