Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

5.1 KiB

Setting up Mautrix Telegram bridging (optional)

Refer the common guide for configuring mautrix bridges: Setting up a Generic Mautrix Bridge

The playbook can install and configure mautrix-telegram for you.

See the project’s documentation to learn what it does and why it might be useful to you.

Prerequisites

Obtain a Telegram API key

To use the bridge, you’d need to obtain an API key from https://my.telegram.org/apps.

Enable Appservice Double Puppet (optional)

If you want to set up Double Puppeting (hint: you most likely do) for this bridge automatically, you need to have enabled Appservice Double Puppet service for this playbook.

See this section on the common guide for configuring mautrix bridges for details about setting up Double Puppeting.

Adjusting the playbook configuration

To enable the bridge, add the following configuration to your inventory/host_vars/matrix.example.com/vars.yml file. Make sure to replace YOUR_TELEGRAM_APP_ID and YOUR_TELEGRAM_API_HASH.

matrix_mautrix_telegram_enabled: true
matrix_mautrix_telegram_api_id: YOUR_TELEGRAM_APP_ID
matrix_mautrix_telegram_api_hash: YOUR_TELEGRAM_API_HASH

Relaying

This bridge supports the common mautrix bridge relay mode. Once enabled, any authenticated user can be turned into a relaybot for a chat by sending !tg set-relay in that chat.

Configure a user as an administrator of the bridge (optional)

You might also want to give permissions to a user to administrate the bot. See this section on the common guide for details about it.

Extending the configuration

There are some additional things you may wish to configure about the bridge.

See this section on the common guide for configuring mautrix bridges for details about variables that you can customize and the bridge’s default configuration, including bridge permissions, encryption support, bot’s username, etc.

Installing

After configuring the playbook, run it with playbook tags as below:

ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start

The shortcut commands with the just program are also available: just install-all or just setup-all

just install-all is useful for maintaining your setup quickly (2x-5x faster than just setup-all) when its components remain unchanged. If you adjust your vars.yml to remove other components, you’d need to run just setup-all, or these components will still remain installed. Note these shortcuts run the ensure-matrix-users-created tag too.

Usage

To use the bridge, you need to start a chat with @telegrambot:example.com (where example.com is your base domain, not the matrix. domain).

You can then follow instructions on the bridge’s official documentation on Authentication.

After logging in, the bridge will create portal rooms for all of your Telegram groups and invite you to them.

Troubleshooting

As with all other services, you can find the logs in systemd-journald by logging in to the server with SSH and running journalctl -fu matrix-mautrix-telegram.

Increase logging verbosity

The default logging level for this component is warn. If you want to increase the verbosity, add the following configuration to your vars.yml file and re-run the playbook:

# Valid values: fatal, error, warn, info, debug, trace
matrix_mautrix_telegram_logging_level: debug