Telegram bridge for Matrix (#33)

mautrix-telegram. Telegram bridge for Matrix. Closes #31.

Reviewed-on: #33
This commit is contained in:
Alexey Skobkin 2022-03-25 04:07:30 +03:00
parent 0f251d2131
commit 233bd0b700
6 changed files with 78 additions and 2 deletions

View file

@ -0,0 +1,12 @@
# see https://mau.dev/mautrix/telegram/
IMAGE_VERSION=latest
HOST_USER=1337
HOST_GROUP=1337
# Do not modify unless you know what you're doing!
# It is used by 'synapse' stack.
#HOST_DATA_DIR=./data
LOG_MAX_SIZE=5m
LOG_MAX_FILE=5

View file

@ -0,0 +1,16 @@
# Telegram Bridge for Matrix
## Create internal network for Matrix services
You should've created this network while setting up [synapse](../synapse/README.md). But if you didn't, then do it
before trying to run this stack:
```shell
docker network create --internal matrix
```
## Bridge setup documentation
- https://docs.mau.fi/bridges/python/setup/docker.html?bridge=telegram
- https://docs.mau.fi/bridges/general/registering-appservices.html
- https://docs.mau.fi/bridges/python/telegram/relay-bot.html (optional)

2
mautrix-telegram/data/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/*
!/.gitignore

View file

@ -0,0 +1,30 @@
# https://mau.dev/mautrix/telegram/
version: '3.7'
services:
mautrix-telegram:
image: "dock.mau.dev/mautrix/telegram:${IMAGE_VERSION:-latest}"
container_name: mautrix-telegram
volumes:
# This volume is also used by 'synapse' stack.
# Do not change the path unless you know what you're doing.
- "${HOST_DATA_DIR:-./data}:/data"
env_file: .env
environment:
UID: "${HOST_USER:-1337}"
GID: "${HOST_GROUP:-1337}"
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- default
- matrix
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "${LOG_MAX_SIZE:-5m}"
max-file: "${LOG_MAX_FILE:-5}"
networks:
matrix:
external: true

View file

@ -1,6 +1,12 @@
# [Synapse](https://matrix.org/docs/projects/server/synapse) ([Matrix.org](https://matrix.org/) server)
# Generating server configuration
## Create internal network for Matrix services
```shell
docker network create --internal matrix
```
## Generate server configuration
Do not forget to prepare `.env` file before running this.
@ -15,7 +21,7 @@ If you want to use full-fledged PostgreSQL instead of SQLite, you can check
To use PostgreSQL running on the host machine, use [this](../_docs/access_database_on_host_from_docker.md) configuration.
# Running the server
## Run the server
```shell
docker-compose up -d

View file

@ -15,10 +15,20 @@ services:
- "${DATA_PATH:-./data}:/data"
# SSL certs directory
- "${SSL_PATH:-./ssl}:/ssl:ro"
# Bridges
# Telegram
- "../mautrix-telegram/data:/bridges/mautrix-telegram/data:ro"
env_file: .env
networks:
- default
- matrix
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "${LOG_MAX_SIZE:-5m}"
max-file: "${LOG_MAX_FILE:-5}"
networks:
matrix:
external: true