Closed AronNovak closed 1 week ago
@mariano-dagostino Good point!
/**
* Initialize and return the cache backend.
*
* @return \CrowdSec\RemediationEngine\CacheStorage\AbstractCache
* The initialized cache backend.
*/
private function cache(): AbstractCache {
if (!isset($this->cache)) {
if ($redis = Settings::get('redis.connection')) {
$dns = 'redis://' . ($redis['host'] ?? 'localhost') . ':' . ($redis['port'] ?? '6379');
$this->cache = new Redis(['redis_dsn' => $dns], $this->logger);
}
else {
$this->cache = new PhpFiles(['fs_cache_path' => $this->fileSystem->getTempDirectory() . '/crowdsec'], $this->logger);
}
}
return $this->cache;
}
This is from the code of the module. If Redis is configured, it automatically uses that, the doc is misleading in my opinion.
It's serving one of the client sites for a while now. We may consider, at another site, @balagan73 faced with very strange Rollbar errors, if we'd have Crowdsec, we'd have less noise (and more power for visitors)
Added README as well.
https://www.drupal.org/project/crowdsec
For several projects, we picked IPs by hand, as no WAF is available. This is a collective global IP picking automated, round the clock :lock: !