Git Product home page Git Product logo

Comments (18)

ad-m avatar ad-m commented on August 22, 2024

What do you mena by redis.ini? There is a few seperate Redis configuration: https://github.com/haraka/Haraka/search?q=redis+path%3Aconfig%2F&unscoped_q=redis+path%3Aconfig%2F&type=Code

from haraka-plugin-redis.

chlarsen avatar chlarsen commented on August 22, 2024

In haraka-plugin-redis/README.md, oit says:

The `redis.ini` file has the following sections (defaults shown):

### [server]

    ; host=127.0.0.1
    ; port=6379
    ; db=0

### [pubsub]

    ; host=127.0.0.1
    ; port=6379

Publish & Subscribe are DB agnostic and thus have no db setting. If host and port and not defined, they default to the same as [server] settings.

This is what I am referring to. My redis.ini looks like this:

[server]
;host=127.0.0.1
host=broker.jail.vlan
;port=6379
; presently, the haraka redis db is hardcoded to 0
;db=0
`````
See my comment above :-).
I do realise that the other plugins use other Redis databases, and they can be configured, indeed.
Seems I am misunderstanding the README.md, but how to read it then?
Thank you!
Chris

from haraka-plugin-redis.

msimerson avatar msimerson commented on August 22, 2024

With this config, you still haven't specified a db. If you remove the comment character ; from in front of the db line (as shown below), it might work more like you expect.

[server]
host=broker.jail.vlan
db=5

from haraka-plugin-redis.

chlarsen avatar chlarsen commented on August 22, 2024

Isn't the rule of configuration that defaults are taken from the, well, default config, and user *.ini files are only used to OVERRIDE defaults? When I state a different database, nothing happens; db 0 is still used. This is the issue here, at least from my end.

from haraka-plugin-redis.

msimerson avatar msimerson commented on August 22, 2024

Isn't the rule of configuration that defaults are taken from the, well, default config,

Yes. In this case, there isn't a default redis.ini file. The defaults are set inside the plugin.

used to OVERRIDE defaults

Yes.

When I state a different database, nothing happens;

Well then, presuming your have your db line NOT commented out (contrary to what you showed above), then that's a bug. Your settings are supposed to be honored.

from haraka-plugin-redis.

chlarsen avatar chlarsen commented on August 22, 2024

Yep, this is what I have been trying to point out :-).
I set, for instance: db=10
An get: [INFO] [-] [redis] connected to redis://broker.jail.vlan:6379
No db is stated, and Redis tells me that db 0 is used.

from haraka-plugin-redis.

msimerson avatar msimerson commented on August 22, 2024

I think I see the problem. Try setting db=10 in the [opts] section.

from haraka-plugin-redis.

msimerson avatar msimerson commented on August 22, 2024

PS: there's no hard coding anywhere. It's just that your config setting wasn't getting passed so you got the redis default db.

from haraka-plugin-redis.

chlarsen avatar chlarsen commented on August 22, 2024

I tried it, but may not have set the [opts] section properly. Would you mind spinning an example with the right sections for redis.ini? Thank you!

from haraka-plugin-redis.

msimerson avatar msimerson commented on August 22, 2024

There's one included in PR #20.

here

from haraka-plugin-redis.

chlarsen avatar chlarsen commented on August 22, 2024

Thank you! This worked for the redis.ini config file, both for the localised db number, as well as the addition of a password. However, I seem to be out of luck, when I want to add the same password value to the redis stanzas for limits, karma, etc. [opts] does not do the trick, keeping in mind that localised database numbers DO work for those sub-config files.

from haraka-plugin-redis.

chlarsen avatar chlarsen commented on August 22, 2024

Allow me to add that dnsbl.ini does not seem to have an configuration settings for redis except host and port; [opts] does not seem to work there?

from haraka-plugin-redis.

msimerson avatar msimerson commented on August 22, 2024

In plugins, put all the options in the [redis] block. Example:

karma.ini

; other stuff
[redis]
host=redis.example.com
db=6
password=SeriouslyYou'reUsingThis?

That should work.

from haraka-plugin-redis.

chlarsen avatar chlarsen commented on August 22, 2024

I finally had time to test this. I think the stumbling block is the dnsbl module with history enabled. The Redis server config syntax there is a bit different from the rest of the Redis-enabled modules, and I do not seem to get the Redis password across, neither using [redis] nor [opts].
Thank you!

from haraka-plugin-redis.

msimerson avatar msimerson commented on August 22, 2024

The DNSBL module(s) predate the redis plugin by quite a long time and it hasn't been updated. It likely just needs to be retrofitted with the shared calls the other "redis using" plugins load.

from haraka-plugin-redis.

chlarsen avatar chlarsen commented on August 22, 2024

Yes, this was my feeling, too. Can we leave it on our (sic!) ToDo list, so it won't be forgotten?

from haraka-plugin-redis.

msimerson avatar msimerson commented on August 22, 2024

That's why it's a wiki, anyone can add to it. Better yet, a PR is welcome.

from haraka-plugin-redis.

chlarsen avatar chlarsen commented on August 22, 2024

Exactly :-D.
Thanks a lot and enjoy your weekend.

from haraka-plugin-redis.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.