diff --git a/security/crowdsec/Makefile b/security/crowdsec/Makefile index ebf2924bb..dad0bf60c 100644 --- a/security/crowdsec/Makefile +++ b/security/crowdsec/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= crowdsec PLUGIN_VERSION= 1.0.8 +PLUGIN_REVISION= 1 PLUGIN_DEPENDS= crowdsec PLUGIN_COMMENT= Lightweight and collaborative security engine PLUGIN_MAINTAINER= marco@crowdsec.net diff --git a/security/crowdsec/pkg-descr b/security/crowdsec/pkg-descr index ef22794a4..abb274e56 100644 --- a/security/crowdsec/pkg-descr +++ b/security/crowdsec/pkg-descr @@ -8,6 +8,10 @@ WWW: https://crowdsec.net/ Plugin Changelog ================ +1.0.8-1 + +* Fix service start when lapi is disabled + 1.0.8 * Enable use_wal, remove warning diff --git a/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.py b/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.py index 84008d625..31fb26643 100755 --- a/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.py +++ b/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.py @@ -53,6 +53,16 @@ def configure_agent(settings): save_config(config_path, config) +def configure_lapi(settings): + config_path = '/usr/local/etc/crowdsec/config.yaml' + config = load_config(config_path) + + enable = int(settings.get('lapi_enabled', '0')) + config['api']['server']['enable'] = bool(enable) + + save_config(config_path, config) + + def configure_lapi_credentials(settings): config_path = '/usr/local/etc/crowdsec/local_api_credentials.yaml' config = load_config(config_path) @@ -88,6 +98,7 @@ def main(): return configure_agent(settings) + configure_lapi(settings) configure_lapi_credentials(settings) configure_bouncer(settings) diff --git a/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/crowdsec.rc.conf.d b/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/crowdsec.rc.conf.d index 77eebf92f..6c0f4e941 100644 --- a/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/crowdsec.rc.conf.d +++ b/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/crowdsec.rc.conf.d @@ -4,8 +4,3 @@ crowdsec_enable="YES" {% else %} crowdsec_enable="NO" {% endif %} -{% if helpers.exists('OPNsense.crowdsec.general.lapi_enabled') and OPNsense.crowdsec.general.lapi_enabled|default("1") == "1" %} -crowdsec_flags="" -{% else %} -crowdsec_flags="-no-api" -{% endif %}