- Issue created by @mandclu
- 🇩🇪Germany jurgenhaas Gottmadingen
The information on the project page is slightly outdated, as no configuration is required any longer. The module now recognizes the best available caching backend. However, it currently still only supports Redis or the file system. Here is how that's being done:
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); }
In order to also support Memcached, I need some help from somebody who's used that with Drupal before. Here are 2 questions:
- How can we recognize that the current Drupal site uses Memcached? As for Redis, this is done by checking for
Settings::get('redis.connection')
.. Is there something similarly available for Memcached? - To initialize the Memcached backend for the CrowdSec library, they need a value for
memcached_dsn
. How would that DSN look like and is that information available from Drupal settings for us to re-use that or do we have to provide some configuration for the site builder to provide that information manually?
- How can we recognize that the current Drupal site uses Memcached? As for Redis, this is done by checking for
- @jurgenhaas opened merge request.
- Status changed to Needs review
almost 2 years ago 8:33am 20 April 2023 - 🇩🇪Germany jurgenhaas Gottmadingen
Thanks to the help from @IT-Cru I've started the memcached support. Just not sure about the exact DNS that is required to communicate with memcached, but hopefully somebody can give this a try and let me know, if anything needs to be adjusted.
It's now implemented such that it looks for the Redis backend first, Memcached second, and if none of them were available, it falls back to the file system.
- 🇩🇪Germany jurgenhaas Gottmadingen
Is anyone still interested in memcache support by the crowdsec module? I'd like to move this forward but need some help with the DSN for the memcach server.
- 🇯🇵Japan ilfelice
Howdy,
I use memcache in our Drupal 10 site, and would like to add the CrowSec module.
What information do you specifically need to move forward? I am not a developer, but I can reply to the extent that I know.