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

Support STUN/TURN service discovery #3235

Merged
merged 6 commits into from
Apr 28, 2020
Merged

Conversation

weiss
Copy link
Member

@weiss weiss commented Apr 24, 2020

Add the mod_stun_disco module, which allows XMPP clients to discover STUN/TURN services and to obtain temporary credentials for using them as per XEP-0215: External Service Discovery. The upcoming A/V support in the Android client Conversations will hard-depend on this server feature, and it's also used by clients such as Movim (and Jitsi Meet, though they currently use an outdated version of XEP-0215).

The format of the temporary credentials handed out to clients is described in an IETF draft. Therefore, the module cannot only be used with ejabberd's built-in STUN/TURN support, but also with external STUN/TURN servers that support the same draft (such as coturn or restund). It also allows (non-XMPP) WebRTC applications to use ejabberd's built-in STUN/TURN support.

This PR doesn't touch existing code except for:

The module is shipped with test cases, has already been tested by several admins, and is running in production on two of the servers I operate myself.

Many thanks to @ChaosKid42, @licaon-kter, @rom1dep and others for testing things and giving very useful feedback.

Closes #2947.

weiss and others added 3 commits April 23, 2020 20:05
Make sure modules won't be reloaded before listeners.  This is necessary
to allow the (not yet committed) 'mod_stun_disco' module to parse the
listener configuration after configuration reloads.
Use the current versions of 'xmpp' (to get XEP-0215 support) and 'stun'
(to fix TURN issues).
@licaon-kter
Copy link
Contributor

Running this for a week for testing Conversations. 👍

@Neustradamus
Copy link
Contributor

@weiss: Thanks for your good job!

The missing important part is IPv6, hope soon too :)

@weiss
Copy link
Member Author

weiss commented Apr 27, 2020

This module can be used just fine with STUN/TURN servers that support IPv6.

Add the 'mod_stun_disco' module, which allows XMPP clients to discover
STUN/TURN services and to obtain temporary credentials for using them as
per XEP-0215: External Service Discovery.  The temporary credentials
handed out to clients have the format described in:

https://tools.ietf.org/html/draft-uberti-behave-turn-rest-00

Also add the new module to the example configuration file.

Closes processone#2947.
These days, STUN/TURN authentication can be performed with ephemeral
credentials, where the REALM is irrelevant. Therefore, just log an
[info] message rather than a [warning] in the case where no
authentication REALM is configured but multiple virtual domains exist.
@jsautret jsautret merged commit 24a11fc into processone:master Apr 28, 2020
@badlop badlop added this to the ejabberd 20.xx milestone Apr 28, 2020
@weiss weiss deleted the xep-0215 branch April 29, 2020 16:02
@badlop badlop modified the milestones: ejabberd 20.xx, ejabberd 20.04 Apr 30, 2020
@ghost
Copy link

ghost commented May 14, 2020

This module work with SCRAM passwords?

@licaon-kter
Copy link
Contributor

licaon-kter commented May 14, 2020

@E-404 No, it generates short time credentials. See the links in the first post,

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

Successfully merging this pull request may close these issues.

External Service Discovery
6 participants