Compare commits

...

19 Commits

Author SHA1 Message Date
c1e59b8b63
push to f6cb26f7
Some checks failed
Build Multiarch Container Image / call-reusable-workflow (push) Failing after 1h2m40s
2024-05-27 13:21:42 +02:00
465e258968
ipv6 is not well supported so far
Some checks failed
Build Multiarch Container Image / call-reusable-workflow (push) Failing after 3h12m51s
2024-04-22 21:52:24 +02:00
6f4dfc6e92
push to 0.15.1
Some checks failed
Build Multiarch Container Image / call-reusable-workflow (push) Has been cancelled
2024-01-02 11:56:36 +01:00
915ea9eb02
push to 0.14.2 2023-09-26 18:01:29 +02:00
aad509a99a
push to 23ec691128d30545c208c06eb4805443e292eb23 2023-09-22 11:45:17 +02:00
637b01c2d1
push to 23ec6911 2023-07-31 11:52:43 +02:00
6b3b7b143d
use /sync for encryption data 2023-04-06 13:35:17 +02:00
f0bd0e452b
push to 59ab7be28353b99f41eb18c3baee14355257ae16 2023-04-06 11:11:56 +02:00
77b274973e
allow key sharing 2022-11-24 08:39:10 +01:00
00f1128297
push to 24b33845 2022-11-24 08:27:49 +01:00
dbad285bff
try to listen on ipv6 as well 2022-11-20 14:11:32 +01:00
5048243b66
update config file 2022-11-18 10:40:42 +01:00
8712844944
update config file 2022-11-18 10:36:35 +01:00
4c2a8068d9 push to 5558fc7157361e3c7f721fc7c82a1d5a084a96de 2022-11-18 09:40:29 +01:00
67f799c658 add relay bot token var 2022-11-18 09:40:29 +01:00
b94e090a8b Add '.woodpecker.yml' 2022-11-11 07:31:58 +00:00
bfff34243e Delete '.gitlab-ci.yml' 2022-11-11 07:31:16 +00:00
1b81c0a110
update configuration file 2022-08-25 10:47:27 +02:00
47190fcaa2
push to version e3a067c 2022-08-18 10:16:00 +02:00
5 changed files with 264 additions and 143 deletions

View File

@ -0,0 +1,12 @@
name: Build Multiarch Container Image
on: [push]
jobs:
call-reusable-workflow:
uses: container/multiarch-build-workflow/.gitea/workflows/build.yaml@main
with:
repository: ${{ gitea.repository }}
ref_name: ${{ gitea.ref_name }}
sha: ${{ gitea.sha }}
registry_url: ${{ secrets.REGISTRY_URL }}
registry_user: ${{ secrets.REGISTRY_USER }}
registry_pw: ${{ secrets.REGISTRY_PW }}

View File

