An open source integration manager for matrix clients, like Element.
Go to file
Travis Ralston 8cdae3359d Support explicit setting of the federation/client URLs
The client/server URL is needed for go-neb to work correctly, and to remove our complete dependence on federation.

The federation URL is also configurable so servers that don't wish to federate can specify a local address.
2018-03-24 17:09:34 -06:00
config Support explicit setting of the federation/client URLs 2018-03-24 17:09:34 -06:00
docs Update some documentation 2017-12-22 16:38:48 -07:00
src Support explicit setting of the federation/client URLs 2018-03-24 17:09:34 -06:00
web Support explicit setting of the federation/client URLs 2018-03-24 17:09:34 -06:00
.gitignore Move app from src-ts to src 2017-12-24 02:28:48 -07:00
.travis.yml Update linting to include the web project as well 2018-03-23 21:29:48 -06:00
DEVELOPMENT.md Use nodejs 8 in travis; Update web start script 2017-12-22 22:11:47 -07:00
jenkins.sh Add jenkins build script 2017-06-25 22:22:14 -06:00
LICENSE Initial commit 2017-05-25 15:41:56 -06:00
package-lock.json Package upgrades and change linting rules 2018-03-21 20:40:03 -06:00
package.json Move admin routes to their own API namespace 2018-03-23 21:36:43 -06:00
postcss.config.js Upgrade dependencies to be nodejs 6.11 & npm5 compatible 2017-06-25 21:57:13 -06:00
README.md Update homepage and branding 2017-12-23 16:20:59 -07:00
tsconfig-app.json Move app from src-ts to src 2017-12-24 02:28:48 -07:00
tsconfig.json Support provisioning bots in go-neb 2018-03-24 14:54:12 -06:00
tslint.json Package upgrades and change linting rules 2018-03-21 20:40:03 -06:00
webpack.config.js Re-implement the Scalar API in typescript 2017-12-17 19:22:13 -07:00

dimension

TravisCI badge #dimension:t2bot.io

An alternative integrations manager for Riot.im.

Configuring Riot to use Dimension

Change the values in Riot's config.json as shown below. If you do not have a config.json, copy the config.sample.json from Riot.

"integrations_ui_url": "https://dimension.t2bot.io/riot",
"integrations_rest_url": "https://dimension.t2bot.io/api/v1/scalar",
"integrations_widgets_urls": ["https://dimension.t2bot.io/widgets"],

The remaining settings should be tailored for your Riot deployment. If you're self-hosting Dimension, replace "dimension.t2bot.io" with your Dimension URL.

Running your own

Prerequisites:

  • NodeJS 8 or higher
  • npm 5 or higher (npm install -g npm@latest)
  • TypeScript 2.6 or higher (npm install -g typescript)
  • A webserver running Riot
# Download dimension 
git clone https://github.com/turt2live/matrix-dimension.git
cd matrix-dimension

# Edit the configuration to your specifications.
# Be sure to add yourself as an admin!
cp config/default.yaml config/production.yaml
nano config/production.yaml

# Run
NODE_ENV=production npm run start:app

If you didn't change the port, Dimension should now be running on port 8184. It's best to set up your environment so that Dimension runs on a dedicated subdomain that is not the same as your Riot domain. This is to help keep Riot and Dimension safe and secure.

In your Riot config.json, set the integration manager to be your Dimension URL. Replace dimension.t2bot.io in the example above (under "Configuring Riot to use Dimension") with your Dimension URLs.

After Riot has been configured to use Dimension, refresh Riot and click the "Integrations" button in the top right of the room. It should be an icon that looks like this:

3x3 square

That button should open Dimension. If you've configured everything correctly, you'll see a gear icon in the top right of the window - click this to start editing your integrations.

Running Dimension behind nginx

  1. Follow the steps outlined above.
  2. Set the host for Dimension to listen on to localhost or 127.0.0.1
  3. Restart Dimension (CTRL+C and run NODE_ENV=production npm run start:app again)
  4. Set up the following reverse proxy information as applicable
    location / {
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_pass http://localhost:8184;
    }
    
    Be sure to also configure any SSL offloading.

"Could not contact integrations server" error

  1. Check that federation is enabled and working on your homeserver. Even in a private, or non-federated environment, the federation API still needs to be accessible. If federation is a major concern, limit the servers that can use the API by IP or install Dimension on the same server as your homeserver, only exposing federation to localhost.
  2. Check your SRV records. If you are using SRV records to point to your federation port, make sure that the hostname and port are correct, and that HTTPS is listening on that port. Dimension will use the first record it sees and will only communicate over HTTPS.
  3. Log out of Riot and log back in. When switching from the default integrations manager (Scalar) to Dimension the authentication tokens can change. Logging out and back in will reset this token, allowing Dimension to work. More advanced users can delete the "mx_scalar_token" localstorage key.

Development

For information on how to run Dimension in a local environment, and for information about how the project is structured, see DEVELOPMENT.md

Do I need an integrations manager?

Integration managers aim to ease a user's interaction with the various services a homeserver may provide. Often times the integrations manager provided by Riot.im, named Modular, is more than suitable. However, there are a few cases where running your own makes more sense:

  • Wanting to self-host all aspects of your Riot install
  • Wanting to advertise custom bots specific to your homeserver
  • Corporate or closed environments where Modular's integrations won't work

How do integration managers work?

Integration managers sit between your users and your integrations (bots, bridges, etc). It helps guide users through the configuration of your integrations for their rooms. The integrations manager can only manage integrations it is configured for. For example, Modular can only provide configuration for the bridges and bots running on matrix.org, while Dimension can provide configuration for your own bots and bridges.

The infrastructure diagram looks something like this:

+-----------+         +----------------------+                          +--------------------+
|           |========>|                      |=========================>|                    |
|           |         | Integrations Manager |                          | Bots, bridges, etc |
|           |         |     (Dimension)      |    +-------------+       | (go-neb, irc, etc) |
|  Clients  |         |                      |===>|             |<=====>|                    |
|  (Riot)   |         +----------------------+    |  Homeserver |       +--------------------+
|           |                                     |  (synapse)  |
|           |============client/server API=======>|             |
+-----------+                                     +-------------+

License

For information about Dimension's license, please see the LICENSE file included in this repository.