2021-09-13 20:26:32 +02:00
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# Matrix-Telegram bridge for YunoHost
2021-03-24 22:49:07 +01:00
2022-05-29 17:44:59 +02:00
[![Integration level ](https://dash.yunohost.org/integration/mautrix_telegram.svg )](https://dash.yunohost.org/appci/app/mautrix_telegram) ![Working status ](https://ci-apps.yunohost.org/ci/badges/mautrix_telegram.status.svg ) ![Maintenance status ](https://ci-apps.yunohost.org/ci/badges/mautrix_telegram.maintain.svg )
2021-09-13 20:26:32 +02:00
[![Install Matrix-Telegram bridge with YunoHost ](https://install-app.yunohost.org/install-with-yunohost.svg )](https://install-app.yunohost.org/?app=mautrix_telegram)
2021-03-24 22:49:07 +01:00
*[Lire ce readme en français.](./README_fr.md)*
2021-09-13 20:26:32 +02:00
> *This package allows you to install Matrix-Telegram bridge quickly and simply on a YunoHost server.
2021-03-24 22:49:07 +01:00
If you don't have YunoHost, please consult [the guide ](https://yunohost.org/#/install ) to learn how to install it.*
## Overview
2021-09-13 20:26:32 +02:00
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" ](https://docs.mau.fi/bridges/python/telegram/index.html ) bridge is a Synapse App Service and relies on postgresql. Therefore, [Synapse for YunoHost ](https://github.com/YunoHost-Apps/synapse_ynh ) should be installed beforehand.
2021-03-24 22:49:07 +01:00
2022-09-04 23:58:52 +02:00
2022-12-02 16:40:16 +01:00
**Shipped version:** 0.12.2~ynh3
2022-09-04 23:58:52 +02:00
## Disclaimers / important information
2021-03-24 22:49:07 +01:00
## List of known public services
2022-09-04 23:58:52 +02:00
2021-02-22 13:21:58 +01:00
* Ask on one of the following rooms: #mautrix_yunohost:matrix .fdn.fr or #telegram:maunium .net
2021-03-24 22:49:07 +01:00
## Bridging usage
2021-02-22 13:21:58 +01:00
** 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. **
2021-03-24 22:49:07 +01:00
2021-02-22 13:21:58 +01:00
### Bridge a Telegram user and a Matrix user
2021-03-24 22:49:07 +01:00
* First your Matrix user or Synapse Server has to be authorized in the Configuration of the bridge (see below)
2021-02-22 13:21:58 +01:00
* Then, invite the bot (default @telegrambot:yoursynapse .domain) in this new Mautrix-Telegram bot administration room.
2021-03-24 22:49:07 +01:00
* If the Bot does bot accept, see the [troubleshooting page ](https://docs.mau.fi/bridges/general/troubleshooting.html )
2021-02-22 13:21:58 +01:00
* Send ``!tg help`` to the bot in the created room to know how to control the bot.
See also [upstream wiki Authentication page ](https://docs.mau.fi/bridges/python/telegram/authentication.html )
#### 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
2021-03-24 22:49:07 +01:00
* Accept invitations to the bridged chat rooms
2021-09-13 20:26:32 +02:00
2021-02-22 13:21:58 +01:00
#### 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``
2021-03-24 22:49:07 +01:00
* Answer in the bot room with the verification code that you reveived in SMS.
2021-02-22 13:21:58 +01:00
* Set a profile name with ``!tg set-profile-name < name > ``
2021-03-24 22:49:07 +01:00
### Double puppeting
* Log in with ``login-matrix < access token > ``
2021-02-22 13:21:58 +01:00
* 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.
2021-03-24 22:49:07 +01:00
2021-02-22 13:21:58 +01:00
### Relaybot: Bridge a group for several Matrix and several Telegram users to chat together
2021-09-13 20:26:32 +02:00
* see https://docs.mau.fi/bridges/python/telegram/relay-bot.html
2022-09-04 23:58:52 +02:00
## Configuration of the bridge
2021-03-24 22:49:07 +01:00
2021-02-22 13:21:58 +01:00
The bridge is [roughly configured at installation ](https://github.com/YunoHost-Apps/mautrix_telegram_ynh/blob/master/conf/config.yaml ), e.g. allowed admin and user of the bot. Finer configuration can be done by modifying the
2021-03-24 22:49:07 +01:00
following configuration file with SSH:
2021-02-22 13:21:58 +01:00
```/opt/yunohost/mautrix_telegram/config.yaml```
and then restarting the mautrix_telegram service.
2021-03-24 22:49:07 +01:00
2022-09-04 23:58:52 +02:00
## Documentation
2021-03-24 22:49:07 +01:00
2021-02-22 13:21:58 +01:00
* Official "Mautrix-Telegram" documentation: https://docs.mau.fi/bridges/python/telegram/index.html
2021-03-24 22:49:07 +01:00
* Matrix room (Matrix Bridges in Yunohost): #mautrix_yunohost:matrix .fdn.fr
2021-02-22 13:21:58 +01:00
* Matrix room (upstream app): #telegram:maunium .net
2021-03-24 22:49:07 +01:00
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' ``
2021-02-22 13:21:58 +01:00
* "Mautrix-Telegram" bridge is based on the [telegram daemon ](https://gitlab.com/telegramd/telegramd ) project.
2021-03-24 22:49:07 +01:00
* YunoHost documentation: If more specific documentation is needed, feel free to contribute.
2022-09-04 23:58:52 +02:00
## YunoHost specific features
2021-03-24 22:49:07 +01:00
#### 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.
2021-02-22 13:21:58 +01:00
* 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.
2021-03-24 22:49:07 +01:00
* See https://github.com/YunoHost-Apps/synapse_ynh#multi-users-support
#### Multi-instance support
2021-02-22 13:21:58 +01:00
* 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.
2021-03-24 22:49:07 +01:00
* 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.
2022-09-04 23:58:52 +02:00
## Troubleshooting
2021-03-24 22:49:07 +01:00
2021-02-22 13:21:58 +01:00
* 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.)
2021-03-24 22:49:07 +01:00
2021-09-13 20:26:32 +02:00
## Documentation and resources
2021-03-24 22:49:07 +01:00
2022-05-29 17:44:59 +02:00
* Official app website: < https: // docs . mau . fi / bridges / python / telegram / index . html >
* Official user documentation: < https: // docs . mau . fi / bridges / python / telegram / management-commands . html >
* Official admin documentation: < https: // github . com / YunoHost-Apps / mautrix_telegram_ynh >
* Upstream app code repository: < https: // github . com / mautrix / telegram >
* YunoHost documentation for this app: < https: // yunohost . org / app_mautrix_telegram >
* Report a bug: < https: // github . com / YunoHost-Apps / mautrix_telegram_ynh / issues >
2021-03-24 22:49:07 +01:00
## Developer info
2021-02-22 13:21:58 +01:00
Please send your pull request to the [testing branch ](https://github.com/YunoHost-Apps/mautrix_telegram_ynh/tree/testing ).
2021-03-24 22:49:07 +01:00
To try the testing branch, please proceed like that.
2022-05-29 17:44:59 +02:00
``` bash
2021-02-22 13:21:58 +01:00
sudo yunohost app install https://github.com/YunoHost-Apps/mautrix_telegram_ynh/tree/testing --debug
2021-03-24 22:49:07 +01:00
or
2021-02-22 13:21:58 +01:00
sudo yunohost app upgrade mautrix_telegram -u https://github.com/YunoHost-Apps/mautrix_telegram_ynh/tree/testing --debug
2021-03-24 22:49:07 +01:00
```
2022-12-02 16:40:16 +01:00
The `.github/workflows/updater.sh` script needs to be synced with changes in `conf/config.yaml` so for now a `pre-commit`
hook is used to display a reminder to update `.github/workflows/updater.sh` (if needed) when `conf/config.yaml` has been modified.
Please enable Git hooks using following command to ensure code quality and stability.
``` bash
git config --local core.hooksPath .githooks
```
2022-05-29 17:44:59 +02:00
**More info regarding app packaging:** < https: / / yunohost . org / packaging_apps >