From 7bbd4557995c77f6668c8b5f97401a98a634f005 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 22 Jan 2025 08:26:30 +0100 Subject: [PATCH] net/relayd: sync with master --- net/relayd/Makefile | 1 + .../OPNsense/Relayd/Api/ServiceController.php | 2 - .../Relayd/Api/SettingsController.php | 1 - .../OPNsense/Relayd/Api/StatusController.php | 5 +- .../mvc/app/views/OPNsense/Relayd/index.volt | 54 +++++++++---------- 5 files changed, 30 insertions(+), 33 deletions(-) diff --git a/net/relayd/Makefile b/net/relayd/Makefile index bb65570d6..9abfcd222 100644 --- a/net/relayd/Makefile +++ b/net/relayd/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= relayd PLUGIN_VERSION= 2.9 +PLUGIN_REVISION= 1 PLUGIN_DEPENDS= relayd PLUGIN_COMMENT= Relayd Load Balancer PLUGIN_MAINTAINER= frank.brendel@eurolog.com diff --git a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/ServiceController.php b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/ServiceController.php index 83eda0132..0bffec3e7 100644 --- a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/ServiceController.php +++ b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/ServiceController.php @@ -71,7 +71,6 @@ class ServiceController extends ApiMutableServiceControllerBase { if ($this->request->isPost()) { $result['status'] = 'ok'; - $this->sessionClose(); $backend = new Backend(); @@ -96,7 +95,6 @@ class ServiceController extends ApiMutableServiceControllerBase { if ($this->request->isPost()) { if ($this->lock()) { - $this->sessionClose(); $result['function'] = "reconfigure"; $result['status'] = 'failed'; $backend = new Backend(); diff --git a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php index 3b8a11437..f8cac66f1 100644 --- a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php +++ b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php @@ -240,7 +240,6 @@ class SettingsController extends ApiMutableModelControllerBase */ public function searchAction($nodeType = null) { - $this->sessionClose(); if ($this->request->isPost() && $nodeType != null) { $this->validateNodeType($nodeType); $grid = new UIModelGrid($this->getModel()->$nodeType); diff --git a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/StatusController.php b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/StatusController.php index 879bd2211..d2a8b0d5d 100644 --- a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/StatusController.php +++ b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/StatusController.php @@ -202,7 +202,6 @@ class StatusController extends ApiControllerBase { $result = ["result" => "failed", "function" => "toggle"]; if ($this->request->isPost()) { - $this->sessionClose(); $backend = new Backend(); if (in_array($nodeType, ['redirect', 'table', 'host']) && in_array($action, ['enable', 'disable'])) { if ($id != null && $id > 0) { @@ -225,7 +224,9 @@ class StatusController extends ApiControllerBase $relaydMdl->serializeToConfig(); Config::getInstance()->save(); // invoke service controller - return (new ServiceController())->reconfigureAction(); + $srv = new ServiceController(); + $srv->request = $this->request; + return $srv->reconfigureAction(); } } return $result; diff --git a/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/index.volt b/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/index.volt index 8c96a0ec3..11a7e3e0c 100644 --- a/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/index.volt +++ b/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/index.volt @@ -1,31 +1,29 @@ {# - -Copyright © 2018 by EURO-LOG AG -Copyright (c) 2021 Deciso B.V. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation -and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -#} + # Copyright (c) 2018 EURO-LOG AG + # Copyright (c) 2021 Deciso B.V. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without modification, + # are permitted provided that the following conditions are met: + # + # 1. Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # + # 2. Redistributions in binary form must reproduce the above copyright notice, + # this list of conditions and the following disclaimer in the documentation + # and/or other materials provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + #}