Matrix Docker Ansible eploy
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 

664 рядки
34 KiB

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