dawarich icon indicating copy to clipboard operation
dawarich copied to clipboard

[Feaure request] Redis authentication

Open shaman007 opened this issue 1 year ago • 3 comments

Redis auth

It's a way needed to provide username/password or just password with enviroment variables like:

REDIS_USER REDIS_PASSWORD

I'd tried

redis://:<secret>@redis-master.redis.svc.cluster.local:6379/10

but this way I cannot render this from the secret storage easily and uniformally around the cluster.

shaman007 avatar Nov 08 '24 14:11 shaman007

would love support for passwords too as I already have a redis instance running (I'm on unraid) that I would love to use instead of spinning up another one

swaggerino avatar Jan 15 '25 17:01 swaggerino

actually it works, you just need to make sure that any special characters in your password are URL escaped (see here https://docs.microfocus.com/OMi/10.62/Content/OMi/ExtGuide/ExtApps/URL_encoding.htm)

then redis://:[pass]@ip:port works just fine

swaggerino avatar Jan 15 '25 19:01 swaggerino

@swaggerino, can you please please please share a working snippet?

shaman007 avatar Jan 15 '25 19:01 shaman007

@swaggerino, can you please please please share a working snippet?

I'm on unraid so YMMW. But all I had to do was edit the env-variable REDIS_URL from redis://[IP]:[PORT] to redis://:[PASSWORD]@[IP]:[PORT] Make sure you don't forget the :before the password and if you have any special characters replace them according to the list in my other comment.

So the string you tried should work unless A) whatever platform you're using handles things differently or B) your password has special characters

swaggerino avatar Jan 16 '25 19:01 swaggerino

Not good enough, I'm on k8s and nested variables not working, so that approach would make me insert secret in the config, which is antipattern.

shaman007 avatar Jan 16 '25 19:01 shaman007