crowdsec: 1.0.9 (fix service start when lapi is disabled) (#3986)

* crowdsec: 1.0.9 (fix service start when lapi is disabled)

* 1.0.9 -> 1.0.8-1
This commit is contained in:
mmetc 2024-05-19 14:38:24 +02:00 committed by GitHub
parent f59fb35e18
commit bb53017521
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 5 deletions

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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 %}