Matrix Telegram pupetting bridge for YunoHost
Find a file
2022-08-10 15:00:34 +01:00
.github Apply last example_ynh 2022-07-16 01:38:42 +02:00
conf Fix database_opts config invalid for postgres 2022-08-10 14:30:17 +01:00
doc Cleanup 2022-07-16 16:19:17 +02:00
scripts Remove postgres from optional deps as it is used by default now 2022-08-10 15:00:34 +01:00
check_process Apply last example_ynh 2022-07-16 01:38:42 +02:00
issue_template.md make linter even more happy 2021-09-13 20:30:45 +02:00
LICENSE Fix linter warnings 2021-09-05 14:24:10 +02:00
manifest.json Stop supporting Debian Buster require Yuno version >= 11.0.0 2022-08-10 14:20:36 +01:00
pull_request_template.md make linter even more happy 2021-09-13 20:30:45 +02:00
README.md Update version 0.11.3 2022-08-08 19:21:34 +01:00
README_fr.md Update version 0.11.3 2022-08-08 19:21:34 +01:00

Matrix-Telegram bridge for YunoHost

Integration level Working status Maintenance status
Install Matrix-Telegram bridge with YunoHost

Lire ce readme en français.

This package allows you to install Matrix-Telegram bridge quickly and simply on a YunoHost server. If you don't have YunoHost, please consult the guide to learn how to install it.

Overview

A puppeting bridge between Matrix and Telegram packaged as a YunoHost service. Messages, notifications (and sometimes media) are bridged between a Telegram user and a Matrix user. Currently the Matrix user can NOT invite other Matrix user in a bridged Telegram room, so only someone with a Telegram account can participate to Telegram group conversations. The "Mautrix-Telegram" bridge is a Synapse App Service and relies on postgresql. Therefore, Synapse for YunoHost should be installed beforehand.

List of known public services

  • Ask on one of the following rooms: #mautrix_yunohost:matrix.fdn.fr or #telegram:maunium.net

Bridging usage

** Note that several Telegram and Matrix users can be bridged, each Telegram account has its own bot administration room. If they are in a same Telegram group, only one matrix room will be created. **

Bridge a Telegram user and a Matrix user

  • First your Matrix user or Synapse Server has to be authorized in the Configuration of the bridge (see below)
  • Then, invite the bot (default @telegrambot:yoursynapse.domain) in this new Mautrix-Telegram bot administration room.
  • Send !tg help to the bot in the created room to know how to control the bot. See also upstream wiki Authentication page

Logging into Telegram account

  • Type login or login-qr (untested) in main management room (!tg in any bridge room)
  • follow setup instructions from bot
  • By defaults, only conversations with very recent messages and groups will be suggested to be bridged
  • Accept invitations to the bridged chat rooms

Registering the Bridge as a primary device (untested)

  • Type !tg register <phone>, where <phone> is your phone number in the internation format with no space, e.g. !tg register +33612345678
  • Answer in the bot room with the verification code that you reveived in SMS.
  • Set a profile name with !tg set-profile-name <name>

Double puppeting

  • Log in with login-matrix <access token>
  • After logging in, the default Matrix puppet of your Telegram account should leave rooms and your account should join all rooms the puppet was in automatically.

Relaybot: Bridge a group for several Matrix and several Telegram users to chat together

Shipped version: 0.11.3~ynh1

Disclaimers / important information

Configuration of the bridge

The bridge is roughly configured at installation, e.g. allowed admin and user of the bot. Finer configuration can be done by modifying the following configuration file with SSH: /opt/yunohost/mautrix_telegram/config.yaml and then restarting the mautrix_telegram service.

Documentation

  • Official "Mautrix-Telegram" documentation: https://docs.mau.fi/bridges/python/telegram/index.html
  • Matrix room (Matrix Bridges in Yunohost): #mautrix_yunohost:matrix.fdn.fr
  • Matrix room (upstream app): #telegram:maunium.net In case you need to upload your logs somewhere, be aware that they contain your contacts' and your phone numbers. Strip them out with | sed -r 's/[0-9]{10,}/📞/g'
  • "Mautrix-Telegram" bridge is based on the telegram daemon project.
  • YunoHost documentation: If more specific documentation is needed, feel free to contribute.

Multi-user support

  • Bot users are not related to Yunohost users. Any Matrix account or Synapse server autorized in the configuration of the bridge can invite/use the bot.
  • The Telegram bot is a local Matrix-Synapse user, but accessible through federation (synapse public or private).
  • Several Telegram and Matrix users can be bridged with one bridge, each user has its own bot administration room.
  • If several bot users are in a same Telegram group, only one Matrix room will be created by the bridge.
  • See https://github.com/YunoHost-Apps/synapse_ynh#multi-users-support

Multi-instance support

  • Multi-instance installation should work. Several bridge instances could be installed for one Matrix-Synapse instance so that one Matrix user can bridge several Telegram accounts.
  • Several bridge instances could be installed for each Matrix-Synapse instance to benefit from it. But one bridge can be used by users from several Matrix-Synapse instances.

Troubleshooting

  • Check the spelling of the bot name!
  • For slow servers it might be necessary to run systemctl edit mautrix_telegram.service (also for coturn.service and coturn-synapse.service) and insert
[Service]
ExecStartPre=/bin/sleep 90

such that it is ensured that synapse is running before the bridge tries to connect. (If it worked after installation but broke after a restart this probably is it.)

Documentation and resources

Developer info

Please send your pull request to the testing branch.

To try the testing branch, please proceed like that.

sudo yunohost app install https://github.com/YunoHost-Apps/mautrix_telegram_ynh/tree/testing --debug
or
sudo yunohost app upgrade mautrix_telegram -u https://github.com/YunoHost-Apps/mautrix_telegram_ynh/tree/testing --debug

More info regarding app packaging: https://yunohost.org/packaging_apps