Files
matrix-synapse/telegram_bridge.yaml.tmpl
T

229 lines
8.4 KiB
Cheetah

# Network-specific config options
network:
# Get your own API keys at https://my.telegram.org/apps
api_id: {{ env "TELEGRAM_APP_ID" }}
api_hash: {{ secret "telegram_api_hash" }}
# (Optional) Create your own bot at https://t.me/BotFather
bot_token: {{ secret "telegram_bot_token" }}
# Displayname template for Telegram users.
# {{ "{{.FullName}}" }} - the full name of the Telegram user
# {{ "{{.FirstName}}" }} / {{ "{{.LastName}}" }} - the first/last name
# {{ "{{.Username}}" }} - the primary username, if the user has one
# {{ "{{.UserID}}" }} - the internal user ID of the Telegram user
# {{ "{{.Deleted}}" }} - true if the user has been deleted, false otherwise
displayname_template: '{{ "{{ if .Deleted }}Deleted account {{ .UserID }}{{ else }}{{ .FullName }}{{ end }}" }}'
# Format for converting animated stickers. disable/png/gif/webm/webp
animated_sticker:
target: gif
args:
width: 256
height: 256
fps: 25
# Settings for syncing the member list for portals.
member_list:
max_initial_sync: 100
sync_broadcast_channels: false
skip_deleted: true
sync:
update_limit: 100
create_limit: 15
login_sync_limit: 15
direct_chats: true
takeout:
dialog_sync: false
forward_backfill: false
backward_backfill: false
max_member_count: -1
max_telegram_delete: 100
contact_avatars: false
contact_names: false
always_custom_emoji_reaction: false
saved_message_avatar: mxc://maunium.net/XhhfHoPejeneOngMyBbtyWDk
always_tombstone_on_supergroup_migration: false
image_as_file_pixels: 16777216
disable_view_once: false
video_url_preview_as_file: false
bridge_communities: true
# Whether polls should be bridged using unstable MSC3381 event types.
# Bridging votes from Telegram is not supported.
extev_polls: false
# Device info shown in the Telegram device list.
device_info:
device_model: mautrix-telegram
system_version:
app_version: auto
lang_code: en
system_lang_code: en
proxy:
type: disabled
address: "127.0.0.1:1080"
username:
password:
# Config options that affect the central bridge module.
bridge:
# The prefix for commands. Only required in non-management rooms.
command_prefix: "!tg"
personal_filtering_spaces: true
private_chat_portal_meta: true
bridge_matrix_leave: false
bridge_notices: false
tag_only_on_create: true
mute_only_on_create: true
cleanup_on_logout:
enabled: false
manual:
private: nothing
relayed: nothing
shared_no_users: nothing
shared_has_users: nothing
bad_credentials:
private: nothing
relayed: nothing
shared_no_users: nothing
shared_has_users: nothing
relay:
enabled: false
admin_only: true
prefer_default: true
allow_bridge: true
default_relays: []
# Permissions for using the bridge.
# Permitted values:
# relay - Talk through the relay login (if enabled), no access otherwise
# commands - Access to use commands in the bridge, but not login.
# user - Access to use the bridge with puppeting.
# admin - Full access, user level with some additional administration tools.
# Permitted keys:
# * - All Matrix users
# domain - All users on that homeserver
# mxid - Specific user
# NOTE: a wildcard-only map is rejected by bridgev2 — include at least one
# real domain or mxid entry (e.g. the homeserver domain).
permissions: {{ env "TELEGRAM_BRIDGE_PERMISSIONS" }}
# Config for the bridge's database.
database:
# The database type. "sqlite3-fk-wal" and "postgres" are supported.
type: postgres
# The database URI.
# SQLite: A raw file path is supported, but `file:<path>?_txlock=immediate` is recommended.
# https://github.com/mattn/go-sqlite3#connection-string
# Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable
uri: postgres://telegrambridge:{{ secret "telegram_db_password" }}@telegramdb/telegrambridge?sslmode=disable
# Maximum number of connections.
max_open_conns: 5
max_idle_conns: 1
max_conn_idle_time: null
max_conn_lifetime: null
# Homeserver details.
homeserver:
# The address that this appservice can use to connect to the homeserver.
address: {{ env "HOMESERVER_URL" }}
# The domain of the homeserver (also known as server_name, used for MXIDs, etc).
domain: {{ env "HOMESERVER_DOMAIN" }}
# What software is the homeserver running? Standard Matrix homeservers like
# Synapse, Dendrite and Conduit should just use "standard" here.
software: standard
status_endpoint: null
message_send_checkpoint_endpoint:
async_media: false
websocket: false
ping_interval_seconds: 0
# Application service host/registration related details.
# Changing these values requires regeneration of the registration (except when noted otherwise)
appservice:
# The address that the homeserver can use to connect to this appservice.
address: http://telegrambridge:29317
# A public address that external services can use to reach this appservice.
# This value doesn't affect the registration file.
public_address: https://bridge.example.com
# The hostname and port where this appservice should listen.
hostname: 0.0.0.0
port: 29317
# The unique ID of this appservice.
id: {{ env "APP_SERVICE_ID" }}
# Appservice bot details.
bot:
# Username of the appservice bot.
username: {{ env "APP_SERVICE_BOT_USERNAME" }}
# Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
# to leave display name/avatar as-is.
displayname: "{{ env "APP_SERVICE_DISPLAY_NAME" }}"
# Whether to receive ephemeral events via appservice transactions.
ephemeral_events: true
# Should incoming events be handled asynchronously?
async_transactions: false
# Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
as_token: "{{ secret "telegram_as_token" }}"
hs_token: "{{ secret "telegram_hs_token" }}"
# Localpart template of MXIDs for remote users.
# {{ "{{.}}" }} is replaced with the internal ID of the user.
username_template: telegram_{{ "{{.}}" }}
# Config options that affect the Matrix connector of the bridge.
matrix:
message_status_events: false
delivery_receipts: false
message_error_notices: true
sync_direct_chat_list: true
federate_rooms: true
# Settings for provisioning API
provisioning:
prefix: /_matrix/provision
shared_secret: generate
allow_matrix_auth: true
debug_endpoints: false
# Settings for backfilling messages.
backfill:
enabled: false
max_initial_messages: 50
max_catchup_messages: 500
unread_hours_threshold: 720
threads:
max_initial_messages: 50
queue:
enabled: false
batch_size: 100
batch_delay: 20
max_batches: -1
max_batches_override: {}
# Settings for enabling double puppeting
double_puppet:
# Servers to always allow double puppeting from.
servers:
{{ env "HOMESERVER_DOMAIN" }}: {{ env "HOMESERVER_URL" }}
allow_discovery: false
# Shared secrets for automatic double puppeting
# (the shared-secret-auth module on the synapse side).
secrets:
{{ env "HOMESERVER_DOMAIN" }}: {{ secret "shared_secret_auth" }}
# End-to-bridge encryption support options.
#
# See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info.
encryption:
# Whether to enable encryption at all. If false, the bridge will not function in encrypted rooms.
allow: {{ env "ENABLE_ENCRYPTION" }}
# Whether to force-enable encryption in all bridged rooms.
default: false
require: false
appservice: false
allow_key_sharing: false
pickle_key: generate
# Logging config. See https://github.com/tulir/zeroconfig for details.
# File logging is deliberately disabled: docker collects stdout, and the
# synapse entrypoint chowns the shared data volume, so the bridge must not
# need to write into /data at runtime.
logging:
min_level: info
writers:
- type: stdout
format: pretty-colored