Single Pubsub endpoint for multiple auth_methods

Hi

I wanted to include anonymous authentication along with global default, which I achieved by configuring host specific auth_method.
But, as a result of this, now I have 2 different pubsub service endpoints, viz.:
pubsub.private.domain.com (Default)
pubsub.public.domain.com (Anonymous)

I need to use same pubsub service endpoint throughout, and so how can this be achieved.

If I could get the configuration for this setup, that would be great.

Thanks.

I guess you have something

I guess you have something like this:

hosts:
  - "private.domain.com"
  - "public.domain.com"

I guess the best way (and I hope it works correctly) is to create two different modules sections, one with mod_pubsub, and the other with a disco that redirects to the first pubsub service:

host_config:
  "private.domain.com":
    modules:
      ...
      mod_disco: {}
      mod_pubsub:
        host: "pubsub.private.domain.com"

host_config:
  "public.domain.com":
    modules:
      ...
      mod_disco:
        extra_domains:
          - "pubsub.private.domain.com"

Hi, As always thank you for

Hi,

As always thank you for promptly addressing the query.
As already mentioned, I have created host_config only for public.domain.com and for private it assumes global module-wise config, the config which I have been using till now.
You have already recommended to create 2 different modules sections. Does that mean, to only define specific modules in either host configs(private/public) which would override global config? And for the rest, global module configs would be used? Should be obvious, but would like to confirm.

And also I am not sure about the need to configure mod_disco in this case, if you can please shed some light. As it is working without configuring mod_disco, so could it be something that I am missing from a bigger picture.

Thank you,
Prasad

Your question is a good

Your question is a good point: if you define an option in host_config, it overrides the global one. This means that defining modules in host_config will override the global modules for that host.

Better to use append_host_config instead, so you can have a global common modules, and then append a few modules with different options for each host. See https://docs.ejabberd.im/admin/guide/configuration/#virtual-hosting

mod_disco with extra_domains option is just to show that service from private server in the Service Discovery of the public server. I think it's required, but maybe clients are clever enough to not need it...

Syndicate content