An inline buildpack for deploying a mattermost-irc bridge

Matterbridge-Heroku

Deploy

An inline buildpack for hosting Matterbridge on Heroku.

Heroku is a platform for easily deploying applications.

A buildpack provides framework and runtime support for apps running on platforms like Heroku.

An inline buildpack is a special buildpack that includes code for both the app and the buildpack that runs the app.

Matterbridge is a simple bridge that can relay messages between a number of different chat services, essentially connecting separate chat tools.

This repo includes a custom config file specific to a sample implementation, but this is intended to be modified in your own fork.

Configuration

Configuration happens via environment variables and a configuration template file.

Environment: Buildpack

  • MATTERBRIDGE_VERSION Required. Use a matterbridge git tag.
  • MATTERBRIDGE_URL Optional. Use this to download the binary from a custom url instead of the tagged release from the official GitHub repo. (Setting this makes MATTERBRIDGE_VERSION ignored.)

Environment: Matterbridge

Matterbridge has some configuration of its own, which is mostly documented upstream. For starters, we'll review the most important aspects:

  • DEBUG. Set to "1" to log all message events across bridges.

Matterbridge uses Viper, and so each value in the TOML configuration can be set by envvar.

Basically, here are the rules:

  • Each config envvar is prefixed with MATTERBRIDGE_.
  • Each nested level of config object is separated by an underscore _.
  • Any dash in a config key is converted to an underscore _.

So for example, with this in your TOML config:

[slack.my-team]
Token="xoxp-xxxxxxxxxxxxxxxxxxxxxxxxxxx"

You could instead set an environment variable for MATTERBRIDGE_SLACK_MY_TEAM_TOKEN and leave that key out of in the configuration file template.

Template: Matterbridge

Owner
Christopher DeCairos
Senior Software Engineer
Christopher DeCairos
Comments
  • Consider bringing on a co-maintainer

    Consider bringing on a co-maintainer

    Hi @cadecairos! I feel like you might be a bit busy with other projects. I totally understand that :)

    Any chance I could help tidy up and manage the issue queue? I'd be happy to agree that we only merge with +1's, or some other protocol.

    Push access would let me merge PRs

    Thanks!

  • Use envvars rather than custom token replacement

    Use envvars rather than custom token replacement

    Seems that viper allows envvars to be used for privileged keys, so no need to do that custom envvar stuff here :)

    Related: https://github.com/42wim/matterbridge/issues/546

  • Allow download location to be overriden

    Allow download location to be overriden

    Hey, just wanted to say that I really appreciate your project, and wanted to upstream a few things, if you're ok with it :)

    Rationale: So that people can more easily use the development binaries that @42wim offers, or host their own while waiting for a new release :)

    https://github.com/patcon/matterbridge-heroku/blob/17a305db307488b28bf5a3b9b84969a1a2dd5eef/bin/compile

    Will happily submit PR with your :+1:

  • Improve the compile bin in buildpack

    Improve the compile bin in buildpack

    • Export all envvars (excluding Heroku-recommended blacklist)
    • Allow latest release version to be detected and set. (default)
    • When MATTERBRIDGE_VERSION provided, fetch specific release from GitHub.
    • When MATTERBRIDGE_VERSION not provided, fetch latest release from GitHub.
    • When MATTERBRIDGE_URL provided, fetch binary from custom location.
  • Heroku build failure with `cat: /tmp/<env_dir>/PORT: No such file or directory`

    Heroku build failure with `cat: /tmp//PORT: No such file or directory`

    So far I'm getting a build failure with this output, after I click the "Deploy" button in Heroku.

    Output:

    -----> Building on the Heroku-20 stack
    -----> Using buildpack: http://github.com/chrisbobbe/matterbridge-heroku.git#master
    -----> Matterbridge app detected
    cat: /tmp/d20210518-50-1ta64pb/PORT: No such file or directory
     !     Push rejected, failed to compile Matterbridge app.
     !     Push failed
    

    It seems to be fixed without causing problems for my use case (a Zulip <-> Slack bridge) if I comment out this line in bin/support/bash_functions.sh; the line was added in 0665e388bcb586f4d7a89dbc2fcb826e99d99a22:

      if [ -d "$env_dir" ]; then
        for e in $(ls $env_dir); do
    -     PORT="$(cat $env_dir/PORT)"
    +     # PORT="$(cat $env_dir/PORT)"
          echo "$e" | grep -E "$whitelist_regex" | grep -qvE "$blacklist_regex" &&
            port_unexpanded=$(echo "$e=$(cat $env_dir/$e)") &&
            port_expanded=$(eval "echo $port_unexpanded") &&
            export $port_expanded
          :
        done
      fi
    

    Does that seem like a good workaround, or can I expect things to go wrong in mysterious ways? Would it be better to revert 0665e388bcb586f4d7a89dbc2fcb826e99d99a22 entirely? I don't really know what that code is doing, and I haven't been able to determine why $env_dir/PORT might ever exist.

  • Add instructions for running and serving from web process

    Add instructions for running and serving from web process

    So that we can use the API and endpoints.

    Would migrate over stuff from here: https://github.com/patcon/matterbridge-heroku#using-api-endpoints

    I'll wait until we get the other PRs in

