haraka / haraka-plugin-redis

redis support for Haraka plugins
https://www.npmjs.com/package/haraka-plugin-redis
MIT License
3 stars 12 forks source link

Haraka does not seem to accept Redis passwords #19

Closed chlarsen closed 5 years ago

chlarsen commented 5 years ago

system info

Haraka: 2.8.24 Node: 11.13.0 OS: FreeBSD mail 12.0-RELEASE-p3 FreeBSD 12.0-RELEASE-p3 GENERIC amd64 OpenSSL: OpenSSL 1.1.1a-freebsd 20 Nov 2018

Expected behavior

The ability to add the Redis password into the redis connection URI, or to add it via a "password=" stanza

Observed behavior

Passwords do not seem to be accepted at present.

Steps to reproduce

Trying to connect to a password-protected Reids instance using a URI connection string with password fails. Likewise, a "password=[my_redis_password]" entry does not seem to be recognised.

Am I missing something? Thank you

Chris

ad-m commented 5 years ago

Where do you specify password to redis? Which configuration file?

chlarsen commented 5 years ago

On the Redis server side, it is configured in redis.conf:

# requirepass foobared
#requirepass [my_redis_secret]

I would expect that the Redis-enabled plugin *.ini files sport something like this:

[redis]
;host=127.0.0.1
host=broker.jail.vlan
;port=6379
;db=1
db=5
password=[my_redis_secret]

Does this make sense? Thank you! Chris

msimerson commented 5 years ago

The config section [redis] has no meaning to the plugin and would be ignored.

However, if you configured this:

[opts]
password=[my_redis_secret]

then I agree it should work. But it currently only works under limited circumstances. Try copying the updated index.js file from PR #20 into place on your server. Then it should work as you expect. Something like this command will do it:

curl -o /usr/local/lib/node_modules/Haraka/node_modules/haraka-plugin-redis/index.js https://raw.githubusercontent.com/haraka/haraka-plugin-redis/ddc725f3522ae4b265e64db7dd17894b53103529/index.js