[ejabberd] multiple hosts/passwords on external component

Raoul Duke rduke496 at gmail.com
Sat Apr 9 21:31:41 MSK 2016


Hi,

I'm trying to configure an external component (jitsi videobridge) and
specifically to replicate a working confliguration from prosody, namely:

Component "jitsi-videobridge.myhost.com"
    component_secret = "ABCDEF"

Component "focus.myhost.com"
    component_secret = "QWERTY"

based on the example here:
https://github.com/processone/ejabberd/blob/master/ejabberd.yml.example#L142

I came up with:

    port: 5347
    module: ejabberd_service
    access: all
    hosts:
      "jitsi-videobridge.myhost.com":
        password: "ABCDEF"
      "focus.myhost.com":
        password: "QWERTY"

I had multiple problems with this config:

* I couldn't auth the second component name (focus.myhost.com) with the
associated password no matter what I tried (even using a standalone utility
to check the auth only).  I ended up having to use the same password for
both to get auth to work.

Having looked at the code for ejabberd_service.erl
https://github.com/processone/ejabberd/blob/master/src/ejabberd_service.erl#L51

it looks like the state record has a list of hosts mapped to one password.
 so I'm not sure how that implementation fits with the example config I
referenced (
https://github.com/processone/ejabberd/blob/master/ejabberd.yml.example#L142
).

i.e. there doesn't seem to be a "password per host" concept there.  it just
seems there is a "multi hosts to single pasword".

am I (as I expect) just missing something obvious here?

* with the config as above (but both hosts having the same password) I then
had problems with the clients of the 2 distinct components (both with
distinct TCP connections to port 5347) seeming to get "crossed wires" in
their responses i.e. ping response from one stream seeming to go to the
other stream.  this reinforces my sense that I've just misunderstood /
messed-up the config somehow.

what I ended up doing to get it functional was to put the 2 hosts on
distinct ports, i.e.

    port: 5347
    module: ejabberd_service
    access: all
    hosts:
      "jitsi-videobridge.myhost.com":
        password: "ABCDEF"

    port: 5348
    module: ejabberd_service
    access: all
    hosts:
      "focus.myhost.com":
        password: "QWERTY"

while I don't see any particular downsides to this approach (but if you do
then please enlighten me) is there a way I can do it as per the docs?

Any clariifcation / help would be much appreciated.

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20160409/cba1f552/attachment.html>


More information about the ejabberd mailing list