2015-10-23 22:34:37 +02:00
# matterbridge
2017-03-18 22:16:25 +01:00
[![Gitter ](https://img.shields.io/gitter/room/nwjs/nw.js.svg )](https://gitter.im/42wim/matterbridge) [![Join the IRC chat at https://webchat.freenode.net/?channels=matterbridgechat ](https://img.shields.io/badge/IRC-matterbridgechat-green.svg )](https://webchat.freenode.net/?channels=matterbridgechat) [![Discord ](https://img.shields.io/badge/discord-matterbridge-green.svg )](https://discord.gg/AkKPtrQ) [![Matrix ](https://img.shields.io/badge/matrix-matterbridge-green.svg )](https://riot.im/app/#/room/#matterbridge:matrix.org)
2016-11-23 00:13:59 +01:00
![matterbridge.gif ](https://s15.postimg.org/qpjhp6y3f/matterbridge.gif )
2017-02-20 13:48:45 +01:00
Simple bridge between Mattermost, IRC, XMPP, Gitter, Slack, Discord, Telegram, Rocket.Chat, Hipchat(via xmpp) and Matrix with REST API.
# Table of Contents
* [Features ](#features )
* [Requirements ](#requirements )
* [Installing ](#installing )
* [Binaries ](#binaries )
* [Building ](#building )
* [Configuration ](#configuration )
* [Examples ](#examples )
* [Running ](#running )
* [Docker ](#docker )
* [Changelog ](#changelog )
* [FAQ ](#faq )
* [Thanks ](#thanks )
# Features
2017-02-20 00:49:27 +01:00
* Relays public channel messages between multiple mattermost, IRC, XMPP, Gitter, Slack, Discord, Telegram, Rocket.Chat, Hipchat (via xmpp) and Matrix. Pick and mix.
2017-02-20 13:48:45 +01:00
* Matterbridge can also work with private groups on your mattermost/slack.
2016-09-18 21:04:28 +02:00
* Allow for bridging the same bridges, which means you can eg bridge between multiple mattermosts.
* The bridge is now a gateway which has support multiple in and out bridges. (and supports multiple gateways).
2017-02-20 13:48:45 +01:00
* REST API to read/post messages to bridges (WIP).
2016-11-23 00:13:59 +01:00
2017-02-20 13:48:45 +01:00
# Requirements
2016-09-04 20:41:03 +02:00
Accounts to one of the supported bridges
2017-03-15 01:04:52 +01:00
* [Mattermost ](https://github.com/mattermost/platform/ ) 3.5.x - 3.7.x
2017-02-20 13:48:45 +01:00
* [IRC ](http://www.mirc.com/servers.html )
* [XMPP ](https://jabber.org )
* [Gitter ](https://gitter.im )
* [Slack ](https://slack.com )
* [Discord ](https://discordapp.com )
* [Telegram ](https://telegram.org )
* [Hipchat ](https://www.hipchat.com )
* [Rocket.chat ](https://rocket.chat )
* [Matrix ](https://matrix.org )
# Installing
## Binaries
2016-09-04 20:41:03 +02:00
Binaries can be found [here] (https://github.com/42wim/matterbridge/releases/)
2017-03-27 20:40:57 +02:00
* Latest release [v0.10.3 ](https://github.com/42wim/matterbridge/releases/latest )
2015-10-23 23:02:14 +02:00
2017-02-20 13:48:45 +01:00
## Building
2016-04-25 21:40:26 +02:00
Go 1.6+ is required. Make sure you have [Go ](https://golang.org/doc/install ) properly installed, including setting up your [GOPATH] (https://golang.org/doc/code.html#GOPATH)
2015-10-23 22:34:37 +02:00
```
cd $GOPATH
2015-10-30 09:57:23 +01:00
go get github.com/42wim/matterbridge
2015-10-23 22:34:37 +02:00
```
You should now have matterbridge binary in the bin directory:
```
$ ls bin/
matterbridge
```
2017-02-20 13:48:45 +01:00
# Configuration
* [matterbridge.toml.sample ](https://github.com/42wim/matterbridge/blob/master/matterbridge.toml.sample ) for documentation and an example.
* [matterbridge.toml.simple ](https://github.com/42wim/matterbridge/blob/master/matterbridge.toml.simple ) for a simple example.
## Examples
### Bridge mattermost (off-topic) - irc (#testing)
```
[irc]
[irc.freenode]
Server="irc.freenode.net:6667"
Nick="yourbotname"
[mattermost]
[mattermost.work]
useAPI=true
Server="yourmattermostserver.tld"
Team="yourteam"
Login="yourlogin"
Password="yourpass"
PrefixMessagesWithNick=true
[[gateway]]
name="mygateway"
enable=true
[[gateway.inout]]
account="irc.freenode"
channel="#testing"
[[gateway.inout]]
account="mattermost.work"
channel="off-topic"
```
### Bridge slack (#general) - discord (general)
```
2017-03-20 12:12:12 +01:00
[slack]
2017-02-20 13:48:45 +01:00
[slack.test]
2017-03-20 12:12:12 +01:00
useAPI=true
2017-02-20 13:48:45 +01:00
Token="yourslacktoken"
PrefixMessagesWithNick=true
2017-03-20 12:12:12 +01:00
[discord]
2017-02-20 13:48:45 +01:00
[discord.test]
Token="yourdiscordtoken"
Server="yourdiscordservername"
[general]
RemoteNickFormat="[{PROTOCOL}/{BRIDGE}] < {NICK}> "
[[gateway]]
name = "mygateway"
enable=true
[[gateway.inout]]
account = "discord.test"
channel="general"
[[gateway.inout]]
account ="slack.test"
channel = "general"
```
# Running
2017-03-25 21:35:13 +01:00
1) Copy the matterbridge.toml.sample to matterbridge.toml
2017-02-20 13:48:45 +01:00
2) Edit matterbridge.toml with the settings for your environment.
2017-03-25 21:35:13 +01:00
3) Now you can run matterbridge. (```./matterbridge```)
(Matterbridge will only look for the config file in your current directory, if it isn't there specify -conf "/path/toyour/matterbridge.toml")
2015-12-19 16:55:49 +01:00
```
2016-07-11 23:22:56 +02:00
Usage of ./matterbridge:
-conf string
2016-09-18 21:04:28 +02:00
config file (default "matterbridge.toml")
2016-07-11 23:22:56 +02:00
-debug
enable debug
2017-03-25 21:35:13 +01:00
-gops
enable gops agent
2016-07-11 23:22:56 +02:00
-version
show version
2015-12-19 16:55:49 +01:00
```
2015-10-23 22:34:37 +02:00
2017-02-20 13:48:45 +01:00
## Docker
Create your matterbridge.toml file locally eg in ```/tmp/matterbridge.toml```
```
docker run -ti -v /tmp/matterbridge.toml:/matterbridge.toml 42wim/matterbridge
```
2015-10-23 22:34:37 +02:00
2017-02-20 13:48:45 +01:00
# Changelog
See [changelog.md ](https://github.com/42wim/matterbridge/blob/master/changelog.md )
2015-10-23 22:34:37 +02:00
2017-02-20 13:48:45 +01:00
# FAQ
2015-10-23 22:34:37 +02:00
2017-02-20 13:48:45 +01:00
Please look at [matterbridge.toml.sample ](https://github.com/42wim/matterbridge/blob/master/matterbridge.toml.sample ) for more information first.
2015-10-23 22:34:37 +02:00
2017-02-20 13:48:45 +01:00
## Mattermost doesn't show the IRC nicks
2016-07-15 21:59:14 +02:00
If you're running the webhooks version, this can be fixed by either:
* enabling "override usernames". See [mattermost documentation ](http://docs.mattermost.com/developer/webhooks-incoming.html#enabling-incoming-webhooks )
2016-09-18 21:04:28 +02:00
* setting ```PrefixMessagesWithNick``` to ```true``` in ```mattermost``` section of your matterbridge.toml.
2016-07-15 21:59:14 +02:00
2017-02-20 13:48:45 +01:00
If you're running the API version you'll need to:
2016-09-18 21:04:28 +02:00
* setting ```PrefixMessagesWithNick``` to ```true``` in ```mattermost``` section of your matterbridge.toml.
2016-07-15 21:59:14 +02:00
Also look at the ```RemoteNickFormat``` setting.
2017-02-20 13:48:45 +01:00
# Thanks
Matterbridge wouldn't exist without these libraries:
* discord - https://github.com/bwmarrin/discordgo
* echo - https://github.com/labstack/echo
* gitter - https://github.com/sromku/go-gitter
2017-03-25 21:35:13 +01:00
* gops - https://github.com/google/gops
2017-02-20 13:48:45 +01:00
* irc - https://github.com/thoj/go-ircevent
* mattermost - https://github.com/mattermost/platform
* matrix - https://github.com/matrix-org/gomatrix
* slack - https://github.com/nlopes/slack
* telegram - https://github.com/go-telegram-bot-api/telegram-bot-api
* xmpp - https://github.com/mattn/go-xmpp