Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

658 lines
34 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. # Homeserver details
  3. homeserver:
  4. # The address that this appservice can use to connect to the homeserver.
  5. address: {{ matrix_mautrix_telegram_homeserver_address }}
  6. # The domain of the homeserver (for MXIDs, etc).
  7. domain: {{ matrix_mautrix_telegram_homeserver_domain }}
  8. # Whether or not to verify the SSL certificate of the homeserver.
  9. # Only applies if address starts with https://
  10. verify_ssl: true
  11. # What software is the homeserver running?
  12. # Standard Matrix homeservers like Synapse, Dendrite and Conduit should just use "standard" here.
  13. software: standard
  14. # Number of retries for all HTTP requests if the homeserver isn't reachable.
  15. http_retry_count: 4
  16. # The URL to push real-time bridge status to.
  17. # If set, the bridge will make POST requests to this URL whenever a user's Telegram connection state changes.
  18. # The bridge will use the appservice as_token to authorize requests.
  19. status_endpoint: null
  20. # Endpoint for reporting per-message status.
  21. message_send_checkpoint_endpoint: null
  22. # Whether asynchronous uploads via MSC2246 should be enabled for media.
  23. # Requires a media repo that supports MSC2246.
  24. async_media: false
  25. # Application service host/registration related details
  26. # Changing these values requires regeneration of the registration.
  27. appservice:
  28. # The address that the homeserver can use to connect to this appservice.
  29. address: {{ matrix_mautrix_telegram_appservice_address|to_json }}
  30. # The hostname and port where this appservice should listen.
  31. hostname: 0.0.0.0
  32. port: 8080
  33. # The maximum body size of appservice API requests (from the homeserver) in mebibytes
  34. # Usually 1 is enough, but on high-traffic bridges you might need to increase this to avoid 413s
  35. max_body_size: 1
  36. # The full URI to the database. SQLite and Postgres are supported.
  37. # Format examples:
  38. # SQLite: sqlite:filename.db
  39. # Postgres: postgres://username:password@hostname/dbname
  40. database: {{ matrix_mautrix_telegram_appservice_database|to_json }}
  41. # Additional arguments for asyncpg.create_pool() or sqlite3.connect()
  42. # https://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.pool.create_pool
  43. # https://docs.python.org/3/library/sqlite3.html#sqlite3.connect
  44. # For sqlite, min_size is used as the connection thread pool size and max_size is ignored.
  45. # Additionally, SQLite supports init_commands as an array of SQL queries to run on connect (e.g. to set PRAGMAs).
  46. database_opts:
  47. min_size: 1
  48. max_size: 10
  49. # Public part of web server for out-of-Matrix interaction with the bridge.
  50. # Used for things like login if the user wants to make sure the 2FA password isn't stored in
  51. # the HS database.
  52. public:
  53. # Whether or not the public-facing endpoints should be enabled.
  54. enabled: {{ matrix_mautrix_telegram_appservice_public_enabled|to_json }}
  55. # The prefix to use in the public-facing endpoints.
  56. prefix: {{ matrix_mautrix_telegram_public_endpoint|to_json }}
  57. # The base URL where the public-facing endpoints are available. The prefix is not added
  58. # implicitly.
  59. external: {{ matrix_mautrix_telegram_appservice_public_external|to_json }}
  60. # Provisioning API part of the web server for automated portal creation and fetching information.
  61. # Used by things like Dimension (https://dimension.t2bot.io/).
  62. provisioning:
  63. # Whether or not the provisioning API should be enabled.
  64. enabled: false
  65. # The prefix to use in the provisioning API endpoints.
  66. prefix: /_matrix/provision/v1
  67. # The shared secret to authorize users of the API.
  68. # Set to "generate" to generate and save a new token.
  69. shared_secret: generate
  70. # The unique ID of this appservice.
  71. id: telegram
  72. # Username of the appservice bot.
  73. bot_username: {{ matrix_mautrix_telegram_appservice_bot_username|to_json }}
  74. # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
  75. # to leave display name/avatar as-is.
  76. bot_displayname: Telegram bridge bot
  77. bot_avatar: mxc://maunium.net/tJCRmUyJDsgRNgqhOgoiHWbX
  78. # Whether or not to receive ephemeral events via appservice transactions.
  79. # Requires MSC2409 support (i.e. Synapse 1.22+).
  80. # You should disable bridge -> sync_with_custom_puppets when this is enabled.
  81. ephemeral_events: true
  82. # Authentication tokens for AS <-> HS communication.
  83. as_token: {{ matrix_mautrix_telegram_appservice_token|to_json }}
  84. hs_token: {{ matrix_mautrix_telegram_homeserver_token|to_json }}
  85. # Prometheus telemetry config. Requires prometheus-client to be installed.
  86. metrics:
  87. enabled: {{ matrix_mautrix_telegram_metrics_enabled | to_json }}
  88. listen_port: 8000
  89. # Manhole config.
  90. manhole:
  91. # Whether or not opening the manhole is allowed.
  92. enabled: false
  93. # The path for the unix socket.
  94. path: /var/tmp/mautrix-telegram.manhole
  95. # The list of UIDs who can be added to the whitelist.
  96. # If empty, any UIDs can be specified in the open-manhole command.
  97. whitelist:
  98. - 0
  99. # Bridge config
  100. bridge:
  101. # Localpart template of MXIDs for Telegram users.
  102. # {userid} is replaced with the user ID of the Telegram user.
  103. # Default: telegram_{userid}
  104. username_template: {{ matrix_mautrix_telegram_username_template|to_json }}
  105. # Localpart template of room aliases for Telegram portal rooms.
  106. # {groupname} is replaced with the name part of the public channel/group invite link ( https://t.me/{} )
  107. # Default: telegram_{groupname}
  108. alias_template: {{ matrix_mautrix_telegram_alias_template|to_json }}
  109. # Displayname template for Telegram users.
  110. # {displayname} is replaced with the display name of the Telegram user.
  111. # Default: {displayname} (Telegram)
  112. displayname_template: {{ matrix_mautrix_telegram_displayname_template|to_json }}
  113. # Set the preferred order of user identifiers which to use in the Matrix puppet display name.
  114. # In the (hopefully unlikely) scenario that none of the given keys are found, the numeric user
  115. # ID is used.
  116. #
  117. # If the bridge is working properly, a phone number or an username should always be known, but
  118. # the other one can very well be empty.
  119. #
  120. # Valid keys:
  121. # "full name" (First and/or last name)
  122. # "full name reversed" (Last and/or first name)
  123. # "first name"
  124. # "last name"
  125. # "username"
  126. # "phone number"
  127. displayname_preference:
  128. - full name
  129. - username
  130. - phone number
  131. # Maximum length of displayname
  132. displayname_max_length: 100
  133. # Remove avatars from Telegram ghost users when removed on Telegram. This is disabled by default
  134. # as there's no way to determine whether an avatar is removed or just hidden from some users. If
  135. # you're on a single-user instance, this should be safe to enable.
  136. allow_avatar_remove: false
  137. # Should contact names and profile pictures be allowed?
  138. # This is only safe to enable on single-user instances.
  139. allow_contact_info: false
  140. # Maximum number of members to sync per portal when starting up. Other members will be
  141. # synced when they send messages. The maximum is 10000, after which the Telegram server
  142. # will not send any more members.
  143. # -1 means no limit (which means it's limited to 10000 by the server)
  144. max_initial_member_sync: 100
  145. # Maximum number of participants in chats to bridge. Only applies when the portal is being created.
  146. # If there are more members when trying to create a room, the room creation will be cancelled.
  147. # -1 means no limit (which means all chats can be bridged)
  148. max_member_count: -1
  149. # Whether or not to sync the member list in channels.
  150. # If no channel admins have logged into the bridge, the bridge won't be able to sync the member
  151. # list regardless of this setting.
  152. sync_channel_members: false
  153. # Whether or not to skip deleted members when syncing members.
  154. skip_deleted_members: true
  155. # Whether or not to automatically synchronize contacts and chats of Matrix users logged into
  156. # their Telegram account at startup.
  157. startup_sync: false
  158. # Number of most recently active dialogs to check when syncing chats.
  159. # Set to 0 to remove limit.
  160. sync_update_limit: 0
  161. # Number of most recently active dialogs to create portals for when syncing chats.
  162. # Set to 0 to remove limit.
  163. sync_create_limit: 15
  164. # Should all chats be scheduled to be created later?
  165. # This is best used in combination with MSC2716 infinite backfill.
  166. sync_deferred_create_all: false
  167. # Whether or not to sync and create portals for direct chats at startup.
  168. sync_direct_chats: false
  169. # The maximum number of simultaneous Telegram deletions to handle.
  170. # A large number of simultaneous redactions could put strain on your homeserver.
  171. max_telegram_delete: 10
  172. # Whether or not to automatically sync the Matrix room state (mostly unpuppeted displaynames)
  173. # at startup and when creating a bridge.
  174. sync_matrix_state: true
  175. # Allow logging in within Matrix. If false, users can only log in using login-qr or the
  176. # out-of-Matrix login website (see appservice.public config section)
  177. allow_matrix_login: true
  178. # Whether or not to make portals of publicly joinable channels/supergroups publicly joinable on Matrix.
  179. public_portals: false
  180. # Whether or not to use /sync to get presence, read receipts and typing notifications
  181. # when double puppeting is enabled
  182. sync_with_custom_puppets: false
  183. # Whether or not to update the m.direct account data event when double puppeting is enabled.
  184. # Note that updating the m.direct event is not atomic (except with mautrix-asmux)
  185. # and is therefore prone to race conditions.
  186. sync_direct_chat_list: false
  187. # Servers to always allow double puppeting from
  188. double_puppet_server_map:
  189. "{{ matrix_mautrix_telegram_homeserver_domain }}": {{ matrix_mautrix_telegram_homeserver_address }}
  190. # Allow using double puppeting from any server with a valid client .well-known file.
  191. double_puppet_allow_discovery: false
  192. # Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth
  193. #
  194. # If set, custom puppets will be enabled automatically for local users
  195. # instead of users having to find an access token and run `login-matrix`
  196. # manually.
  197. # If using this for other servers than the bridge's server,
  198. # you must also set the URL in the double_puppet_server_map.
  199. login_shared_secret_map: {{ matrix_mautrix_telegram_bridge_login_shared_secret_map|to_json }}
  200. # Set to false to disable link previews in messages sent to Telegram.
  201. telegram_link_preview: true
  202. # Whether or not the !tg join command should do a HTTP request
  203. # to resolve redirects in invite links.
  204. invite_link_resolve: false
  205. # Send captions in the same message as images. This will send data compatible with both MSC2530 and MSC3552.
  206. # This is currently not supported in most clients.
  207. caption_in_message: false
  208. # Maximum size of image in megabytes before sending to Telegram as a document.
  209. image_as_file_size: 10
  210. # Maximum number of pixels in an image before sending to Telegram as a document. Defaults to 4096x4096 = 16777216.
  211. image_as_file_pixels: 16777216
  212. # Enable experimental parallel file transfer, which makes uploads/downloads much faster by
  213. # streaming from/to Matrix and using many connections for Telegram.
  214. # Note that generating HQ thumbnails for videos is not possible with streamed transfers.
  215. # This option uses internal Telethon implementation details and may break with minor updates.
  216. parallel_file_transfer: false
  217. # Whether or not created rooms should have federation enabled.
  218. # If false, created portal rooms will never be federated.
  219. federate_rooms: {{ matrix_mautrix_telegram_federate_rooms|to_json }}
  220. # Should the bridge send all unicode reactions as custom emoji reactions to Telegram?
  221. # By default, the bridge only uses custom emojis for unicode emojis that aren't allowed in reactions.
  222. always_custom_emoji_reaction: false
  223. # Settings for converting animated stickers.
  224. animated_sticker:
  225. # Format to which animated stickers should be converted.
  226. # disable - No conversion, send as-is (gzipped lottie)
  227. # png - converts to non-animated png (fastest),
  228. # gif - converts to animated gif
  229. # webm - converts to webm video, requires ffmpeg executable with vp9 codec and webm container support
  230. # webp - converts to animated webp, requires ffmpeg executable with webp codec/container support
  231. target: gif
  232. # Should video stickers be converted to the specified format as well?
  233. convert_from_webm: false
  234. # Arguments for converter. All converters take width and height.
  235. args:
  236. width: 256
  237. height: 256
  238. fps: 25 # only for webm, webp and gif (2, 5, 10, 20 or 25 recommended)
  239. # Settings for converting animated emoji.
  240. # Same as animated_sticker, but webm is not supported as the target
  241. # (because inline images can only contain images, not videos).
  242. animated_emoji:
  243. target: webp
  244. args:
  245. width: 64
  246. height: 64
  247. fps: 25
  248. # End-to-bridge encryption support options.
  249. #
  250. # See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info.
  251. encryption:
  252. # Allow encryption, work in group chat rooms with e2ee enabled
  253. allow: {{ matrix_mautrix_telegram_bridge_encryption_allow|to_json }}
  254. # Default to encryption, force-enable encryption in all portals the bridge creates
  255. # This will cause the bridge bot to be in private chats for the encryption to work properly.
  256. default: {{ matrix_mautrix_telegram_bridge_encryption_default|to_json }}
  257. # Whether to use MSC2409/MSC3202 instead of /sync long polling for receiving encryption-related data.
  258. appservice: false
  259. # Require encryption, drop any unencrypted messages.
  260. require: false
  261. # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
  262. # You must use a client that supports requesting keys from other users to use this feature.
  263. allow_key_sharing: {{ matrix_mautrix_telegram_bridge_encryption_key_sharing_allow|to_json }}
  264. # Options for deleting megolm sessions from the bridge.
  265. delete_keys:
  266. # Beeper-specific: delete outbound sessions when hungryserv confirms
  267. # that the user has uploaded the key to key backup.
  268. delete_outbound_on_ack: false
  269. # Don't store outbound sessions in the inbound table.
  270. dont_store_outbound: false
  271. # Ratchet megolm sessions forward after decrypting messages.
  272. ratchet_on_decrypt: false
  273. # Delete fully used keys (index >= max_messages) after decrypting messages.
  274. delete_fully_used_on_decrypt: false
  275. # Delete previous megolm sessions from same device when receiving a new one.
  276. delete_prev_on_new_session: false
  277. # Delete megolm sessions received from a device when the device is deleted.
  278. delete_on_device_delete: false
  279. # Periodically delete megolm sessions when 2x max_age has passed since receiving the session.
  280. periodically_delete_expired: false
  281. # Delete inbound megolm sessions that don't have the received_at field used for
  282. # automatic ratcheting and expired session deletion. This is meant as a migration
  283. # to delete old keys prior to the bridge update.
  284. delete_outdated_inbound: false
  285. # What level of device verification should be required from users?
  286. #
  287. # Valid levels:
  288. # unverified - Send keys to all device in the room.
  289. # cross-signed-untrusted - Require valid cross-signing, but trust all cross-signing keys.
  290. # cross-signed-tofu - Require valid cross-signing, trust cross-signing keys on first use (and reject changes).
  291. # cross-signed-verified - Require valid cross-signing, plus a valid user signature from the bridge bot.
  292. # Note that creating user signatures from the bridge bot is not currently possible.
  293. # verified - Require manual per-device verification
  294. # (currently only possible by modifying the `trust` column in the `crypto_device` database table).
  295. verification_levels:
  296. # Minimum level for which the bridge should send keys to when bridging messages from Telegram to Matrix.
  297. receive: unverified
  298. # Minimum level that the bridge should accept for incoming Matrix messages.
  299. send: unverified
  300. # Minimum level that the bridge should require for accepting key requests.
  301. share: cross-signed-tofu
  302. # Options for Megolm room key rotation. These options allow you to
  303. # configure the m.room.encryption event content. See:
  304. # https://spec.matrix.org/v1.3/client-server-api/#mroomencryption for
  305. # more information about that event.
  306. rotation:
  307. # Enable custom Megolm room key rotation settings. Note that these
  308. # settings will only apply to rooms created after this option is
  309. # set.
  310. enable_custom: false
  311. # The maximum number of milliseconds a session should be used
  312. # before changing it. The Matrix spec recommends 604800000 (a week)
  313. # as the default.
  314. milliseconds: 604800000
  315. # The maximum number of messages that should be sent with a given a
  316. # session before changing it. The Matrix spec recommends 100 as the
  317. # default.
  318. messages: 100
  319. # Disable rotating keys when a user's devices change?
  320. # You should not enable this option unless you understand all the implications.
  321. disable_device_change_key_rotation: false
  322. # Whether to explicitly set the avatar and room name for private chat portal rooms.
  323. # If set to `default`, this will be enabled in encrypted rooms and disabled in unencrypted rooms.
  324. # If set to `always`, all DM rooms will have explicit names and avatars set.
  325. # If set to `never`, DM rooms will never have names and avatars set.
  326. private_chat_portal_meta: default
  327. # Disable generating reply fallbacks? Some extremely bad clients still rely on them,
  328. # but they're being phased out and will be completely removed in the future.
  329. disable_reply_fallbacks: false
  330. # Should cross-chat replies from Telegram be bridged? Most servers and clients don't support this.
  331. cross_room_replies: false
  332. # Whether or not the bridge should send a read receipt from the bridge bot when a message has
  333. # been sent to Telegram.
  334. delivery_receipts: false
  335. # Whether or not delivery errors should be reported as messages in the Matrix room.
  336. delivery_error_reports: false
  337. # Should errors in incoming message handling send a message to the Matrix room?
  338. incoming_bridge_error_reports: false
  339. # Whether the bridge should send the message status as a custom com.beeper.message_send_status event.
  340. message_status_events: false
  341. # Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run.
  342. # This field will automatically be changed back to false after it,
  343. # except if the config file is not writable.
  344. resend_bridge_info: false
  345. # When using double puppeting, should muted chats be muted in Matrix?
  346. mute_bridging: false
  347. # When using double puppeting, should pinned chats be moved to a specific tag in Matrix?
  348. # The favorites tag is `m.favourite`.
  349. pinned_tag: null
  350. # Same as above for archived chats, the low priority tag is `m.lowpriority`.
  351. archive_tag: null
  352. # Whether or not mute status and tags should only be bridged when the portal room is created.
  353. tag_only_on_create: true
  354. # Should leaving the room on Matrix make the user leave on Telegram?
  355. bridge_matrix_leave: true
  356. # Should the user be kicked out of all portals when logging out of the bridge?
  357. kick_on_logout: true
  358. # Should the "* user joined Telegram" notice always be marked as read automatically?
  359. always_read_joined_telegram_notice: true
  360. # Should the bridge auto-create a group chat on Telegram when a ghost is invited to a room?
  361. # Requires the user to have sufficient power level and double puppeting enabled.
  362. create_group_on_invite: true
  363. # Settings for backfilling messages from Telegram.
  364. backfill:
  365. # Allow backfilling at all?
  366. enable: true
  367. # Whether or not to enable backfilling in normal groups.
  368. # Normal groups have numerous technical problems in Telegram, and backfilling normal groups
  369. # will likely cause problems if there are multiple Matrix users in the group.
  370. normal_groups: false
  371. # If a backfilled chat is older than this number of hours, mark it as read even if it's unread on Telegram.
  372. # Set to -1 to let any chat be unread.
  373. unread_hours_threshold: 720
  374. # Forward backfilling limits.
  375. #
  376. # Using a negative initial limit is not recommended, as it would try to backfill everything in a single batch.
  377. forward_limits:
  378. # Number of messages to backfill immediately after creating a portal.
  379. initial:
  380. user: 50
  381. normal_group: 100
  382. supergroup: 10
  383. channel: 10
  384. # Number of messages to backfill when syncing chats.
  385. sync:
  386. user: 100
  387. normal_group: 100
  388. supergroup: 100
  389. channel: 100
  390. # Timeout for forward backfills in seconds. If you have a high limit, you'll have to increase this too.
  391. forward_timeout: 900
  392. # Settings for incremental backfill of history. These only apply to Beeper, as upstream abandoned MSC2716.
  393. incremental:
  394. # Maximum number of messages to backfill per batch.
  395. messages_per_batch: 100
  396. # The number of seconds to wait after backfilling the batch of messages.
  397. post_batch_delay: 20
  398. # The maximum number of batches to backfill per portal, split by the chat type.
  399. # If set to -1, all messages in the chat will eventually be backfilled.
  400. max_batches:
  401. # Direct chats
  402. user: -1
  403. # Normal groups. Note that the normal_groups option above must be enabled
  404. # for these to be backfilled.
  405. normal_group: -1
  406. # Supergroups
  407. supergroup: 10
  408. # Broadcast channels
  409. channel: -1
  410. # Overrides for base power levels.
  411. initial_power_level_overrides:
  412. user: {}
  413. group: {}
  414. # Whether to bridge Telegram bot messages as m.notices or m.texts.
  415. bot_messages_as_notices: true
  416. bridge_notices:
  417. # Whether or not Matrix bot messages (type m.notice) should be bridged.
  418. default: false
  419. # List of user IDs for whom the previous flag is flipped.
  420. # e.g. if bridge_notices.default is false, notices from other users will not be bridged, but
  421. # notices from users listed here will be bridged.
  422. exceptions: []
  423. # An array of possible values for the $distinguisher variable in message formats.
  424. # Each user gets one of the values here, based on a hash of their user ID.
  425. # If the array is empty, the $distinguisher variable will also be empty.
  426. relay_user_distinguishers: ["🟦", "🟣", "🟩", "⭕️", "🔶", "⬛️", "🔵", "🟢"]
  427. # The formats to use when sending messages to Telegram via the relay bot.
  428. # Text msgtypes (m.text, m.notice and m.emote) support HTML, media msgtypes don't.
  429. #
  430. # Available variables:
  431. # $sender_displayname - The display name of the sender (e.g. Example User)
  432. # $sender_username - The username (Matrix ID localpart) of the sender (e.g. exampleuser)
  433. # $sender_mxid - The Matrix ID of the sender (e.g. @exampleuser:example.com)
  434. # $distinguisher - A random string from the options in the relay_user_distinguishers array.
  435. # $message - The message content
  436. message_formats:
  437. m.text: "$distinguisher <b>$sender_displayname</b>: $message"
  438. m.notice: "$distinguisher <b>$sender_displayname</b>: $message"
  439. m.emote: "* $distinguisher <b>$sender_displayname</b> $message"
  440. m.file: "$distinguisher <b>$sender_displayname</b> sent a file: $message"
  441. m.image: "$distinguisher <b>$sender_displayname</b> sent an image: $message"
  442. m.audio: "$distinguisher <b>$sender_displayname</b> sent an audio file: $message"
  443. m.video: "$distinguisher <b>$sender_displayname</b> sent a video: $message"
  444. m.location: "$distinguisher <b>$sender_displayname</b> sent a location: $message"
  445. # Telegram doesn't have built-in emotes, this field specifies how m.emote's from authenticated
  446. # users are sent to telegram. All fields in message_formats are supported. Additionally, the
  447. # Telegram user info is available in the following variables:
  448. # $displayname - Telegram displayname
  449. # $username - Telegram username (may not exist)
  450. # $mention - Telegram @username or displayname mention (depending on which exists)
  451. emote_format: "* $mention $formatted_body"
  452. # The formats to use when sending state events to Telegram via the relay bot.
  453. #
  454. # Variables from `message_formats` that have the `sender_` prefix are available without the prefix.
  455. # In name_change events, `$prev_displayname` is the previous displayname.
  456. #
  457. # Set format to an empty string to disable the messages for that event.
  458. state_event_formats:
  459. join: "$distinguisher <b>$displayname</b> joined the room."
  460. leave: "$distinguisher <b>$displayname</b> left the room."
  461. name_change: "$distinguisher <b>$prev_displayname</b> changed their name to $distinguisher <b>$displayname</b>"
  462. # Filter rooms that can/can't be bridged. Can also be managed using the `filter` and
  463. # `filter-mode` management commands.
  464. #
  465. # An empty blacklist will essentially disable the filter.
  466. filter:
  467. # Filter mode to use. Either "blacklist" or "whitelist".
  468. # If the mode is "blacklist", the listed chats will never be bridged.
  469. # If the mode is "whitelist", only the listed chats can be bridged.
  470. mode: {{ matrix_mautrix_telegram_filter_mode | to_json }}
  471. # The list of group/channel IDs to filter.
  472. list: []
  473. # How to handle direct chats:
  474. # If users is "null", direct chats will follow the previous settings.
  475. # If users is "true", direct chats will always be bridged.
  476. # If users is "false", direct chats will never be bridged.
  477. users: true
  478. # The prefix for commands. Only required in non-management rooms.
  479. command_prefix: {{ matrix_mautrix_telegram_command_prefix | to_json }}
  480. # Messages sent upon joining a management room.
  481. # Markdown is supported. The defaults are listed below.
  482. management_room_text:
  483. # Sent when joining a room.
  484. welcome: "Hello, I'm a Telegram bridge bot."
  485. # Sent when joining a management room and the user is already logged in.
  486. welcome_connected: "Use `help` for help."
  487. # Sent when joining a management room and the user is not logged in.
  488. welcome_unconnected: "Use `help` for help or `login` to log in."
  489. # Optional extra text sent when joining a management room.
  490. additional_help: ""
  491. # Send each message separately (for readability in some clients)
  492. management_room_multiple_messages: false
  493. # Permissions for using the bridge.
  494. # Permitted values:
  495. # relaybot - Only use the bridge via the relaybot, no access to commands.
  496. # user - Relaybot level + access to commands to create bridges.
  497. # puppeting - User level + logging in with a Telegram account.
  498. # full - Full access to use the bridge, i.e. previous levels + Matrix login.
  499. # admin - Full access to use the bridge and some extra administration commands.
  500. # Permitted keys:
  501. # * - All Matrix users
  502. # domain - All users on that homeserver
  503. # mxid - Specific user
  504. permissions: {{ matrix_mautrix_telegram_bridge_permissions | to_json }}
  505. # Options related to the message relay Telegram bot.
  506. relaybot:
  507. private_chat:
  508. # List of users to invite to the portal when someone starts a private chat with the bot.
  509. # If empty, private chats with the bot won't create a portal.
  510. invite: []
  511. # Whether or not to bridge state change messages in relaybot private chats.
  512. state_changes: true
  513. # When private_chat_invite is empty, this message is sent to users /starting the
  514. # relaybot. Telegram's "markdown" is supported.
  515. message: This is a Matrix bridge relaybot and does not support direct chats
  516. # List of users to invite to all group chat portals created by the bridge.
  517. group_chat_invite: []
  518. # Whether or not the relaybot should not bridge events in unbridged group chats.
  519. # If false, portals will be created when the relaybot receives messages, just like normal
  520. # users. This behavior is usually not desirable, as it interferes with manually bridging
  521. # the chat to another room.
  522. ignore_unbridged_group_chat: true
  523. # Whether or not to allow creating portals from Telegram.
  524. authless_portals: true
  525. # Whether or not to allow Telegram group admins to use the bot commands.
  526. whitelist_group_admins: true
  527. # Whether or not to ignore incoming events sent by the relay bot.
  528. ignore_own_incoming_events: true
  529. # List of usernames/user IDs who are also allowed to use the bot commands.
  530. whitelist: []
  531. # Telegram config
  532. telegram:
  533. # Get your own API keys at https://my.telegram.org/apps
  534. api_id: {{ matrix_mautrix_telegram_api_id|to_json }}
  535. api_hash: {{ matrix_mautrix_telegram_api_hash|to_json }}
  536. # (Optional) Create your own bot at https://t.me/BotFather
  537. bot_token: {{ matrix_mautrix_telegram_bot_token|to_json }}
  538. # Should the bridge request missed updates from Telegram when restarting?
  539. catch_up: true
  540. # Should incoming updates be handled sequentially to make sure order is preserved on Matrix?
  541. sequential_updates: true
  542. exit_on_update_error: false
  543. # Telethon connection options.
  544. connection:
  545. # The timeout in seconds to be used when connecting.
  546. timeout: 120
  547. # How many times the reconnection should retry, either on the initial connection or when
  548. # Telegram disconnects us. May be set to a negative or null value for infinite retries, but
  549. # this is not recommended, since the program can get stuck in an infinite loop.
  550. retries: 5
  551. # The delay in seconds to sleep between automatic reconnections.
  552. retry_delay: 1
  553. # The threshold below which the library should automatically sleep on flood wait errors
  554. # (inclusive). For instance, if a FloodWaitError for 17s occurs and flood_sleep_threshold
  555. # is 20s, the library will sleep automatically. If the error was for 21s, it would raise
  556. # the error instead. Values larger than a day (86400) will be changed to a day.
  557. flood_sleep_threshold: 60
  558. # How many times a request should be retried. Request are retried when Telegram is having
  559. # internal issues, when there is a FloodWaitError less than flood_sleep_threshold, or when
  560. # there's a migrate error. May take a negative or null value for infinite retries, but this
  561. # is not recommended, since some requests can always trigger a call fail (such as searching
  562. # for messages).
  563. request_retries: 5
  564. # Use IPv6 for Telethon connection
  565. use_ipv6: false
  566. # Device info sent to Telegram.
  567. device_info:
  568. # "auto" = OS name+version.
  569. device_model: auto
  570. # "auto" = Telethon version.
  571. system_version: auto
  572. # "auto" = mautrix-telegram version.
  573. app_version: auto
  574. lang_code: en
  575. system_lang_code: en
  576. # Custom server to connect to.
  577. server:
  578. # Set to true to use these server settings. If false, will automatically
  579. # use production server assigned by Telegram. Set to false in production.
  580. enabled: false
  581. # The DC ID to connect to.
  582. dc: 2
  583. # The IP to connect to.
  584. ip: 149.154.167.40
  585. # The port to connect to. 443 may not work, 80 is better and both are equally secure.
  586. port: 80
  587. # Telethon proxy configuration.
  588. # You must install PySocks from pip for proxies to work.
  589. proxy:
  590. # Allowed types: disabled, socks4, socks5, http
  591. type: disabled
  592. # Proxy IP address and port.
  593. address: 127.0.0.1
  594. port: 1080
  595. # Whether or not to perform DNS resolving remotely.
  596. rdns: true
  597. # Proxy authentication (optional).
  598. username: ""
  599. password: ""
  600. # Python logging configuration.
  601. #
  602. # See section 16.7.2 of the Python documentation for more info:
  603. # https://docs.python.org/3.6/library/logging.config.html#configuration-dictionary-schema
  604. logging:
  605. version: 1
  606. formatters:
  607. precise:
  608. format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
  609. handlers:
  610. console:
  611. class: logging.StreamHandler
  612. formatter: precise
  613. loggers:
  614. mau:
  615. level: {{ matrix_mautrix_telegram_logging_level|to_json }}
  616. telethon:
  617. level: {{ matrix_mautrix_telegram_logging_level|to_json }}
  618. aiohttp:
  619. level: {{ matrix_mautrix_telegram_logging_level|to_json }}
  620. root:
  621. level: {{ matrix_mautrix_telegram_logging_level|to_json }}
  622. handlers: [console]