Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis configuration seems not to support UNIX sockets #4318

Closed
shaohme opened this issue Nov 26, 2024 · 2 comments
Closed

Redis configuration seems not to support UNIX sockets #4318

shaohme opened this issue Nov 26, 2024 · 2 comments
Assignees

Comments

@shaohme
Copy link

shaohme commented Nov 26, 2024

Is your feature request related to a problem? Please describe.

Redis configuration seems not to support UNIX sockets. Perhaps it is because the connection parameters (hostname, port, etc) gets appended when creating the connection, instead of parsed differently when UNIX sockets are used. wooga/eredis does support UNIX sockets already according to their site.

Describe the solution you'd like

Have ejabberd use UNIX sockets for Redis, like when configuring sql databases.

Describe alternatives you've considered

I could of course use TCP ports but I already configured everything else to use UNIX sockets so I don't want to open another attack vector 😄

Additional context

  • ejabberd version: 24.10
  • Erlang version: Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 14.2.1
  • OS: Linux (Gentoo)
  • Installed from: distro package
redis_connect_timeout: 5 seconds
redis_db: 9
redis_pool_size: 4
redis_server: unix:/run/redis/redis-server.sock
2024-11-26 08:46:08.705397+00:00 [error] <0.321.0>@ejabberd_redis:connect/1:477 Redis connection #3 at /run/redis/redis-server.sock:6379 has failed: {{badmatch,
                                                                       {error,
                                                                        nxdomain}},
                                                                      [{eredis_client,
                                                                        connect,
                                                                        1,
                                                                        [{file,
                                                                          "src/eredis_client.erl"},
                                                                         {line,
                                                                          304}]},
                                                                       {eredis_client,
                                                                        init,
                                                                        1,
                                                                        [{file,
                                                                          "src/eredis_client.erl"},
                                                                         {line,
                                                                          85}]},
                                                                       {gen_server,
                                                                        init_it,
                                                                        2,
                                                                        [{file,
                                                                          "gen_server.erl"},
                                                                         {line,
                                                                          980}]},
                                                                       {gen_server,
                                                                        init_it,
                                                                        6,
                                                                        [{file,
                                                                          "gen_server.erl"},
                                                                         {line,
                                                                          935}]},
                                                                       {proc_lib,
                                                                        init_p_do_apply,
                                                                        3,
                                                                        [{file,
                                                                          "proc_lib.erl"},
                                                                         {line,
                                                                          241}]}]}; reconnecting in 3 seconds
@badlop
Copy link
Member

badlop commented Dec 5, 2024

I've just added support for that in git master.

It works correctly in my development machine; of course it would be great if you can try it yourself.

@badlop badlop added this to the ejabberd 24.xx milestone Dec 5, 2024
@badlop badlop closed this as completed Dec 16, 2024
@shaohme
Copy link
Author

shaohme commented Dec 16, 2024

Nice. Looking forward to next release 🙂 Sorry for my conservative approach, but I'm simply not skilled enough in Erlang and its build tools yet to test out development code on my server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants