From ad13c93a5e69585c2fff1b6c140aa7591e07268c Mon Sep 17 00:00:00 2001 From: sabban Date: Wed, 5 Aug 2026 13:37:45 +0200 Subject: [PATCH 1/2] fix issue https://github.com/opnsense/plugins/issues/5587 --- security/crowdsec/Makefile | 2 +- .../scripts/OPNsense/CrowdSec/reconfigure.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/security/crowdsec/Makefile b/security/crowdsec/Makefile index 1d6d54f333..3c1ef1e220 100644 --- a/security/crowdsec/Makefile +++ b/security/crowdsec/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= crowdsec -PLUGIN_VERSION= 1.0.12 +PLUGIN_VERSION= 1.0.13 PLUGIN_DEPENDS= crowdsec PLUGIN_COMMENT= Lightweight and collaborative security engine PLUGIN_MAINTAINER= marco@crowdsec.net diff --git a/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.py b/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.py index 6d4869c5b9..a90264a9b0 100755 --- a/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.py +++ b/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.py @@ -36,9 +36,19 @@ def get_netloc(settings: dict[str, str]): return '{}:{}'.format(listen_address, listen_port) +def get_client_netloc(settings: dict[str, str]): + settings = settings.copy() + listen_address = settings.get('lapi_listen_address', '127.0.0.1') + if listen_address == '0.0.0.0': + settings['lapi_listen_address'] = '127.0.0.1' + elif listen_address == '::': + settings['lapi_listen_address'] = '::1' + return get_netloc(settings) + + def get_new_url(old_url: str, settings: dict[str, str]): old_tuple = urllib.parse.urlsplit(old_url) - new_tuple = old_tuple._replace(netloc=get_netloc(settings)) + new_tuple = old_tuple._replace(netloc=get_client_netloc(settings)) new_url = urllib.parse.urlunsplit(new_tuple) # client lapi requires a trailing slash for the path part # and no, query and fragment don't make much sense From 333e1c5014c9d3759db23aaa3a8e1f134143205d Mon Sep 17 00:00:00 2001 From: sabban Date: Wed, 5 Aug 2026 17:27:44 +0200 Subject: [PATCH 2/2] update maintainer --- security/crowdsec/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/crowdsec/Makefile b/security/crowdsec/Makefile index 3c1ef1e220..9dc2734e7f 100644 --- a/security/crowdsec/Makefile +++ b/security/crowdsec/Makefile @@ -2,7 +2,7 @@ PLUGIN_NAME= crowdsec PLUGIN_VERSION= 1.0.13 PLUGIN_DEPENDS= crowdsec PLUGIN_COMMENT= Lightweight and collaborative security engine -PLUGIN_MAINTAINER= marco@crowdsec.net +PLUGIN_MAINTAINER= manuel@crowdsec.net PLUGIN_WWW= https://crowdsec.net/ .include "../../Mk/plugins.mk"