mirror of
https://github.com/opnsense/plugins.git
synced 2026-06-09 08:56:23 -04:00
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:
parent
f59fb35e18
commit
bb53017521
4 changed files with 16 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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 %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue