- Issue created by @Anybody
- 🇩🇪Germany Anybody Porta Westfalica
Is it perhaps because redis is used through socket?
I didn't even have the chance to enable redis usage in the settings, as described on the module page.
Any early ideas?
- 🇩🇪Germany jurgenhaas Gottmadingen
You're right, this module assumes that the redis connection is set to a hostname and port. We never thought of sockets being used here. The code can be found
\Drupal\crowdsec\Client::cache
where we build redis dns in line 182:$dns = 'redis://' . ($redis['host'] ?? 'localhost') . ':' . ($redis['port'] ?? '6379');
I'm not sure how the dns would look like with sockets and if the crowdsec even supports that.
Do you know that dns? If so, you could give it a try at that point in the code and see if that works. We would then have to create an MR with a reasonable determination of the dns.
I would have expected that Redis is not used until I enable it?
No, it's expected to work in any case.
- 🇩🇪Germany Anybody Porta Westfalica
Whao, thank you for the superfast reply @jurgenhaas! 🎉
As background information: Since some months, Hetzner has a UI for the Redis caching for managed servers. They only publish the socket and that's the documented way to use it. So I think it would at least be risky to work around that?
The way we use it complies with the redis module. See the background information here: ✨ Allow Socket Connections Needs review
Just some ideas:
Maybe for the future a flexible solution could be to detect the redis module and use it for the connection?Also for now, it would be good enough to be able to switch off the redis integration (or opt-in, as I'd read it from the module page), but honestly I have no idea if that would also be hard to implement.
- 🇩🇪Germany Anybody Porta Westfalica
BTW I just saw that it should be called
dsn
notdns
? Never seen that before... ;D - 🇩🇪Germany Anybody Porta Westfalica
I sadly still don't have an idea how we could at least disable redis support for this case to make the module easily usable, until there's a supported way to use it through socket. If anyone should have good ideas for a general fix or a switch to disable "auto-detection", please leave a note here :)
(Of course it should be straightforward and clean, not a hack)
- 🇩🇪Germany jurgenhaas Gottmadingen
Well, the only next step is to find the syntax for the socket DSN and try that out in code. Once we know that, we can easily support sockets with this module. I don't have Redis over sockets in place, so that should be researched and tested by someone who does.
- 🇩🇪Germany Anybody Porta Westfalica
Thanks @jurgenhaas sorry I understood it's simply not possible that way. I'll try to find it out!
- 🇩🇪Germany Anybody Porta Westfalica
@jurgenhaas sorry had no time yet, I think I won't make it before 2025 - many projects on the finish line... :/ But of course still relevant!
(e.g. for all Hetzner Hostings)
- Status changed to Postponed: needs info
2 days ago 7:56am 14 May 2025