Matterbridge Server¶
Overview¶
We use Matterbridge to connect channels across different messaging platforms
such as Slack, Mattermost and Gitter. Matterbridge provides binaries
for many operating systems. The matterbridge
binary is intended to be used
in combination with a TOML configuration file:
$ ./matterbridge -conf config-tardis-matterbridge.toml
The TOML file includes all the parameters required to connect as many messaging platforms as you want, like tokens and passwords. Once the application is running, messages can be shared between the connected rooms.
Currently, we keep a service running on the OpenSupernova.org server to run Matterbridge as a daemon. Our configuration files are stored in a private GitHub repository, including our custom TOML and the files needed to set up the Linux service.
Since this server runs Ubuntu 14.04 we use an Upstart script instead of a Systemd service file, but a Systemd file is also included in our repository. A cron job restarts the service periodically to prevent disconnections.
Configuration¶
Use the TOML file in tardis-matterbridge
as an example. You can set up
as many gateways as you want!
Slack¶
Follow the steps for Slack in the Matterbridge wiki and read carefully this comment (do not add any scopes manually!). Copy the token to use later in the TOML file.
Gitter¶
Create a new GitHub dedicated account to use as a bot, refer to this link and copy the token to use later in the TOML file.
Mattermost¶
Follow the steps for Mattermost in the Matterbridge wiki.
First-time setup¶
Follow these steps to set up the server:
ssh to OpenSupernova.org server.
Download the Matterbridge binary for Linux from the releases section.
Make the file executable and rename it to
matterbridge
.Copy
matterbridge
executable to/usr/local/bin
.Clone
tardis-matterbridge
repository in your$HOME
.Copy
config-tardis-matterbridge.toml
to/usr/local/etc/matterbridge/
.Copy
matterbridge.conf
to/etc/init/
.Run
sudo service matterbridge start
.Test your gateways.
Update server configuration¶
After updating the TOML file, follow these steps:
ssh to OpenSupernova.org server.
Copy your new
config-tardis-matterbridge.toml
to/usr/local/etc/matterbridge/
.Run
sudo service matterbridge restart
.Test your gateways.
If everything is ok, make a pull request to
tardis-matterbridge
with your new TOML file.
Cron job¶
To edit the cron job, ssh to OpenSupernova.org and run sudo crontab -e
.