Disabling pubsub discovery

Is it possible to disable support for discovery at the pubsub service level? I was able to disable discovery at the top level by commenting out mod_caps and mod_disco from the modules section (now querying for disco#info and disco#items at the root level (hostname.com) returns feature-not-implemented), but arbitrary users can still get a response to disco#info and disco#items when querying the pubsub level (pubsub.hostname.com).

My goal is not to provide any sort of discovery at all. Users must know a priori the names of the nodes they're interested in subscribing to. Ideally, users would also be forbidden from retrieving information about nodes they're not whitelisted to access.

Thanks!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

ondrej wrote: Is it possible

ondrej wrote:

Is it possible to disable support for discovery at the pubsub service level?

Yes. In the file src/mod_pubsub/mod_pubsub.erl remove the lines:

ejabberd_hooks:add(disco_sm_identity, ServerHost, ?MODULE, disco_sm_identity, 75),
ejabberd_hooks:add(disco_sm_features, ServerHost, ?MODULE, disco_sm_features, 75),
ejabberd_hooks:add(disco_sm_items, ServerHost, ?MODULE, disco_sm_items, 75),

Then compile, install and restart ejabberd.

Syndicate content