NethServer / dev

NethServer issue tracker
https://github.com/NethServer/dev/issues
63 stars 20 forks source link

Crowdsec looks for redis and not the replica #6902

Closed stephdl closed 2 months ago

stephdl commented 3 months ago

Not really a bug nor a feature request but crowdsec does a request to redis on some scripts that the service triggers in preaction, we should request to the redis replica instead to the main instance of redis that it could be remote and long to answer in the case of cluster

Proposed solution

use rdb = agent.redis_connect(use_replica=True)

Alternative solutions

continue to request to the remote redis instance in case of cluster

stephdl commented 3 months ago

QA

Install crowdsec ghcr.io/nethserver/crowdsec:1.0.7-dev.1 configure a smarthost in the cluster verify in the crowdsec configuration that the event of the smarthost has restarted the crowdsec container wait a few time then you can read the settings cat /var/lib/nethserver/crowdsec1/state/crowdsec_config/notifications/email.yaml

mrmarkuz commented 3 months ago

Test OK! Applying smarthost config restarts crowdsec and the settings are readable afterwards using cat /var/lib/nethserver/crowdsec1/state/crowdsec_config/notifications/email.yaml

DavidePrincipi commented 2 months ago

Released in https://github.com/NethServer/ns8-crowdsec/releases/tag/1.0.7