Git Product home page Git Product logo

42wim / matterbridge Goto Github PK

View Code? Open in Web Editor NEW
6.3K 113.0 588.0 76.95 MB

bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)

License: Apache License 2.0

Go 99.41% Dockerfile 0.47% Shell 0.12%
mattermost xmpp telegram gitter rocketchat discord irc bridge slack matrix

matterbridge's Introduction

matterbridge

Matterbridge Logo
A simple chat bridge
Letting people be where they want to be.
Bridges between a growing number of protocols. Click below to demo or join the development chat.

Discord | Gitter | IRC | Keybase | Matrix | Mattermost | MSTeams | Rocket.Chat | Slack | Telegram | Twitch | WhatsApp | XMPP | Zulip | And more...


Download stable Maintainability Test Coverage


Note: Mattermost isn't required to run matterbridge.

Table of Contents

Features

Natively supported

3rd party via matterbridge api

API

The API is basic at the moment. More info and examples on the wiki.

Used by the projects below. Feel free to make a PR to add your project to this list.

Chat with us

Questions or want to test on your favorite platform? Join below:

Screenshots

See https://github.com/42wim/matterbridge/wiki

Installing / upgrading

Binaries

  • Latest stable release v1.26.0
  • Development releases (follows master) can be downloaded here selecting the latest green build and then artifacts.

To install or upgrade just download the latest binary. On *nix platforms you may need to make the binary executable - you can do this by running chmod a+x on the binary (example: chmod a+x matterbridge-1.24.1-linux-64bit). After downloading (and making the binary executable, if necessary), follow the instructions on the howto for a step by step walkthrough for creating your configuration.

Packages

Building

Most people just want to use binaries, you can find those here

If you really want to build from source, follow these instructions: Go 1.18+ is required. Make sure you have Go properly installed.

Building the binary with all the bridges enabled needs about 3GB RAM to compile. You can reduce this memory requirement to 0,5GB RAM by adding the nomsteams tag if you don't need/use the Microsoft Teams bridge.

Matterbridge can be build without gcc/c-compiler: If you're running on windows first run set CGO_ENABLED=0 on other platforms you prepend CGO_ENABLED=0 to the go build command. (eg CGO_ENABLED=0 go install github.com/42wim/matterbridge)

To install the latest stable run:

go install github.com/42wim/matterbridge

To install the latest dev run:

go install github.com/42wim/matterbridge@master

To install the latest stable run without msteams or zulip bridge:

go install -tags nomsteams,nozulip github.com/42wim/matterbridge

You should now have matterbridge binary in the ~/go/bin directory:

$ ls ~/go/bin/
matterbridge

Building with whatsapp (beta) multidevice support

Because the library we use for Whatsapp multidevice support includes a GPL3 library we can not provide you binaries. (as this would require the Matterbridge to change it license to GPL)

Matterbridge can be build without gcc/c-compiler: If you're running on windows first run set CGO_ENABLED=0 on other platforms you prepend CGO_ENABLED=0 to the go build command. (eg CGO_ENABLED=0 go install github.com/42wim/matterbridge)

So this means you have to build it yourself using the instructions below:

go install -tags whatsappmulti github.com/42wim/matterbridge@master

If you're low on memory and don't need msteams:

go install -tags nomsteams,whatsappmulti github.com/42wim/matterbridge@master

You should now have matterbridge binary in the ~/go/bin directory:

$ ls ~/go/bin/
matterbridge

Configuration

Basic configuration

See howto for a step by step walkthrough for creating your configuration.

Settings

All possible settings for each bridge.

Advanced configuration

Examples