@ -1,20 +0,0 @@
variables:
CONTAINER_NAME: thallian/matrix-appservice-telegram
build:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(printf "%s:%s" "$CI_REGISTRY_USER" "$CI_REGISTRY_PASSWORD" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
- >-
/kaniko/executor
--cache=false
--context "$CI_PROJECT_DIR"
--dockerfile "$CI_PROJECT_DIR/Dockerfile"
--destination "$CONTAINER_NAME:$CI_COMMIT_SHA"
--destination "$CONTAINER_NAME:$CI_COMMIT_REF_NAME"
--destination "$CONTAINER_NAME:latest"

View File

@ -1,6 +1,4 @@
FROM docker.io/alpine:3.16 as builder FROM docker.io/alpine:3.20 as builder
ENV VERSION=86658715022a97062b4a814c4531fc3955f6cbc5
RUN apk --no-cache add \ RUN apk --no-cache add \
sed \ sed \
@ -10,13 +8,13 @@ RUN apk --no-cache add \
musl-dev \ musl-dev \
libffi-dev \ libffi-dev \
python3-dev \ python3-dev \
rust \
cargo \
py3-pip \ py3-pip \
py3-wheel \ py3-wheel \
py3-brotli \
py3-olm \ py3-olm \
py3-qrcode \ py3-qrcode \
py3-pillow \ py3-pillow \
py3-phonenumbers \
py3-unpaddedbase64 \ py3-unpaddedbase64 \
py3-pycryptodome \ py3-pycryptodome \
py3-pyaes \ py3-pyaes \
@ -28,28 +26,22 @@ RUN apk --no-cache add \
py3-numpy \ py3-numpy \
py3-future \ py3-future \
py3-asn1 \ py3-asn1 \
py3-ruamel.yaml \
py3-magic \ py3-magic \
py3-commonmark \ py3-commonmark \
py3-aiohttp \
py3-yarl \ py3-yarl \
py3-mako \ py3-mako
py3-setuptools
#RUN git clone -b v0.25.0 --recursive https://github.com/MagicStack/asyncpg.git ENV VERSION=f6cb26f7f53089488e085b45add5303fa283dc3e
#WORKDIR /asyncpg
#RUN sed -ie '1,3d' pyproject.toml
#RUN python3 setup.py install --prefix=/install
#RUN pip3 install --prefix=/install mautrix-telegram[all]==$VERSION
RUN git clone https://github.com/mautrix/telegram.git RUN git clone https://github.com/mautrix/telegram.git
WORKDIR /telegram WORKDIR /telegram
RUN git checkout "$VERSION" RUN git checkout "$VERSION"
RUN pip3 install --prefix=/install --upgrade -r requirements.txt RUN pip3 install --prefix=/install --upgrade -r requirements.txt
RUN cp -r mautrix_telegram /install/lib/python3.10/site-packages/ RUN pip3 install --prefix=/install --upgrade -r optional-requirements.txt
RUN cp -r mautrix_telegram /install/lib/python3.12/site-packages/
FROM docker.io/thallian/confd-env:3.16 FROM docker.io/thallian/confd-env:3.20-3.1.6.2
ENV FFMPEG_BINARY=/usr/bin/ffmpeg ENV FFMPEG_BINARY=/usr/bin/ffmpeg
@ -87,7 +79,7 @@ RUN apk --no-cache add \
py3-mako \ py3-mako \
py3-setuptools py3-setuptools
ENV PYTHONPATH=/usr/lib/python3.10/site-packages:/py-pkgs/lib/python3.10/site-packages/ ENV PYTHONPATH=/usr/lib/python3.12/site-packages:/py-pkgs/lib/python3.12/site-packages/
WORKDIR /var/lib/matrix-bridge WORKDIR /var/lib/matrix-bridge
@ -99,4 +91,3 @@ RUN chown -R matrix-bridge:matrix-bridge /var/lib/matrix-bridge
ENV HOME /var/lib/matrix-bridge ENV HOME /var/lib/matrix-bridge
EXPOSE 8080 EXPOSE 8080

View File

@ -31,5 +31,10 @@ Telegram API hash (https://my.telegram.org/apps).
## ADMIN_USER ## ADMIN_USER
Matrix id of the admin user. Matrix id of the admin user.
## BOT_TOKEN
- default: disabled
Token for the relay bot.
# Ports # Ports
- 8080 - 8080

View File

@ -1,4 +1,3 @@
# Homeserver details
homeserver: homeserver:
# The address that this appservice can use to connect to the homeserver. # The address that this appservice can use to connect to the homeserver.
address: {{ getenv "SERVER_URL" }} address: {{ getenv "SERVER_URL" }}
@ -7,7 +6,9 @@ homeserver:
# Whether or not to verify the SSL certificate of the homeserver. # Whether or not to verify the SSL certificate of the homeserver.
# Only applies if address starts with https:// # Only applies if address starts with https://
verify_ssl: true verify_ssl: true
asmux: false # What software is the homeserver running?
# Standard Matrix homeservers like Synapse, Dendrite and Conduit should just use "standard" here.
software: standard
# Number of retries for all HTTP requests if the homeserver isn't reachable. # Number of retries for all HTTP requests if the homeserver isn't reachable.
http_retry_count: 4 http_retry_count: 4
# The URL to push real-time bridge status to. # The URL to push real-time bridge status to.
@ -16,6 +17,9 @@ homeserver:
status_endpoint: null status_endpoint: null
# Endpoint for reporting per-message status. # Endpoint for reporting per-message status.
message_send_checkpoint_endpoint: null message_send_checkpoint_endpoint: null
# Whether asynchronous uploads via MSC2246 should be enabled for media.
# Requires a media repo that supports MSC2246.
async_media: false
# Application service host/registration related details # Application service host/registration related details
# Changing these values requires regeneration of the registration. # Changing these values requires regeneration of the registration.
@ -35,13 +39,14 @@ appservice:
# The full URI to the database. SQLite and Postgres are supported. # The full URI to the database. SQLite and Postgres are supported.
# Format examples: # Format examples:
# SQLite: sqlite:///filename.db # SQLite: sqlite:filename.db
# Postgres: postgres://username:password@hostname/dbname # Postgres: postgres://username:password@hostname/dbname
database: {{ getenv "DATABASE_DATASOURCE"}} database: {{ getenv "DATABASE_DATASOURCE"}}
# Additional arguments for asyncpg.create_pool() or sqlite3.connect() # Additional arguments for asyncpg.create_pool() or sqlite3.connect()
# https://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.pool.create_pool # https://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.pool.create_pool
# https://docs.python.org/3/library/sqlite3.html#sqlite3.connect # https://docs.python.org/3/library/sqlite3.html#sqlite3.connect
# For sqlite, min_size is used as the connection thread pool size and max_size is ignored. # For sqlite, min_size is used as the connection thread pool size and max_size is ignored.
# Additionally, SQLite supports init_commands as an array of SQL queries to run on connect (e.g. to set PRAGMAs).
database_opts: database_opts:
min_size: 1 min_size: 1
max_size: 10 max_size: 10
@ -56,7 +61,7 @@ appservice:
prefix: /public prefix: /public
# The base URL where the public-facing endpoints are available. The prefix is not added # The base URL where the public-facing endpoints are available. The prefix is not added
# implicitly. # implicitly.
external: {{ getenv "SERVER_URL_PUBLIC" }} external: https://example.com/public
# Provisioning API part of the web server for automated portal creation and fetching information. # Provisioning API part of the web server for automated portal creation and fetching information.
# Used by things like mautrix-manager (https://github.com/tulir/mautrix-manager). # Used by things like mautrix-manager (https://github.com/tulir/mautrix-manager).
@ -64,7 +69,7 @@ appservice:
# Whether or not the provisioning API should be enabled. # Whether or not the provisioning API should be enabled.
enabled: true enabled: true
# The prefix to use in the provisioning API endpoints. # The prefix to use in the provisioning API endpoints.
prefix: /_matrix/provision/v1 prefix: /_matrix/provision
# The shared secret to authorize users of the API. # The shared secret to authorize users of the API.
# Set to "generate" to generate and save a new token. # Set to "generate" to generate and save a new token.
shared_secret: generate shared_secret: generate
@ -72,7 +77,7 @@ appservice:
# The unique ID of this appservice. # The unique ID of this appservice.
id: telegram id: telegram
# Username of the appservice bot. # Username of the appservice bot.
bot_username: telegrambot bot_username: telegram_bot
# Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
# to leave display name/avatar as-is. # to leave display name/avatar as-is.
bot_displayname: Telegram bridge bot bot_displayname: Telegram bridge bot
@ -81,7 +86,7 @@ appservice:
# Whether or not to receive ephemeral events via appservice transactions. # Whether or not to receive ephemeral events via appservice transactions.
# Requires MSC2409 support (i.e. Synapse 1.22+). # Requires MSC2409 support (i.e. Synapse 1.22+).
# You should disable bridge -> sync_with_custom_puppets when this is enabled. # You should disable bridge -> sync_with_custom_puppets when this is enabled.
ephemeral_events: false ephemeral_events: true
# Authentication tokens for AS <-> HS communication. Autogenerated; do not modify. # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
as_token: "{{ getenv "AS_TOKEN" }}" as_token: "{{ getenv "AS_TOKEN" }}"
@ -139,27 +144,37 @@ bridge:
# as there's no way to determine whether an avatar is removed or just hidden from some users. If # as there's no way to determine whether an avatar is removed or just hidden from some users. If
# you're on a single-user instance, this should be safe to enable. # you're on a single-user instance, this should be safe to enable.
allow_avatar_remove: false allow_avatar_remove: false
# Should contact names and profile pictures be allowed?
# This is only safe to enable on single-user instances.
allow_contact_info: false
# Maximum number of members to sync per portal when starting up. Other members will be # Maximum number of members to sync per portal when starting up. Other members will be
# synced when they send messages. The maximum is 10000, after which the Telegram server # synced when they send messages. The maximum is 10000, after which the Telegram server
# will not send any more members. # will not send any more members.
# -1 means no limit (which means it's limited to 10000 by the server) # -1 means no limit (which means it's limited to 10000 by the server)
max_initial_member_sync: 100 max_initial_member_sync: 100
# Maximum number of participants in chats to bridge. Only applies when the portal is being created.
# If there are more members when trying to create a room, the room creation will be cancelled.
# -1 means no limit (which means all chats can be bridged)
max_member_count: -1
# Whether or not to sync the member list in channels. # Whether or not to sync the member list in channels.
# If no channel admins have logged into the bridge, the bridge won't be able to sync the member # If no channel admins have logged into the bridge, the bridge won't be able to sync the member
# list regardless of this setting. # list regardless of this setting.
sync_channel_members: true sync_channel_members: false
# Whether or not to skip deleted members when syncing members. # Whether or not to skip deleted members when syncing members.
skip_deleted_members: true skip_deleted_members: true
# Whether or not to automatically synchronize contacts and chats of Matrix users logged into # Whether or not to automatically synchronize contacts and chats of Matrix users logged into
# their Telegram account at startup. # their Telegram account at startup.
startup_sync: true startup_sync: false
# Number of most recently active dialogs to check when syncing chats. # Number of most recently active dialogs to check when syncing chats.
# Set to 0 to remove limit. # Set to 0 to remove limit.
sync_update_limit: 0 sync_update_limit: 0
# Number of most recently active dialogs to create portals for when syncing chats. # Number of most recently active dialogs to create portals for when syncing chats.
# Set to 0 to remove limit. # Set to 0 to remove limit.
sync_create_limit: 30 sync_create_limit: 15
# Should all chats be scheduled to be created later?
# This is best used in combination with MSC2716 infinite backfill.
sync_deferred_create_all: false
# Whether or not to sync and create portals for direct chats at startup. # Whether or not to sync and create portals for direct chats at startup.
sync_direct_chats: false sync_direct_chats: false
# The maximum number of simultaneous Telegram deletions to handle. # The maximum number of simultaneous Telegram deletions to handle.
@ -171,15 +186,11 @@ bridge:
# Allow logging in within Matrix. If false, users can only log in using login-qr or the # Allow logging in within Matrix. If false, users can only log in using login-qr or the
# out-of-Matrix login website (see appservice.public config section) # out-of-Matrix login website (see appservice.public config section)
allow_matrix_login: true allow_matrix_login: true
# Whether or not to bridge plaintext highlights.
# Only enable this if your displayname_template has some static part that the bridge can use to
# reliably identify what is a plaintext highlight.
plaintext_highlights: false
# Whether or not to make portals of publicly joinable channels/supergroups publicly joinable on Matrix. # Whether or not to make portals of publicly joinable channels/supergroups publicly joinable on Matrix.
public_portals: true public_portals: false
# Whether or not to use /sync to get presence, read receipts and typing notifications # Whether or not to use /sync to get presence, read receipts and typing notifications
# when double puppeting is enabled # when double puppeting is enabled
sync_with_custom_puppets: true sync_with_custom_puppets: false
# Whether or not to update the m.direct account data event when double puppeting is enabled. # Whether or not to update the m.direct account data event when double puppeting is enabled.
# Note that updating the m.direct event is not atomic (except with mautrix-asmux) # Note that updating the m.direct event is not atomic (except with mautrix-asmux)
# and is therefore prone to race conditions. # and is therefore prone to race conditions.
@ -203,13 +214,18 @@ bridge:
# Whether or not the !tg join command should do a HTTP request # Whether or not the !tg join command should do a HTTP request
# to resolve redirects in invite links. # to resolve redirects in invite links.
invite_link_resolve: false invite_link_resolve: false
# Use inline images instead of a separate message for the caption. # Send captions in the same message as images. This will send data compatible with both MSC2530 and MSC3552.
# N.B. Inline images are not supported on all clients (e.g. Element iOS/Android). # This is currently not supported in most clients.
inline_images: false caption_in_message: false
# Maximum size of image in megabytes before sending to Telegram as a document. # Maximum size of image in megabytes before sending to Telegram as a document.
image_as_file_size: 10 image_as_file_size: 10
# Maximum number of pixels in an image before sending to Telegram as a document. Defaults to 1280x1280 = 1638400. # Maximum number of pixels in an image before sending to Telegram as a document. Defaults to 4096x4096 = 16777216.
image_as_file_pixels: 1638400 image_as_file_pixels: 16777216
# Maximum size of Telegram documents before linking to Telegrm instead of bridge
# to Matrix media.
document_as_link_size:
channel:
bot:
# Enable experimental parallel file transfer, which makes uploads/downloads much faster by # Enable experimental parallel file transfer, which makes uploads/downloads much faster by
# streaming from/to Matrix and using many connections for Telegram. # streaming from/to Matrix and using many connections for Telegram.
# Note that generating HQ thumbnails for videos is not possible with streamed transfers. # Note that generating HQ thumbnails for videos is not possible with streamed transfers.
@ -218,6 +234,9 @@ bridge:
# Whether or not created rooms should have federation enabled. # Whether or not created rooms should have federation enabled.
# If false, created portal rooms will never be federated. # If false, created portal rooms will never be federated.
federate_rooms: true federate_rooms: true
# Should the bridge send all unicode reactions as custom emoji reactions to Telegram?
# By default, the bridge only uses custom emojis for unicode emojis that aren't allowed in reactions.
always_custom_emoji_reaction: false
# Settings for converting animated stickers. # Settings for converting animated stickers.
animated_sticker: animated_sticker:
# Format to which animated stickers should be converted. # Format to which animated stickers should be converted.
@ -225,12 +244,24 @@ bridge:
# png - converts to non-animated png (fastest), # png - converts to non-animated png (fastest),
# gif - converts to animated gif # gif - converts to animated gif
# webm - converts to webm video, requires ffmpeg executable with vp9 codec and webm container support # webm - converts to webm video, requires ffmpeg executable with vp9 codec and webm container support
# webp - converts to animated webp, requires ffmpeg executable with webp codec/container support
target: gif target: gif
# Should video stickers be converted to the specified format as well?
convert_from_webm: false
# Arguments for converter. All converters take width and height. # Arguments for converter. All converters take width and height.
args: args:
width: 256 width: 256
height: 256 height: 256
fps: 25 # only for webm and gif (2, 5, 10, 20 or 25 recommended) fps: 25 # only for webm, webp and gif (2, 5, 10, 20 or 25 recommended)
# Settings for converting animated emoji.
# Same as animated_sticker, but webm is not supported as the target
# (because inline images can only contain images, not videos).
animated_emoji:
target: webp
args:
width: 64
height: 64
fps: 25
# End-to-bridge encryption support options. # End-to-bridge encryption support options.
# #
# See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info. # See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info.
@ -240,28 +271,92 @@ bridge:
# Default to encryption, force-enable encryption in all portals the bridge creates # Default to encryption, force-enable encryption in all portals the bridge creates
# This will cause the bridge bot to be in private chats for the encryption to work properly. # This will cause the bridge bot to be in private chats for the encryption to work properly.
default: true default: true
# Database for the encryption data. If set to `default`, will use the appservice database. # Whether to use MSC2409/MSC3202 instead of /sync long polling for receiving encryption-related data.
database: default appservice: false
# Options for automatic key sharing. # Require encryption, drop any unencrypted messages.
key_sharing: require: false
# Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled. # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
# You must use a client that supports requesting keys from other users to use this feature. # You must use a client that supports requesting keys from other users to use this feature.
allow: true allow_key_sharing: true
# Require the requesting device to have a valid cross-signing signature? # Options for deleting megolm sessions from the bridge.
# This doesn't require that the bridge has verified the device, only that the user has verified it. delete_keys:
# Not yet implemented. # Beeper-specific: delete outbound sessions when hungryserv confirms
require_cross_signing: false # that the user has uploaded the key to key backup.
# Require devices to be verified by the bridge? delete_outbound_on_ack: false
# Verification by the bridge is not yet implemented. # Don't store outbound sessions in the inbound table.
require_verification: true dont_store_outbound: false
# Whether or not to explicitly set the avatar and room name for private # Ratchet megolm sessions forward after decrypting messages.
# chat portal rooms. This will be implicitly enabled if encryption.default is true. ratchet_on_decrypt: false
private_chat_portal_meta: false # Delete fully used keys (index >= max_messages) after decrypting messages.
delete_fully_used_on_decrypt: false
# Delete previous megolm sessions from same device when receiving a new one.
delete_prev_on_new_session: false
# Delete megolm sessions received from a device when the device is deleted.
delete_on_device_delete: false
# Periodically delete megolm sessions when 2x max_age has passed since receiving the session.
periodically_delete_expired: false
# Delete inbound megolm sessions that don't have the received_at field used for
# automatic ratcheting and expired session deletion. This is meant as a migration
# to delete old keys prior to the bridge update.
delete_outdated_inbound: false
# What level of device verification should be required from users?
#
# Valid levels:
# unverified - Send keys to all device in the room.
# cross-signed-untrusted - Require valid cross-signing, but trust all cross-signing keys.
# cross-signed-tofu - Require valid cross-signing, trust cross-signing keys on first use (and reject changes).
# cross-signed-verified - Require valid cross-signing, plus a valid user signature from the bridge bot.
# Note that creating user signatures from the bridge bot is not currently possible.
# verified - Require manual per-device verification
# (currently only possible by modifying the `trust` column in the `crypto_device` database table).
verification_levels:
# Minimum level for which the bridge should send keys to when bridging messages from Telegram to Matrix.
receive: unverified
# Minimum level that the bridge should accept for incoming Matrix messages.
send: unverified
# Minimum level that the bridge should require for accepting key requests.
share: cross-signed-tofu
# Options for Megolm room key rotation. These options allow you to
# configure the m.room.encryption event content. See:
# https://spec.matrix.org/v1.3/client-server-api/#mroomencryption for
# more information about that event.
rotation:
# Enable custom Megolm room key rotation settings. Note that these
# settings will only apply to rooms created after this option is
# set.
enable_custom: false
# The maximum number of milliseconds a session should be used
# before changing it. The Matrix spec recommends 604800000 (a week)
# as the default.
milliseconds: 604800000
# The maximum number of messages that should be sent with a given a
# session before changing it. The Matrix spec recommends 100 as the
# default.
messages: 100
# Disable rotating keys when a user's devices change?
# You should not enable this option unless you understand all the implications.
disable_device_change_key_rotation: false
# Whether to explicitly set the avatar and room name for private chat portal rooms.
# If set to `default`, this will be enabled in encrypted rooms and disabled in unencrypted rooms.
# If set to `always`, all DM rooms will have explicit names and avatars set.
# If set to `never`, DM rooms will never have names and avatars set.
private_chat_portal_meta: default
# Disable generating reply fallbacks? Some extremely bad clients still rely on them,
# but they're being phased out and will be completely removed in the future.
disable_reply_fallbacks: false
# Should cross-chat replies from Telegram be bridged? Most servers and clients don't support this.
cross_room_replies: false
# Whether or not the bridge should send a read receipt from the bridge bot when a message has # Whether or not the bridge should send a read receipt from the bridge bot when a message has
# been sent to Telegram. # been sent to Telegram.
delivery_receipts: false delivery_receipts: false
# Whether or not delivery errors should be reported as messages in the Matrix room. # Whether or not delivery errors should be reported as messages in the Matrix room.
delivery_error_reports: false delivery_error_reports: false
# Should errors in incoming message handling send a message to the Matrix room?
incoming_bridge_error_reports: false
# Whether the bridge should send the message status as a custom com.beeper.message_send_status event.
message_status_events: false
# Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run. # Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run.
# This field will automatically be changed back to false after it, # This field will automatically be changed back to false after it,
# except if the config file is not writable. # except if the config file is not writable.
@ -279,36 +374,62 @@ bridge:
bridge_matrix_leave: true bridge_matrix_leave: true
# Should the user be kicked out of all portals when logging out of the bridge? # Should the user be kicked out of all portals when logging out of the bridge?
kick_on_logout: true kick_on_logout: true
# Should the "* user joined Telegram" notice always be marked as read automatically?
always_read_joined_telegram_notice: true
# Should the bridge auto-create a group chat on Telegram when a ghost is invited to a room?
# Requires the user to have sufficient power level and double puppeting enabled.
create_group_on_invite: true
# Settings for backfilling messages from Telegram. # Settings for backfilling messages from Telegram.
backfill: backfill:
# Whether or not the Telegram ghosts of logged in Matrix users should be # Allow backfilling at all?
# invited to private chats when backfilling history from Telegram. This is enable: true
# usually needed to prevent rate limits and to allow timestamp massaging.
invite_own_puppet: true
# Maximum number of messages to backfill without using a takeout.
# The first time a takeout is used, the user has to manually approve it from a different
# device. If initial_limit or missed_limit are higher than this value, the bridge will ask
# the user to accept the takeout after logging in before syncing any chats.
takeout_limit: 100
# Maximum number of messages to backfill initially.
# Set to 0 to disable backfilling when creating portal, or -1 to disable the limit.
#
# N.B. Initial backfill will only start after member sync. Make sure your
# max_initial_member_sync is set to a low enough value so it doesn't take forever.
initial_limit: 0
# Maximum number of messages to backfill if messages were missed while the bridge was
# disconnected. Note that this only works for logged in users and only if the chat isn't
# older than sync_update_limit
# Set to 0 to disable backfilling missed messages.
missed_limit: 50
# If using double puppeting, should notifications be disabled
# while the initial backfill is in progress?
disable_notifications: false
# Whether or not to enable backfilling in normal groups. # Whether or not to enable backfilling in normal groups.
# Normal groups have numerous technical problems in Telegram, and backfilling normal groups # Normal groups have numerous technical problems in Telegram, and backfilling normal groups
# will likely cause problems if there are multiple Matrix users in the group. # will likely cause problems if there are multiple Matrix users in the group.
normal_groups: false normal_groups: false
# If a backfilled chat is older than this number of hours, mark it as read even if it's unread on Telegram.
# Set to -1 to let any chat be unread.
unread_hours_threshold: 720
# Forward backfilling limits.
#
# Using a negative initial limit is not recommended, as it would try to backfill everything in a single batch.
forward_limits:
# Number of messages to backfill immediately after creating a portal.
initial:
user: 50
normal_group: 100
supergroup: 10
channel: 10
# Number of messages to backfill when syncing chats.
sync:
user: 100
normal_group: 100
supergroup: 100
channel: 100
# Timeout for forward backfills in seconds. If you have a high limit, you'll have to increase this too.
forward_timeout: 900
# Settings for incremental backfill of history. These only apply to Beeper, as upstream abandoned MSC2716.
incremental:
# Maximum number of messages to backfill per batch.
messages_per_batch: 100
# The number of seconds to wait after backfilling the batch of messages.
post_batch_delay: 20
# The maximum number of batches to backfill per portal, split by the chat type.
# If set to -1, all messages in the chat will eventually be backfilled.
max_batches:
# Direct chats
user: -1
# Normal groups. Note that the normal_groups option above must be enabled
# for these to be backfilled.
normal_group: -1
# Supergroups
supergroup: 10
# Broadcast channels
channel: -1
# Overrides for base power levels. # Overrides for base power levels.
initial_power_level_overrides: initial_power_level_overrides:
user: {} user: {}
@ -368,7 +489,6 @@ bridge:
# Filter rooms that can/can't be bridged. Can also be managed using the `filter` and # Filter rooms that can/can't be bridged. Can also be managed using the `filter` and
# `filter-mode` management commands. # `filter-mode` management commands.
# #
# Filters do not affect direct chats.
# An empty blacklist will essentially disable the filter. # An empty blacklist will essentially disable the filter.
filter: filter:
# Filter mode to use. Either "blacklist" or "whitelist". # Filter mode to use. Either "blacklist" or "whitelist".
@ -377,6 +497,11 @@ bridge:
mode: blacklist mode: blacklist
# The list of group/channel IDs to filter. # The list of group/channel IDs to filter.
list: [] list: []
# How to handle direct chats:
# If users is "null", direct chats will follow the previous settings.
# If users is "true", direct chats will always be bridged.
# If users is "false", direct chats will never be bridged.
users: true
# The prefix for commands. Only required in non-management rooms. # The prefix for commands. Only required in non-management rooms.
command_prefix: "!tg" command_prefix: "!tg"
@ -447,7 +572,13 @@ telegram:
api_id: {{ getenv "API_ID" }} api_id: {{ getenv "API_ID" }}
api_hash: {{ getenv "API_HASH" }} api_hash: {{ getenv "API_HASH" }}
# (Optional) Create your own bot at https://t.me/BotFather # (Optional) Create your own bot at https://t.me/BotFather
bot_token: disabled bot_token: {{ getenv "BOT_TOKEN" "disabled" }}
# Should the bridge request missed updates from Telegram when restarting?
catch_up: true
# Should incoming updates be handled sequentially to make sure order is preserved on Matrix?
sequential_updates: true
exit_on_update_error: false
# Telethon connection options. # Telethon connection options.
connection: connection:
@ -470,11 +601,13 @@ telegram:
# is not recommended, since some requests can always trigger a call fail (such as searching # is not recommended, since some requests can always trigger a call fail (such as searching
# for messages). # for messages).
request_retries: 5 request_retries: 5
# Use IPv6 for Telethon connection
use_ipv6: false
# Device info sent to Telegram. # Device info sent to Telegram.
device_info: device_info:
# "auto" = OS name+version. # "auto" = OS name+version.
device_model: auto device_model: mautrix-telegram
# "auto" = Telethon version. # "auto" = Telethon version.
system_version: auto system_version: auto
# "auto" = mautrix-telegram version. # "auto" = mautrix-telegram version.