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

  • Copy sample file from config-sample/xmpp/xmpp.yml to the xmpp sub-directory within your config folder

  • Edit the file with the following values :

    • xmpp_service: XMPP Address of the service endpoint.

    • xmpp_domain: The domain namesubdomain of the xmppexternal userscomponent

    • 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. Requiers 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

  • Restart the installer

Prosody Example

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

    Component "matrix.xmpp.lab.element.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.lab.element.com:5347
xmpp_domain: matrix.xmpp.lab.element.commatrix # 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. To do this, if the room on XMPP is named:

#iwotevo@conference.xmpp.lab.element.com

(conference is the fqdn of the component's hosting rooms on our xmpp test instance)

then on Matrix, you would join:

#_xmpp_iwotevo_conference.xmpp.lab.element.com:<your server name>

The command to do that from within the Element client would be: (assuming your homeserver domain is example.com)

/join #_xmpp_iwotevo_conference.xmpp.lab.element.com:example.com