Bridge mattermost (off-topic) - irc (#testing)

[irc]
    [irc.libera]
    Server="irc.libera.chat:6667"
    Nick="yourbotname"

[mattermost]
    [mattermost.work]
    Server="yourmattermostserver.tld"
    Team="yourteam"
    Login="yourlogin"
    Password="yourpass"
    PrefixMessagesWithNick=true
    RemoteNickFormat="[{PROTOCOL}] <{NICK}> "

[[gateway]]
name="mygateway"
enable=true
    [[gateway.inout]]
    account="irc.libera"
    channel="#testing"

    [[gateway.inout]]
    account="mattermost.work"
    channel="off-topic"

Bridge slack (#general) - discord (general)

[slack]
[slack.test]
Token="yourslacktoken"
PrefixMessagesWithNick=true

[discord]
[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

See howto for a step by step walkthrough for creating your configuration.

Usage of ./matterbridge:
  -conf string
        config file (default "matterbridge.toml")
  -debug
        enable debug
  -gops
        enable gops agent
  -version
        show version

Docker

Please take a look at the Docker Wiki page for more information.

Systemd

Please take a look at the Service Files page for more information.

Changelog

See changelog.md

FAQ

See FAQ

Related projects

Articles / Tutorials

Thanks

This project is supported by:

Matterbridge wouldn't exist without these libraries:

matterbridge's People

Contributors

42wim avatar benwiederhake avatar c0ncord2 avatar cosmicboots avatar dajohi avatar dellle avatar dependabot[bot] avatar fdevibe avatar gary-kim avatar helcaraxan avatar hmrhkr avatar ilmaisin avatar ishitatsuyuki avatar jheiselman avatar jlu5 avatar kida001 avatar ldruschk avatar mvoolt avatar nightmared avatar nikkyai avatar papatutuwawa avatar patcon avatar qaisjp avatar s3lph avatar sas1024 avatar supersandro2000 avatar tilosp avatar valdikss avatar yousefmansy1 avatar yuvallanger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

matterbridge's Issues

runtime error: invalid memory address or nil pointer dereference

Hi,

thank you for your work on this integration. I'm facing a segfault with this configuration :

  1 [irc]
  2     [irc.canton]
  3     Server="localhost:6667"
  4     UseTLS=false
  5     Nick="canton"
  6     RemoteNickFormat="<{NICK}> "
  7 
  8 [mattermost]
  9     [mattermost.cantonHOOK]
 10     useAPI=false
 11     URL="http://localhost:8065/hooks/gnux8bnaafnt3xdmpjhyhhoopc"
 12     BindAddress="localhost:9999"
 13     PrefixMessagesWithNick=false
 14     NoTLS=true
 15     ShowJoinPart=true
 16     RemoteNickFormat="<{NICK}>"
 17 
 18     [mattermost.cantonAPI]
 19     useAPI=true
 20     Server="localhost:8065"
 21     Team="canton"
 22     Login="matterbridge"
 23     Password="*************"
 24     PrefixMessagesWithNick=false
 25     NoTLS=true
 26 
 27 [[gateway]]
 28 name="gateway1"
 29 enable=true
 30     [[gateway.in]]
 31     account="irc.canton"
 32     channel="#canton"
 33 
 34     [[gateway.in]]
 35     account="mattermost.cantonHOOK"
 36     channel="Off-Topic"
 37 
 38     [[gateway.out]]
 39     account="irc.canton"
 40     channel="#canton"
 41 
 42     [[gateway.out]]
 43     account="mattermost.cantonHOOK"
 44     channel="Off-Topic"
INFO[2016-09-19T23:11:38Z] enabling debug                               
running version 0.7.0-dev
starting gateway "gateway1"
INFO[2016-09-19T23:11:38Z] Trying IRC connection                         module=irc
2016/09/19 23:11:38 Connected to localhost:6667 (127.0.0.1:6667)
INFO[2016-09-19T23:11:38Z] Connection succeeded                          module=irc
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x60 pc=0x58a67c]

goroutine 6 [running]:
panic(0x9dce80, 0xc82000e0e0)
        /usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6
github.com/42wim/matterbridge/matterclient.(*MMClient).JoinChannel(0x0, 0xc8201322b0, 0x9, 0x0, 0x0)
        /home/ubuntu/documents/go/src/github.com/42wim/matterbridge/matterclient/matterclient.go:352 +0xfc
github.com/42wim/matterbridge/bridge/mattermost.(*Bmattermost).JoinChannel(0xc820081480, 0xc8201322b0, 0x9, 0x0, 0x0)
        /home/ubuntu/documents/go/src/github.com/42wim/matterbridge/bridge/mattermost/mattermost.go:99 +0x45
github.com/42wim/matterbridge/gateway.New(0xc820017640, 0xc8200651d0, 0x0, 0x0)
        /home/ubuntu/documents/go/src/github.com/42wim/matterbridge/gateway/gateway.go:34 +0x45f
main.main.func1(0xc820017640, 0xc8200ffa90, 0x8, 0x1, 0xc820134240, 0x2, 0x2, 0xc8201342c0, 0x2, 0x2)
        /home/ubuntu/documents/go/src/github.com/42wim/matterbridge/matterbridge.go:39 +0x6e
created by main.main
        /home/ubuntu/documents/go/src/github.com/42wim/matterbridge/matterbridge.go:43 +0x6f5

Same behaviour with mattermost.toml.simple
Also, using the API works and sends from mattermost to IRC but fails silently to go from IRC to mattermost.
If I comment out the gateway.out for mattermost, there is no more segfault but messages aren't being forwarded to mattermost.

~/documents/go/bin$ go version
go version go1.6.2 linux/amd64
~/documents/go/bin$ ./matterbridge -version
version: 0.7.0-dev
/usr/local/bin/mattermost$ sudo -u mmuser ./bin/platform --version
Version: 3.4.0
Build Number: 3.4.0
Build Date: Wed Sep 14 13:04:40 UTC 2016
Build Hash: 57f25fa59c71821cc38fd220b133aa6a40815e12
Build Enterprise Ready: true
DB Version: 3.4.0

v0.4 fails to compile

Trying to build the latest matterbridge master fails with this error:

$ go get github.com/42wim/matterbridge
# github.com/42wim/matterbridge/vendor/github.com/mattermost/platform/model
go-work/src/github.com/42wim/matterbridge/vendor/github.com/mattermost/platform/model/client.go:644: undefined: Compliance
go-work/src/github.com/42wim/matterbridge/vendor/github.com/mattermost/platform/model/session.go:30: undefined: TeamMember

It can be solved by copying mattermost/platform from matterbridge-plus.

go version 1.6.2

NickServ* properties wrong in sample file

The sample file and the README place the "NickServ*" configuration in the wrong location, causing a start failure of the matterbridge. Those properties actually belong into the IRC section.

IRC messages aren't being forwarded to mattermost

my config (personal bits removed)

this is configuration for matterbridge.

IRC section

[IRC]

Enable enables this bridge

OPTIONAL (default false)

Enable=true

irc server to connect to.

REQUIRED

Server="irc.freenode.net:6667"

Enable to use TLS connection to your irc server.

OPTIONAL (default false)

UseTLS=false

Enable SASL (PLAIN) authentication. (freenode requires this from eg AWS hosts)

It uses NickServNick and NickServPassword as login and password

OPTIONAL (default false)

UseSASL=false

Enable to not verify the certificate on your irc server. i

e.g. when using selfsigned certificates

OPTIONAL (default false)

SkipTLSVerify=true

Your nick on irc.

REQUIRED

Nick="nutzrelay"

If you registered your bot with a service like Nickserv on freenode.

Also being used when UseSASL=true

OPTIONAL

NickServNick="nickserv"
NickServPassword="A nick pass"

RemoteNickFormat defines how remote users appear on this bridge

The string "{NICK}" (case sensitive) will be replaced by the actual nick / username.

The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge

OPTIONAL(default {BRIDGE}-{NICK})

RemoteNickFormat="<{NICK}> "

Nicks you want to ignore.

Messages from those users will not be sent to other bridges.

OPTIONAL

mattermost section

[mattermost]

Enable enables this bridge

OPTIONAL (default false)

Enable=true

Settings for webhook matterbridge.

These settings will not be used when using -plus switch which doesn't use

webhooks.

Url is your incoming webhook url as specified in mattermost.

See account settings - integrations - incoming webhooks on mattermost.

REQUIRED

URL="https://yourdomain/hooks/yourhookkey"

Address to listen on for outgoing webhook requests from mattermost.

See account settings - integrations - outgoing webhooks on mattermost.

This setting will not be used when using -plus switch which doesn't use

webhooks

REQUIRED

BindAddress="0.0.0.0:9999"

Icon that will be showed in mattermost.

OPTIONAL

IconURL=""

Settings for matterbridge -plus

Thse settings will only be used when using the -plus switch.

The mattermost hostname.

REQUIRED

Server="mm.podnutz.com"

Your team on mattermost.

REQUIRED

Team="podnutz"

login/pass of your bot.

Use a dedicated user for this and not your own!

REQUIRED

Login="an email"
Password="A password"

Enable this to make a http connection (instead of https) to your mattermost.

OPTIONAL (default false)

NoTLS=false

Shared settings for matterbridge and -plus

Enable to not verify the certificate on your mattermost server.

e.g. when using selfsigned certificates

OPTIONAL (default false)

SkipTLSVerify=true

Enable to show IRC joins/parts in mattermost.

OPTIONAL (default false)

ShowJoinPart=false

Whether to prefix messages from other bridges to mattermost with the sender's nick.

Useful if username overrides for incoming webhooks isn't enabled on the

mattermost server. If you set PrefixMessagesWithNick to true, each message

from bridge to Mattermost will by default be prefixed by "bridge-" + nick. You can,

however, modify how the messages appear, by setting (and modifying) RemoteNickFormat

OPTIONAL (default false)

PrefixMessagesWithNick=true

RemoteNickFormat defines how remote users appear on this bridge

The string "{NICK}" (case sensitive) will be replaced by the actual nick / username.

The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge

OPTIONAL (default {BRIDGE}-{NICK})

RemoteNickFormat="<{NICK}> "

how to format the list of IRC nicks when displayed in mattermost.

Possible options are "table" and "plain"

OPTIONAL (default plain)

NickFormatter=plain

How many nicks to list per row for formatters that support this.

OPTIONAL (default 4)

NicksPerRow=4

Nicks you want to ignore. Messages from those users will not be bridged.

OPTIONAL

Gitter section

Best to make a dedicated gitter account for the bot.

slack section

multiple channel config

You can specify multiple channels.

The name is just an identifier for you.

REQUIRED (at least 1 channel)

[Channel "irc"]

Choose the IRC channel to send messages to.

IRC="#podnutz"

Choose the mattermost channel to messages to.

mattermost="irc"

general

[general]

request your API key on https://github.com/giphy/GiphyAPI. This is a public beta key.

OPTIONAL

GiphyApiKey="dc6zaTOxFJmzC"

Enabling plus means you'll use the API version instead of the webhooks one

Plus=true

Message echoing in a mattermost1 <-> mattermost2 bridge

A bridge between different teams results in each message repeated in the channel from which it had originated.

[mattermost]
    [mattermost1]
    useAPI=true
    Server="yourmattermostserver.domain"
    Team="yourteam1"
    Login="yourlogin"
    Password="yourpass"
    PrefixMessagesWithNick=true

    [mattermost2]
    useAPI=true
    Server="yourmattermostserver.domain"
    Team="yourteam2"
    Login="yourlogin"
    Password="yourpass"
    PrefixMessagesWithNick=true

[[gateway.in]]
account="mattermost1"
channel="channel1"

[[gateway.in]]
account="mattermost2"
channel="channel2"

[[gateway.out]]
account="mattermost1"
channel="channel1"

[[gateway.out]]
account="mattermost2"
channel="channel2"

Every time a user sends a message in yourteam1/channel1, the bot outputs it both in yourteam2/channel2 as well as yourteam1/channel1 (expected behavior would result in output only in yourteam2/channel2).

multiple gateways

Hello,
I'm trying to configure a second gateway, with this config. However only the second gateway is taken into account. Am I misusing the syntax ?

[irc]
    [irc.brand]
    Server="localhost:6667"
    UseTLS=true
    Nick="brand"
    RemoteNickFormat="<{NICK}> "

    [irc.w3c]
    Server="irc.w3.org:6667"
    UseTLS=false
    Nick="brand"
    RemoteNickFormat="<{NICK}> "

[mattermost]
    [mattermost.irc]
    useAPI=false
    URL="https://mattermost.brand.com/hooks/ratoksdhjkdfjhiprswms8qoyibh"
    BindAddress="localhost:9999"
    PrefixMessagesWithNick=true
    NoTLS=false
    ShowJoinPart=false
    RemoteNickFormat="<{NICK}> "

    [mattermost.wpwg]
    useAPI=false
    URL="https://mattermost.brand.com/hooks/s1sq8m1skdhfoshfoljsd8ce4r"
    BindAddress="localhost:9998"
    PrefixMessagesWithNick=true
    NoTLS=false
    ShowJoinPart=false
    RemoteNickFormat="<{NICK}> "

    [mattermost.wpay]
    useAPI=false
    URL="https://mattermost.brand.com/hooks/i8q6kdsfhksdjfhk3jh6z33o"
    BindAddress="localhost:9997"
    PrefixMessagesWithNick=true
    NoTLS=false
    ShowJoinPart=false
    RemoteNickFormat="<{NICK}> "

[[gateway]]
name="gateway1"
enable=true
    [[gateway.in]]
    account="irc.w3c"
    channel="#wpwg"

    [[gateway.out]]
    account="mattermost.wpwg"
    channel="wpwg"

[[gateway]]
name="gateway2"
enable=true
    [[gateway.in]]
    account="irc.w3c"
    channel="#wpay"

    [[gateway.out]]
    account="mattermost.wpay"
    channel="wpay"

Support pasted images

When a link to an image is pasted into mattermost, then the IRC channel will receive the image link and mattremost will show the link and the image.

When an image is pasted into the mattermost channel, then mattermost shows the image (differently) but the IRC channel gets nothing.

Interested in other protocols?

Hi

I've been designing a gitter/irc bridge that would work much like matterbridge. I use gitter-irc-bot for mirroring channels and it doesn't support multiple bridges per instance.

I wrote a prototype here in python:
https://github.com/jleclanche/gitterway

My idea was to allow multiple protocols, including the possibility of writing your own protocol plugin eventually. I wrote another prototype in go (which I think is better for this task), with the config in toml looking something like this:

[gitter]
    # Your gitter accounts

    [gitter.hsimbot]
    apikey = "..."

    [gitter.helixbot]
    apikey = "..."

[irc]
    # Your IRC accounts

    [irc.helixbot]
    server = "chat.freenode.net"
    port = 6697
    nick = "HelixBot"


# Define your gateways below
[[gateway]]
    name = "hearthsim"
    in = [
        { account = "gitter.hsimbot", channel = "hearthsim/hearthsim" },
        { account = "irc.helixbot", channel = "#hearthsim" },
    ]
    out = [
        { account = "gitter.hsimbot", channel = "hearthsim/hearthsim" },
        { account = "irc.helixbot", channel = "#hearthsim" },
    ]

[[gateway]]
    name = "letsauth"
    in = [
        { account = "gitter.helixbot", channel = "letsauth/letsauth" },
        { account = "irc.helixbot", channel = "#letsauth" },
    ]
    out = [
        { account = "gitter.helixbot", channel = "hearthsim/hearthsim" },
        { account = "irc.helixbot", channel = "#hearthsim" },
    ]

I'd like to expand this to gitter, slack and mattermost, possibly some other protocols (Matrix?). This is similar to what Sameroom does. Anyway, wondering if you're interested in all this, your code looks great right now.

Other bridges ?

If anyone wants to contribute code to support for a new bridge, feel free to open an issue about this.
I'll be glad to help you where possible.

Bridges supported

Not supported anymore

  • Steam: Upstream library has no support for steam chat anymore. See here for more info.

3rd party via matterbridge API

  • Minecraft
  • Facebook Messenger
  • Reddit
  • Discourse
  • Counter-Strike, half-life and more

Not going to be implemented by me, but PR's welcome

Obsolete

IRC colors makes message malformated

In IRC protocol it is possible to specify color : http://www.mirc.com/colors.html
When a message is sent with this kind of command in IRC side. In mattermost side it wrotes the digit code.
For exemple :
if in IRC i sent ^C03Hello it writes Hello in green ; I use CTRL + K in order to have the good special char.
in Mattermost it wrotes : valvin : 03Hello instead of valvin: Hello

I think it can be handled by removing digits after this special char. There are two formats ^Cxx (foreground) and ^Cxx,yy (foreground and background)

Resends slack last message when it's force-restarted

I noticed that in one of the recent 0.7 builds matterbridge would randomly suddenly start using up all my server's CPU (see #44 for my setup).

This was unacceptable of course, so I setup a systemd unit file to restart it every hour.

Well, that kinda worked, but now the slack<->gitter bridge is repeating messages occasionally, but only on the gitter side, not slack, and only after the first 1 or 2 restarts (EDIT: does it every time):

screen shot 2016-10-24 at 10 08 11 pm

I haven't been monitoring my server closely so I don't know if the CPU-spinup bug is gone, so I'm hesitant to turn off the auto-restart thing ("Watchdog") in systemd. Maybe I should use the 0.6 version for now?

UseSlackCircumfix doesn't actually work?

I had been using matterbridge-plus, but I saw that it got merged back into matterbridge so I just switched my install over to use regular matterbridge instead.

The migration docs say that UseSlackCircumfix there, but when I try to start, I get:

2016/08/09 12:35:59 Failed to parse /opt/mattermost/config/matterbridge.conf:invalid variable: section "IRC" subsection "" variable "UseSlackCircumfix"

Did this get lost in the migration back to matterbridge?

filtering by nick?

CiviCRM is just starting to use mattermost, and will need to slowly transition folks from our long-standing irc channel that many of them love. We've been having our github activity auto-posted to irc. We have a separate channel for that in mattermost. We'd like to reduce the noise in our bridge from mattermost to irc by filtering the github posts (it's many times the posting frequency of humans). This seems like a fairly common use case. Harrison Healey suggested I post it here as a feature request.

Failing build on Debian

When running the command go get github.com/42wim/matterbridge I get the following error message:

# golang.org/x/crypto/poly1305
go/src/golang.org/x/crypto/poly1305/poly1305_amd64.s:8 6a: No such file or directory: textflag.h
# github.com/gorilla/websocket
go/src/github.com/gorilla/websocket/client.go:361: unknown tls.Config field 'GetCertificate' in struct literal
# github.com/42wim/matterbridge/bridge/gitter
go/src/github.com/42wim/matterbridge/bridge/gitter/gitter.go:54: not enough arguments in call to b.c.JoinRoom

OS: Debian 8.6
Go: go1.3.3 linux/amd64


I ran the same command on OSX and it worked just fine. That sounds like odd behaviour and maybe a problem with my Debian install. Not sure.

Feature Request : add public attachment link in IRC message

When you enter a message in mattermost side you can attach picture or things like that.
Today the message sent to IRC doesn't mention this attachment.
In mattermost (3.3) there is an option to create a public link (quite verbose).
This link should be attached to the message sent to IRC.
Maybe this feature has to be a setting that can be activated on demand.

What do you think about it ?

Allow specifing the configuration file to load from the command line

If you want to connect multiple channels with matterbridge it seems that you need to run an instance for each channel.

It would be helpful to be able to specify the configuration file to load from the command line to run multiple instances from the same binary.

Another option would be to be able to specify multiple configuration files for one instance.

Support for avatars/attachments when possible

Matterbridge currently offers the best existing way of creating guest users/publishing a channel. To do this one just needs to create two teams, internal and visitors on the same server. Then creating private or public channels in visitors team and linking them via matterbridge to corresponding channels in the internal team offers a decent realization of one of the most popular requested [features]((https://mattermost.uservoice.com/forums/306457-general/suggestions/9982719-add-restricted-users). As of now, on the mattermost side the planned implementation of the feature is partial (right now only single-channel guest users are planned), and only intended for the E10-edition: https://mattermost.atlassian.net/browse/PLT-3636

Therefore improving matterbridge support for single-server bridges would be very useful. As far as I can tell, there are several things that are currently not handled by matterbridge, and that would be nice to handle:

  • Modifying the avatars on message
  • Handling file attachments
  • ¿custom emoji?
  • Is there anything else?

SASL+TLS leads to connection failure

As the title says, the connection fails and the bridge crashes with NPE.

TLS+NickServ is okay, SASL without TLS also works. Since it's TLS, no packet inspection can be easily done on my side.
Although this may be an upstream issue, since you are the writer of the SASL part I'm writing here.

Crash when using Slack incoming/outgoing webhooks instead of API

% matterbridge -debug
INFO[2016-10-25T03:17:06-04:00] enabling debug
running version 0.7.0-dev
starting gateway "gateway1"
INFO[2016-10-25T03:17:06-04:00] Starting bridge: slack.groupincome channel: groupincome
INFO[2016-10-25T03:17:06-04:00] Starting bridge: gitter.groupincome channel: okTurtles/group-income
INFO[2016-10-25T03:17:06-04:00] Connecting                                    module=slack
INFO[2016-10-25T03:17:06-04:00] Connection succeeded                          module=slack
2016/10/25 03:17:06 Listening on http://0.0.0.0:9998...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x51f833]

goroutine 6 [running]:
panic(0x8dd5e0, 0xc420012090)
        /usr/local/go/src/runtime/panic.go:500 +0x1a1
github.com/42wim/matterbridge/bridge/slack.(*Bslack).Connect(0xc420121570, 0x0, 0xc42004bd10)
        /home/taoeffect/code/golang/src/github.com/42wim/matterbridge/bridge/slack/slack.go:61 +0x3f3
github.com/42wim/matterbridge/gateway.New(0xc420070b40, 0xc420015540, 0x0, 0x0)
        /home/taoeffect/code/golang/src/github.com/42wim/matterbridge/gateway/gateway.go:40 +0x637
main.main.func2(0xc420070b40, 0xc420117b30, 0x8, 0x1, 0xc42015a000, 0x2, 0x2, 0xc42015a080, 0x2, 0x2)
        /home/taoeffect/code/golang/src/github.com/42wim/matterbridge/matterbridge.go:53 +0x82
created by main.main
        /home/taoeffect/code/golang/src/github.com/42wim/matterbridge/matterbridge.go:57 +0x4c2

I commented out useAPI=true and got the above when trying to listen on port 9998. Note that Token= might still have been set and uncommented.

Fails to compile

.go/src/github.com/thoj/go-ircevent/irc.go:423:25: error: reference to undefined identifier ‘tls.DialWithDialer’
   irc.socket, err = tls.DialWithDialer(dialer, "tcp", irc.Server, irc.TLSConfig)

Simple bidirectional bridge configuration?

Hi, very pleased to see matterbridge exists. Thanks for your great work.

I'm just trying to set it up to copy many channels from our Slack team to a Mattermost team.

I'm just wanting to know if I need to setup a gateway per channel I want to bridge?

Ideally, I would be able to connect/bridge channels in both directions with much less configuration.

I think my ideal configuration would look something like

[[bidirectionalbridge]]
endpoint1="slack.enspiral"
endpoint2="mattermost.enspiral"
channels="wellington,thanks"

When I get this going I'd be happy to write a blog post or something to guide others doing the same workflow.

FYI, My current (untested) configuration looks like this:

[mattermost]
  [mattermost.enspiral]
  useAPI=true
  Server="example.com"
  Team="Enspiral"
  Login="[email protected]"
  Password="removed"
  # PrefixMessagesWithNick=true

[slack]
  [slack.enspiral]
  useAPI=true
  Token="removed"

[[gateway]]
name="gateway-wellington1"
enable=true
  [[gateway.in]]
  account="slack.enspiral"
  channel="wellington"
  [[gateway.out]]
  account="mattermost.enspiral"
  channel="wellington"

[[gateway]]
name="gateway-wellington2"
enable=true
  [[gateway.in]]
  account="mattermost.enspiral"
  channel="wellington"
  [[gateway.out]]
  account="slack.enspiral"  
  channel="wellington"

[[gateway]]
name="gateway-thanks1"
enable=true
  [[gateway.in]]
  account="slack.enspiral"
  channel="thanks"
  [[gateway.out]]
  account="mattermost.enspiral"
  channel="thanks"

[[gateway]]
name="gateway-thanks2"
enable=true
  [[gateway.in]]
  account="mattermost.enspiral"
  channel="thanks"
  [[gateway.out]]
  account="slack.enspiral"
  channel="thanks"

[REQUEST] Dynamic IconURL

I would like to be able to have a dynamic IconURL like the Slack-IRC bot has (https://github.com/ekmartin/slack-irc, "avatarUrl": "https://robohash.org/$username.png?size=48x48"). I use this function to grab custom avatars of users that are on IRC.

I didn't see anything that suggests that this feature already exists so I'm hereby requesting it. I would be more than enough if I could use the {NICK} syntax in the IconURL variable.

Crash... not sure why

I'm not sure if this is helpful, but matterbridge is crashing for me. Here is the stacktrace:

matterbridge_1 | panic: runtime error: invalid memory address or nil pointer dereference
matterbridge_1 | [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7f5341d35d6b]
matterbridge_1 | 
matterbridge_1 | goroutine 6 [running]:
matterbridge_1 | panic(0x7f534239d1a0, 0xc42000c050)
matterbridge_1 |    /usr/lib/go/src/runtime/panic.go:500 +0x1a5
matterbridge_1 | github.com/42wim/matterbridge/bridge/slack.(*Bslack).SendType(0xc4201015e0, 0xc4203bb3d8, 0x8, 0xc4203c6570, 0x28, 0xc4203f4610, 0xb, 0x0, 0x0, 0x0, ...)
matterbridge_1 |    /go/src/github.com/42wim/matterbridge/bridge/slack/slack.go:118 +0x29b
matterbridge_1 | github.com/42wim/matterbridge/bridge/slack.(*Bslack).Send(0xc4201015e0, 0xc420403620, 0x1f, 0xc4203f4610, 0xb, 0xc4203bb3d8, 0x8, 0xc4201281ab, 0x8, 0xc4203dea20, ...)
matterbridge_1 |    /go/src/github.com/42wim/matterbridge/bridge/slack/slack.go:96 +0x1ca
matterbridge_1 | github.com/42wim/matterbridge/gateway/samechannel.(*SameChannelGateway).handleMessage(0xc420041e98, 0xc420403620, 0x1f, 0xc4203f4610, 0xb, 0xc4203bb3d8, 0x8, 0xc4201281ab, 0x8, 0xc4203dea20, ...)
matterbridge_1 |    /go/src/github.com/42wim/matterbridge/gateway/samechannel/samechannel.go:63 +0x24e
matterbridge_1 | github.com/42wim/matterbridge/gateway/samechannel.(*SameChannelGateway).handleReceive(0xc420041e98, 0xc420050c60)
matterbridge_1 |    /go/src/github.com/42wim/matterbridge/gateway/samechannel/samechannel.go:50 +0x116
matterbridge_1 | github.com/42wim/matterbridge/gateway/samechannel.New(0xc420050a80, 0xc420011400, 0x0, 0x0)
matterbridge_1 |    /go/src/github.com/42wim/matterbridge/gateway/samechannel/samechannel.go:41 +0x5bb
matterbridge_1 | main.main.func1(0xc420050a80, 0xc420128020, 0xf, 0x1, 0xc420101340, 0x7, 0x7, 0xc420128ec0, 0x2, 0x2)
matterbridge_1 |    /go/src/github.com/42wim/matterbridge/matterbridge.go:40 +0x84
matterbridge_1 | created by main.main
matterbridge_1 |    /go/src/github.com/42wim/matterbridge/matterbridge.go:44 +0x5c5

Unable to use "<{NICK}> " in RemoteNickFormat for IRC

I'm using matterbridge (0.6.0-beta2) for mattermost <-> IRC. It's working nicely except for one thing.

I wanted to set my own RemoteNickFormat in [IRC] section of matterbridge.conf, but when I've specified my selected format then the messages from mattermost were not shown on IRC.

After some tests I've noticed that when my configuration is:

RemoteNickFormat="{NICK}: "

then everything works and messages are passed correctly, but when it's:

RemoteNickFormat="<{NICK}> "

then the messages are not shown.

Automatically sync rooms

I love the new samechannelgateway configuration, it reduces the amount of configuration needed to sync many channels across platforms.

The next way it could get even better is if channels of the same name were automatically synced if the bot is invited to join them. This way I would never have to update my configuration file once I'd added the bot to a particular platform.

Multiple incomingwebhook URLs for multichannel config

The sample configuration shows how to configure multiple channels with seperate outgoingwebhook tokens. But there is only one incomingwebhook url in [mattermost]. The problem is, that each channel has it's own URL in Mattermost.

How do we configure seperate URLs?

Gitter <-> IRC exploit: arbitrary command execution

One of my channel user found this exploit:
" (empty newline)
PRIVMSG someone message"
It can be potentially exploited to do anything, allowed in the protocol.

This seems only applies to gitter messages. Also, something is wrong with Gitter multiline handling.

Disabling the "... currently on IRC" message?

I'm finally replacing my gitter and discord bots with matterbridge. Really, really good work on it :)

Is there a way to disable the "(nick1, nick2, nick3...) currently on IRC" message? It's a bit spammy and pings people who probably don't want to be pinged.

Listen only on "localhost"

There should be a way to tell the TCP server to only listen on "localhost" instead of "all interfaces" (0.0.0.0).

charset trouble when irc to mattermost

Hi,

The plugin is great !
But i'm french and when there are accents in IRC sentences, mattermost shows strange characters.
Can you make matterbridge converting to the right charset, even if you need to create a new option in the conf file to give you the outgoing charset ?

Thanks,
Rémi

Broken after uprgade to mattermost 3.1

It seems that the matterbridge it broken after the upgrade to Mattermost 3.1:

Receiving (from IRC) works. But sending out from MM to IRC causes the following error:

Jun 23 14:12:19 ???? matterbridge[????]: 2016/06/23 14:12:19 schema: invalid path "post_id"

Trying to activate matterbridge on Framateam.org

Hello there,

I've just created a team on Framateam.org and I would like to create a channel "IRC" which is bridged with a Freenode channel.

Mattermost on Framateam.org is in version 3.3.0.

I've so tested 0.6.0-beta2 then 0.6.0-beta1 (I've also tested 0.5.0) without any success.
Here is the situation :

  • Without -plus using incoming and outgoing webhook :
    • when incoming message arriving I've the following error :
INFO[2016-09-12T20:46:07+02:00] mattermost send config.Message{Text:"@valvin, pepperbot currently on IRC", Channel:"IRC", Username:"irc-pepperbot", Origin:"irc"}  module=mattermost
INFO[2016-09-12T20:46:07+02:00] unexpected status code: 500                   module=mattermost

but when I'm using curl with the same incoming webhook it works

  • when outgoing message arriving :
2016/09/12 20:53:41 no token from 136.243.187.xxx:48183

I think there is something missing in my configuration on that point but don't find where setup token key.
I've seen something in previous version of the sample but don't succeed in porting it.

  • when using plus mode :
INFO[2016-09-12T20:56:56+02:00] Connection succeeded                          module=irc
INFO[2016-09-12T20:56:56+02:00] Trying login pepperbot (team: peppercarrot) on framasphere.org  module=mattermost
DEBU[2016-09-12T20:56:56+02:00] trying login peppercarrot pepperbot framasphere.org  module=matterclient
DEBU[2016-09-12T20:56:56+02:00] invalid character '<' looking for beginning of value  module=matterclient
DEBU[2016-09-12T20:56:56+02:00] LOGIN: AppErrorFromJson: model.utils.decode_json.app_error, invalid character '<' looking for beginning of value, reconnecting in 1s  module=matterclient
DEBU[2016-09-12T20:56:57+02:00] retrying login peppercarrot pepperbot framasphere.org  module=matterclient
DEBU[2016-09-12T20:56:57+02:00] invalid character '<' looking for beginning of value  module=matterclient
DEBU[2016-09-12T20:56:57+02:00] LOGIN: AppErrorFromJson: model.utils.decode_json.app_error, invalid character '<' looking for beginning of value, reconnecting in 1.686823072s  module=matterclient
DEBU[2016-09-12T20:56:59+02:00] retrying login peppercarrot pepperbot framasphere.org  module=matterclient
DEBU[2016-09-12T20:56:59+02:00] invalid character '<' looking for beginning of value  module=matterclient
DEBU[2016-09-12T20:56:59+02:00] LOGIN: AppErrorFromJson: model.utils.decode_json.app_error, invalid character '<' looking for beginning of value, reconnecting in 1.196911057s  module=matterclient
DEBU[2016-09-12T20:57:00+02:00] retrying login peppercarrot pepperbot framasphere.org  module=matterclient
DEBU[2016-09-12T20:57:00+02:00] invalid character '<' looking for beginning of value  module=matterclient
DEBU[2016-09-12T20:57:00+02:00] LOGIN: AppErrorFromJson: model.utils.decode_json.app_error, invalid character '<' looking for beginning of value, reconnecting in 2.095634783s  module=matterclient
DEBU[2016-09-12T20:57:02+02:00] retrying login peppercarrot pepperbot framasphere.org  module=matterclient
DEBU[2016-09-12T20:57:02+02:00] invalid character '<' looking for beginning of value  module=matterclient
DEBU[2016-09-12T20:57:02+02:00] LOGIN: AppErrorFromJson: model.utils.decode_json.app_error, invalid character '<' looking for beginning of value, reconnecting in 2.454542783s  module=matterclient
DEBU[2016-09-12T20:57:05+02:00] retrying login peppercarrot pepperbot framasphere.org  module=matterclient
DEBU[2016-09-12T20:57:05+02:00] invalid character '<' looking for beginning of value  module=matterclient
DEBU[2016-09-12T20:57:05+02:00] LOGIN: AppErrorFromJson: model.utils.decode_json.app_error, invalid character '<' looking for beginning of value, reconnecting in 10.328267678s  module=matterclient

Here is it seems having something wrong server side but unfortunately I cannot manage it but if you have any idea I can ask?

In all cases irc connects and I can see him in the channel.

Thanks for your work

Bridge doesn't work within a single team

Not sure if it is a bug at all, but for a reference the following bridge configuration results in no messages being sent at all:

[[gateway.in]]
account="mattermost1"
channel="channel1"

[[gateway.in]]
account="mattermost1"
channel="channel2"

[[gateway.out]]
account="mattermost1"
channel="channel1"

[[gateway.out]]
account="mattermost1"
channel="channel2"

Since there is hardly a relevant use case (private discussion while commenting on a public one, perhaps??), it doesn't seem to be important.

identify the user

it appears (and perhaps this is config) the bot posts all irc messages as itself - which is fine - but the original author from irc needs to be attributed. at this time, it doesnt look like this is happening.

Workaround IRC rate limit

Markdown users tend to paste multiline formatted code, which is less often in IRC. Forwading such message in batch will cause a kick with flooding, so it's better to have some slow down to workaround it.

Channel Key's

When an IRC channel is utilizing channel key's the messages don't forward between IRC and Mattermost. Messages still forward from Mattermost to IRC

Currently I specify the channel key in the IRC channel option. E.g. IRC="#ChannelName ChannelKey"

This allows the Matterbridge user to connect and I can see the messages hit the bridge but nothing seems to forward.

As soon as I remove the channel key from the IRC channel and rerun Matterbot then messages forward again from IRC to Mattermost.

Seems to sync rooms it's not supposed to?

I'm using this to implement a slack<->gitter bridge by using a bot account in Slack and a dedicated GitHub account for Gitter.

So far it works great for syncing two channels together (one on each), but to sync two more channels I'm noticing that the bot will misdirect the message and send it when it's not supposed to.

Here's the setup:

  • Initially: slackbot in 1 slack channel, A1. gitterbot in 1 gitter channel, A2.
  • Want to sync another channel (on each network), so I invite the slackbot to another slack channel, B1, and join (as the gitterbot) the other gitter channel, B2 (under the same organization).
  • I type a message (as my own user) in the new Slack channel (B1), and even though I haven't restarted matterbridge or updated it configuration to recognize either of the B channels, that message gets relayed into A2.

In fact, two messages got relayed into A2 that shouldn't have been:

<gitter> <@U2LRT44TD|gitter> has joined the channel ​
<greg> test ​

The first is a notification that I invited the Slack @gitter bot to the new channel B1, and it's sent to A2. The second is the message from B1 sent to A2.

Neither of those messages should have been relayed, as the .toml wasn't even setup to support the new B channels.

Here's the end of my .toml, and I'm using the latest 0.7.0-dev build from master at commit db0e4ba:

[[gateway]]
#OPTIONAL (not used for now)
name="gateway1"
#Enable enables this gateway
##OPTIONAL (default false)
enable=true

    #[[gateway.in]] specifies the account and channels we will receive messages from.
    #The following example bridges between mattermost and irc
    [[gateway.in]]

    #account specified above
    #REQUIRED
    account="slack.groupincome"
    #channel to connect on that account
    #REQUIRED
    channel="groupincome"

    [[gateway.in]]
    account="gitter.groupincome"
    channel="okTurtles/group-income"

    [[gateway.out]]
    account="slack.groupincome"
    channel="groupincome"

    [[gateway.out]]
    account="gitter.groupincome"
    channel="okTurtles/group-income"

Note that the above shows the configuration for A1 and A2.

make the format of the posted messages configurable

I'm running a fork right now that changes the output to match the way slack does it:

diff --git a/matterbridge.go b/matterbridge.go
index a07ab30..3369ae8 100644
--- a/matterbridge.go
+++ b/matterbridge.go
@@ -116,7 +116,7 @@ func (b *Bridge) handleMatter() {
                }
                texts := strings.Split(message.Text, "\n")
                for _, text := range texts {
-                       b.i.Privmsg(b.getIRCChannel(message.Token), message.UserName+": "+text)
+                       b.i.Privmsg(b.getIRCChannel(message.Token), "<" + message.UserName+"> "+text)
                }
        }
 }

I tried implementing this in a configurable manner but I don't know go at all and couldn't figure out how to do "default" values in config files that differentiate between wanting empty string and whatever go's equivalent of "null" would be. :)

Discord configuration

Initial feedback on Discord configuration:

  • Guild is super confusing. Although it's the terminology used internally, they're only ever called Servers.
  • I'm getting 401 unauthorized after the connection is successfully established. It's unclear why. My initial reactions are: Am I supposed to use the id for Guild, or its name? What about the channel input/output, id or name? Running with --debug didn't output anything extra for discord, other than &errors.errorString{s:"HTTP 401 Unauthorized, {\"code\": 0, \"message\": \"401: Unauthorized\"}"} module=discord, so there's probably a message being sent without it being passed to the debug printer.

matterbridge doesn't handle disconnection well

When freenode disconnects, matterbridge doesn't reconnect and it leaves the bot in a state where it's still running, but not actually bridging anymore. If it at least exited cleanly when it got disconnected, my systemd script would restart it, but instead it gets stuck.

[REQUEST] Share Public Links of files when using MatterHook

I'm currently able to share uploaded files from Mattermost to IRC through the API (Matterclient, right?), but I prefer using the MatterHook (Websockets) because it allows to me to set custom usernames and I'm able to use the (hopefully soon to be dynamic) IconURL-setting.

Is there anyway you guys could implement the public file link stuff in the MatterHook as well? It seems that someone has done it already (github.com/mattermost/mattermost/issues/2728#issuecomment-212551671), but my Go skills are to basic to do it myself.

I've tried by using the GetPost function, but someone I keep messing up and the Matterbridge keeps crashing with a pointer error and I have no idea how to even start debugging that.

m.User.TeamId undefined

Hi,

I get a build error when I try to install matterbridge

go get github.com/42wim/matterbridge
src/github.com/42wim/matterbridge-plus/matterclient/matterclient.go:189: m.User.TeamId undefined (type *model.User has no field or method TeamId)

I'm using go1.5 linux/amd64 on CentOS 7. Does Matterbridge require Go 1.6 ?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.