Skip to main content

Setting Up the XMPP Bridge

Configuring the XMPP Bridge

The XMPP bridge relies on the xmpp "component" feature. It is an equivalent of matrix application services. You need to configure an XMPP Component on an XMPP Server that the bridge will use to bridge matrix and xmpp user.

On the hosting machine

From the Installer's Integrations page, click "Install" under "XMPP Bridge".

For the provided xmpp.yml, please use the following documentation to configure the bridge:

  • xmpp_service: XMPP Address of the service endpoint.

  • xmpp_domain: The XMPP FQDN with the External Component subdomain (i.e. element.xmpp.example.com)

  • bot_username: The xmpp bot username on matrix

  • alias_prefix: The prefix for bridged aliases

  • user_prefix: The prefix for bridged users

  • enable_portals_gateway: true to enable portals.

  • xmpp_component_password: Xmpp component password

  • postgres_create_in_cluster: true if you want the installer to automatically set up postgres. Requires postgres_data_path if using this.

  • postgres_fqdn: PostgreSQL server fqdn or ip

  • postgres_user: PostgreSQL username

  • postgres_db: PostgreSQL database

  • postgres_port: PostgreSQL port, default to 5432

  • postgres_password: PostgreSQL password

  • postgres_create_in_cluster: Whether or not to create the postgres as a k8s statefulset

  • Re-run the installer

Examples

In all the examples below the following are set:

  • The domain_name is your homeserver domain ( the part after : in your MXID ) : element.localexample.com
  • XMPP Server FQDN: xmpp.example.com
  • XMPP External Component/xmpp_domain: element.matrix.xmpp.example.com

Prosody Example

If you are configuring prosody, you need the following component configuration (for the sample xmpp server, element.matrix.xmpp.example.com):

    Component "element.matrix.xmpp.example.com"
        ssl = {
          certificate = "/etc/prosody/certs/tls.crt";
          key = "/etc/prosody/certs/tls.key";
        }
      component_secret = "eeb8choosaim3oothaeGh0aequiop4ji"

And then with that configured, you would pass the following into xmpp.yml:

xmpp_service: xmpp://xmpp.example.com:5347
xmpp_domain: "element.matrix.xmpp.example.com" # external component subdomain
xmpp_component_password: eeb8choosaim3oothaeGh0aequiop4ji # xmpp component password

Note: We've used pwgen 32 1 to generate the component_secret.

Joining an XMPP Room

Once you have the XMPP bridge up, you need to map an XMPP room to a Matrix ID. For example, if the room on XMPP is named: #iwotevo@conference.#welcome@conference.xmpp.lab.element.example.com

,

(where conference is the fqdnFQDN of the component'scomponent hosting rooms onfor ouryour xmppXMPP testinstance, instance)

then on Matrix, you would join:

#_xmpp_iwotevo_conference.#_xmpp_welcome_conference.xmpp.example.com:element.localexample.com

TheSo you can simply send the following command toin do that from within theyour Element client wouldto be:jump (assuminginto yourthe homeserverXMPP domainroom isvia example.com)Matrix

/join #_xmpp_iwotevo_conference.#_xmpp_welcome_conference.xmpp.example.com:element.localexample.com

Joining a Matrix room from XMPP

If the Element/Matrix room is public you should be able to query the room list at the external component server address(address (Ex: element.matrix.xmpp.example.com)com)

The Matrix room at alias #roomname:element.localexample.com maps to #roomname#element.local@element.#roomname#example.com@matrix.xmpp.example.com on the XMPP server xmpp.example.com if youtyour xmpp_domain: element.matrix.xmpp.example.com

Note: If the Matrix room has users with the same name as yor XMPP account, you will need to edit you XMPP nickname to be unique in the room

Element XMPP
#roomname:element.local (native Matrix room) #roomname#element.local@element.xmpp.example.com (bridged into XMPP)
#_xmpp_roomname_conference.xmpp.example.com:element.local (bridged into Matrix/Element) #roomname@conference.xmpp.example.com (native XMPP room)

Using the bridge as an end user

For end user documentation you can visit the Using the Matrix XMPP Bridge as an End User documentation.