actix / examples

Community showcase and examples of Actix Web ecosystem usage.
Apache License 2.0
3.66k stars 804 forks source link

How to access redis with password? #338

Open huiali opened 4 years ago

huiali commented 4 years ago

How to access redis with password?

robjtede commented 4 years ago

AFAIK you may be able to do this:

redis://HOST:PORT?db=0&password=PASSWORD

Source: https://metacpan.org/pod/URI::redis

huiali commented 4 years ago

@robjtede Thank you for your reply. I use Actix redis. No matter how much I try, I can't access redis with a password.

shirshak55 commented 4 years ago

Hmm can u test redis-cli ping and check if u receive pong? and try this redis-cli -h 127.0.0.1 -p 6379 -a 'password' and make sure ur password don't have some weirdness.

huiali commented 4 years ago

I can connect using the redis 0.16 package, but I can't connect with actix-redis no matter how it is set. Does actix-redis not support redis connection with password? @shirshak55 @robjtede

pymongo commented 4 years ago

Send 'AUTH' command to redis server after connect

    let redis = actix_redis::RedisActor::start("redis://localhost:6379");
    // or redis.send(...).await
    redis.do_send(actix_redis::Command(resp_array![
        "AUTH",
        "password"
    ]));

actix-redis use redis-async crate internal

how to connect redis with password #49 - redis-async-rs

zhaoyii commented 3 years ago

How to access redis with password?

I also want to know

OriginalLight commented 2 years ago

I hope to provide a more convenient way to manage the settings of password keys like SpringBoot to configure them in the .env file.

robjtede commented 2 years ago

i expect https://github.com/actix/actix-extras/pull/212 will help with this with the new redis-rs based session backend