Powered by Matterbridge, MatterAMXX is a plugin for AMXX that allows simple bridging between your game servers, Mattermost, IRC, XMPP, Gitter, Slack, Discord, Telegram, and more.
Powered by Matterbridge, MatterAMXX is a plugin for AMXX that allows simple bridging between your game servers, Mattermost, IRC, XMPP, Gitter, Slack, Discord, Telegram, and more.

Powered by Matterbridge, MatterAMXX is a plugin for AMXX that allows simple bridging between your game servers, Mattermost, IRC, XMPP, Gitter, Slack, Discord, Telegram, and more.

Dec 27, 2022
Apex-api-bridge - Bridge between apexlegendsapi and ApeStats

apex-api-sync This app updates a mongo instance with the players most recent dat

Feb 17, 2022
Matterbridge mattermost plugin

mattermost-plugin Matterbridge mattermost plugin WIP Configuration You have to create a matterbridge.toml configuration file before running make. Beca

Dec 11, 2022
The plugin serves as a starting point for writing a Mattermost plugin

Plugin Starter Template This plugin serves as a starting point for writing a Mattermost plugin. Feel free to base your own plugin off this repository.

Dec 10, 2021
MBotC plugin for Mattermost

Plugin Starter Template This plugin serves as a starting point for writing a Mattermost plugin. Feel free to base your own plugin off this repository.

Feb 28, 2022
Slash command for Slack/Mattermost to post punch lines
Slash command for Slack/Mattermost to post punch lines

Slash command pro milujipraci.cz This project is by its nature dedicated to czech or slovak speaking users, so I suggest you to either learn Czech or

Jan 18, 2022
A reverse proxy implementing IRC-over-WebSockets

webircproxy webircproxy is a reverse proxy that accepts IRCv3-over-WebSocket connections, then forwards them to a conventional ircd that speaks the no

Dec 22, 2021
IRC bot for launch ddos attack, Mainly of scan target are IoT device that run linux and open default SSH port
IRC bot for launch ddos attack, Mainly of scan target are IoT device that run linux and open default SSH port

IRC bot for launch ddos attack, Mainly of scan target are IoT device that run linux and open default SSH port

Nov 10, 2021
girc is a flexible IRC library for Go
girc is a flexible IRC library for Go

girc, a flexible IRC library for Go Status girc is fairly close to marking the 1.0.0 endpoint, which will be tagged as necessary, so you will be able

Dec 19, 2022
A Matrix-iMessage puppeting bridge

A Matrix-iMessage puppeting bridge. The bridge runs on a Mac or jailbroken iPhone (soon™). A websocket proxy is required to receive appservice events from the homeserver.

Jan 2, 2023
vks is a Vulkan bridge for Go.

vks vks is a Vulkan bridge for Go. The header generator folder contains the code that is used to generate the vulkan bindings. It woks similar to c-fo

Sep 3, 2022
Bridge facebook messenger with any service supported by matterbridge

fbridge fbridge bridges facebook messenger with any service supported by matterbridge trough the API interface. fbridge is using fbchat to connect to

Oct 30, 2022
Facebook bridge used with matterbridge

fbridge-asyncio This repo is a fork of fbridge. If you log in to your facebook account from a browser, after you do, it's a good idea to restart fbrid

Aug 7, 2022
Grpc bridge to various mediabank related systems

Mediabank bridge This internal tool enables authenticated gRPC based endpoint for securely communicating with systems like: Telestream Vantage Workflo

Jan 7, 2022
Bridge REMOV will allow you to safely transfer NFT from RMRK to MOVR and backwards

remov Inspiration Our aim is to expand the capabilities of blockchain and make a secure way for transferring NFT between RMRK and MOVR blockchain. The

Dec 5, 2021
Celestia -> EVM bridge

Peggo Peggo is a Go implementation of the Peggy (Gravity Bridge) Orchestrator originally implemented by Injective Labs. Peggo itself is a fork of the

Dec 12, 2022
A REST API for the DN42 registry, written in Go, to provide a bridge between interactive applications and the registry.

dn42regsrv A REST API for the DN42 registry, written in Go, to provide a bridge between interactive applications and registry data. A public instance

Apr 21, 2022
The official repository of the Gravity Bridge Blockchain

Gravity bridge is Cosmos <-> Ethereum bridge designed to run on the Cosmos SDK blockchains like the Cosmos Hub focused on maximum design simplicity an

Dec 27, 2022
A bridge from the Stellar network to other blockchains
A bridge from the Stellar network to other blockchains

Creating equitable access to the global financial system Starbridge Starbridge is software that facilitates bridge builders who are connecting the Ste

Dec 9, 2022