-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
get_auto_url doesn't work with unix sockets #4345
Comments
The syntax is
What is that? Where did you get the idea to add it?
Oops, it should handle that case and give a nice error message, instead of crashing like that. This can be considered a bug in ejabberd.
Notice that get_url and put_url options in mod_http_upload support put_url: "https://@HOST@:5443/upload" Maybe captcha_url should support |
If you're complaining about that double slash, I copied it from the official example https://web.archive.org/web/20250114033310/https://www.process-one.net/blog/ejabberd-23-10/#new-unixsocket-listener-option
From the official example https://github.com/processone/ejabberd/blob/18.06/ejabberd.yml.example#L192 (I see this was removed in 77163c4 but I created my ejabberd configuration in 2015 so it's been here all these 10 years 🙃)
Not in my case, |
Aha, thanks! I've fixed that example to match the syntax described in the documentation.
Wow, I completely forgot that was supported in the past, and it's surprising that it's still supported. I see it emits a warning since several years ago: a02cff0 2025-01-27 13:13:08.050728+01:00 [warning]
Listening option 'register' is deprecated and was automatically
replaced by HTTP request handler: "/register" -> mod_register_web.
Please adjust your configuration file accordingly.
Hint: run `ejabberdctl dump-config` command to view
current configuration as it is seen by ejabberd. Using deprecated options in a recent version reduces legibility of the configuration file, can you follow this and any other recommendations mentioned in the logs? At least if you share that configuration with other people and expect them to read it.
Ohh, ok. In that case it's impossible for If I understand correctly, you are thinking in some way of semi-automated option, right? That would be a new feature... let's imagine how it could be used, and later see what implementation work would require and if it's worth. For example, that example configuration is not supported at all. If this were supported, would it be useful for your case? hosts:
- andreymal.org
- example.org
define_macro:
HOST_NGINX: "xmpp.andreymal.org"
modules:
mod_http_upload:
put_url: "https://@HOST_NGINX@/upload"
get_url: "https://@HOST_NGINX@/files"
captcha_url: "https://@HOST_NGINX@/captcha" |
My primary goal is to get the unix socket working, setting the base url is more of a “nice to have” to reduce duplication in the config, but this is not really important to me In fact, my ejabberd configuration is generated by Ansible, and the source looks like But I think your idea might be useful for other users who don't use Ansible
Good point, I removed |
I'm not sure if I should create a separate issue, but it seems like the unix socket isn't working at all. For example, I tried to set up a jabber server in the onion network with the following configuration: $ cat /etc/tor/torrc
$ cat /etc/ejabberd/ejabberd.yml
The jabber client is configured to use the tor proxy (of course), but the connection doesn't work, and there are no attempts in the logs. I tried experimenting with the unix_socket option (which, by the way, has no documentation, only a mention in the changelog, which is strange lol). These experiments didn't lead to any result. |
Interesting, I see (when using |
Yeah, I also noticed that the file is not created if a path other than /var/lib/ejabberd/socket/ is specified. If I specify it directly as port: "unix:/var/lib/ejabberd/socket/abc.sock", then the "abc.sock" file is created, but still nothing works. And no, nothing has been fixed in the newer versions. I'm using Arch Linux for this set up, so I have the latest version. |
I’ve gone really deep into this... problem, played around with the systemd service file, changed the caps - nothing helps. Honestly, I’m starting to get pretty frustrated with this :) |
Here is a 99% default service file that comes with the package in Arch Linux. The only change I made in this case is removing AmbientCapabilities=CAP_NET_BIND_SERVICE, as it is simply not needed in the context of unix socket. $ cat /lib/systemd/system/ejabberd.service
|
So, dear developers, will there be any investigation, clarifying questions, etc.? |
Not sure if this is a bug report or a feature request, but after upgrading to Ubuntu 24.04 and ejabberd 23.10 I tried to use a unix socket with
ejabberd_http
because it is behind nginx and there is no point in using TCP:Unfortunately, this doesn't work:
I see two
get_auto_url
functions in the ejabberd code, both requirePort
to be an integer:ejabberd/src/ejabberd_captcha.erl
Line 516 in a19ab9f
ejabberd/src/mod_host_meta.erl
Line 161 in a19ab9f
Is it technically possible to refactor
get_auto_url
so that I manually set the base url so that it no longer tries to interpretPort
as an integer?I already did this for captcha and http upload, but it would be nice to configure the whole
ejabberd_http
module.The text was updated successfully, but these errors were encountered: