From 8756e7c807bf3abb600de41269c58a875adc5bab Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 12 Mar 2021 14:34:24 +0100 Subject: [PATCH 1/3] net/haproxy: only accept a single value for backend/server fields, refs #2266 When Multiple=Y is set, then backend/server fields are preselected. This makes it impossible to remove backends/servers, even when the rule does not actually use them. --- net/haproxy/pkg-descr | 5 +++++ .../src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 4e83fe306..86fcbd003 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -6,6 +6,11 @@ very high loads while needing persistence or Layer7 processing. Plugin Changelog ================ +3.1 + +Changed: +* rules: only accept a single value for backend/server fields (#2266) + 3.0 Added: diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 8c172b6cf..3beabcd33 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -2086,7 +2086,7 @@ Related backend item not found - Y + N N @@ -2098,7 +2098,7 @@ Related server item not found - Y + N N From 56ca1c517d57308be07b203723cd5a6147484ed9 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 14 Mar 2021 22:41:22 +0100 Subject: [PATCH 2/3] net/haproxy: add migration to fix undeletable items, fixes #2266 --- .../app/models/OPNsense/HAProxy/HAProxy.xml | 2 +- .../OPNsense/HAProxy/Migrations/M3_1_0.php | 55 +++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Migrations/M3_1_0.php diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 3beabcd33..58ac8e28e 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -1,6 +1,6 @@ //OPNsense/HAProxy - 3.0.0 + 3.1.0 the HAProxy load balancer diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Migrations/M3_1_0.php b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Migrations/M3_1_0.php new file mode 100644 index 000000000..a41024c00 --- /dev/null +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Migrations/M3_1_0.php @@ -0,0 +1,55 @@ +getNodeByReference('actions.action')->iterateItems() as $action) { + switch ((string)$action->type) { + case 'use_backend': + // do nothing, keep the value + break; + case 'use_server': + // do nothing, keep the value + break; + default: + // Clear referenced items if they are not in use. + $action->use_backend = null; + $action->use_server = null; + break; + } + } + } +} From f6b4c1899a0211129f0b17cb2e14284024f1847b Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 14 Mar 2021 22:44:51 +0100 Subject: [PATCH 3/3] net/haproxy: bump version --- net/haproxy/Makefile | 2 +- net/haproxy/pkg-descr | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index fa8508ba7..c2f195fc2 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= haproxy -PLUGIN_VERSION= 3.0 +PLUGIN_VERSION= 3.1 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy PLUGIN_MAINTAINER= opnsense@moov.de diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 86fcbd003..69ef2148a 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -8,6 +8,9 @@ Plugin Changelog 3.1 +Fixed: +* fix items that cannot be deleted (#2266) + Changed: * rules: only accept a single value for backend/server fields (#2266)