diff --git a/rootfs/etc/confd/templates/config.yaml.tmpl b/rootfs/etc/confd/templates/config.yaml.tmpl index 619052e..e69dc1a 100644 --- a/rootfs/etc/confd/templates/config.yaml.tmpl +++ b/rootfs/etc/confd/templates/config.yaml.tmpl @@ -7,7 +7,9 @@ homeserver: # Whether or not to verify the SSL certificate of the homeserver. # Only applies if address starts with https:// 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. http_retry_count: 4 # The URL to push real-time bridge status to. @@ -30,7 +32,7 @@ appservice: tls_key: false # The hostname and port where this appservice should listen. - hostname: 0.0.0.0 + hostname: :: port: 29317 # The maximum body size of appservice API requests (from the homeserver) in mebibytes # Usually 1 is enough, but on high-traffic bridges you might need to increase this to avoid 413s @@ -45,6 +47,7 @@ appservice: # https://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.pool.create_pool # 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. + # Additionally, SQLite supports init_commands as an array of SQL queries to run on connect (e.g. to set PRAGMAs). database_opts: min_size: 1 max_size: 10 @@ -166,7 +169,10 @@ bridge: sync_update_limit: 0 # Number of most recently active dialogs to create portals for when syncing chats. # 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. sync_direct_chats: false # The maximum number of simultaneous Telegram deletions to handle. @@ -221,6 +227,9 @@ bridge: # Whether or not created rooms should have federation enabled. # If false, created portal rooms will never be federated. 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. animated_sticker: # Format to which animated stickers should be converted. @@ -255,6 +264,8 @@ bridge: # 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. default: true + # Whether to use MSC2409/MSC3202 instead of /sync long polling for receiving encryption-related data. + appservice: false # Require encryption, drop any unencrypted messages. require: false # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled. @@ -329,34 +340,60 @@ bridge: create_group_on_invite: true # Settings for backfilling messages from Telegram. backfill: - # Whether or not the Telegram ghosts of logged in Matrix users should be - # invited to private chats when backfilling history from Telegram. This is - # 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. + # Allow backfilling at all? + enable: true + # Use MSC2716 for backfilling? # - # 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 + # This requires a server with MSC2716 support, which is currently an experimental feature in Synapse. + # It can be enabled by setting experimental_features -> msc2716_enabled to true in homeserver.yaml. + msc2716: false + # Use double puppets for backfilling? + # + # If using MSC2716, the double puppets must be in the appservice's user ID namespace + # (because the bridge can't use the double puppet access token with batch sending). + # + # Even without MSC2716, bridging old messages with correct timestamps requires the double + # puppets to be in an appservice namespace, or the server to be modified to allow + # overriding timestamps anyway. + double_puppet_backfill: false # Whether or not to enable backfilling in 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. 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. These apply to both MSC2716 and legacy backfill. + # + # Using a negative initial limit is not recommended, as it would try to backfill everything in a single batch. + # MSC2716 and the incremental settings are meant for backfilling everything incrementally rather than at once. + forward: + # Number of messages to backfill immediately after creating a portal. + initial_limit: 10 + # Number of messages to backfill when syncing chats. + sync_limit: 100 + + # Settings for incremental backfill of history. These only apply when using 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. initial_power_level_overrides: user: {}