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.
 
 

272 lines
12 KiB

  1. # Homeserver details
  2. homeserver:
  3. # The address that this appservice can use to connect to the homeserver.
  4. address: https://{{ hostname_matrix }}
  5. # The domain of the homeserver (for MXIDs, etc).
  6. domain: {{ hostname_identity }}
  7. # Whether or not to verify the SSL certificate of the homeserver.
  8. # Only applies if address starts with https://
  9. verify_ssl: true
  10. # Application service host/registration related details
  11. # Changing these values requires regeneration of the registration.
  12. appservice:
  13. # The address that the homeserver can use to connect to this appservice.
  14. address: http://matrix-mautrix-telegram:8080
  15. # The hostname and port where this appservice should listen.
  16. hostname: 0.0.0.0
  17. port: 8080
  18. # The maximum body size of appservice API requests (from the homeserver) in mebibytes
  19. # Usually 1 is enough, but on high-traffic bridges you might need to increase this to avoid 413s
  20. max_body_size: 1
  21. # The full URI to the database. SQLite and Postgres are fully supported.
  22. # Other DBMSes supported by SQLAlchemy may or may not work.
  23. # Format examples:
  24. # SQLite: sqlite:///filename.db
  25. # Postgres: postgres://username:password@hostname/dbname
  26. database: sqlite:///mautrix-telegram.db
  27. # Public part of web server for out-of-Matrix interaction with the bridge.
  28. # Used for things like login if the user wants to make sure the 2FA password isn't stored in
  29. # the HS database.
  30. public:
  31. # Whether or not the public-facing endpoints should be enabled.
  32. enabled: true
  33. # The prefix to use in the public-facing endpoints.
  34. prefix: {{ matrix_mautrix_telegram_public_endpoint }}
  35. # The base URL where the public-facing endpoints are available. The prefix is not added
  36. # implicitly.
  37. external: https://{{ hostname_matrix }}{{ matrix_mautrix_telegram_public_endpoint }}
  38. # Provisioning API part of the web server for automated portal creation and fetching information.
  39. # Used by things like Dimension (https://dimension.t2bot.io/).
  40. provisioning:
  41. # Whether or not the provisioning API should be enabled.
  42. enabled: false
  43. # The prefix to use in the provisioning API endpoints.
  44. prefix: /_matrix/provision/v1
  45. # The shared secret to authorize users of the API.
  46. # Set to "generate" to generate and save a new token.
  47. shared_secret: generate
  48. # The unique ID of this appservice.
  49. id: telegram
  50. # Username of the appservice bot.
  51. bot_username: telegrambot
  52. # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
  53. # to leave display name/avatar as-is.
  54. bot_displayname: Telegram bridge bot
  55. bot_avatar: mxc://maunium.net/tJCRmUyJDsgRNgqhOgoiHWbX
  56. # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
  57. as_token: "This value is generated when generating the registration"
  58. hs_token: "This value is generated when generating the registration"
  59. # Bridge config
  60. bridge:
  61. # Localpart template of MXIDs for Telegram users.
  62. # {userid} is replaced with the user ID of the Telegram user.
  63. username_template: "telegram_{userid}"
  64. # Localpart template of room aliases for Telegram portal rooms.
  65. # {groupname} is replaced with the name part of the public channel/group invite link ( https://t.me/{} )
  66. alias_template: "telegram_{groupname}"
  67. # Displayname template for Telegram users.
  68. # {displayname} is replaced with the display name of the Telegram user.
  69. displayname_template: "{displayname} (Telegram)"
  70. # Set the preferred order of user identifiers which to use in the Matrix puppet display name.
  71. # In the (hopefully unlikely) scenario that none of the given keys are found, the numeric user
  72. # ID is used.
  73. #
  74. # If the bridge is working properly, a phone number or an username should always be known, but
  75. # the other one can very well be empty.
  76. #
  77. # Valid keys:
  78. # "full name" (First and/or last name)
  79. # "full name reversed" (Last and/or first name)
  80. # "first name"
  81. # "last name"
  82. # "username"
  83. # "phone number"
  84. displayname_preference:
  85. - full name
  86. - username
  87. - phone number
  88. # Show message editing as a reply to the original message.
  89. # If this is false, message edits are not shown at all, as Matrix does not support editing yet.
  90. edits_as_replies: false
  91. # Highlight changed/added parts in edits. Requires lxml.
  92. highlight_edits: false
  93. # Whether or not Matrix bot messages (type m.notice) should be bridged.
  94. bridge_notices: true
  95. # Whether to bridge Telegram bot messages as m.notices or m.texts.
  96. bot_messages_as_notices: true
  97. # Maximum number of members to sync per portal when starting up. Other members will be
  98. # synced when they send messages. The maximum is 10000, after which the Telegram server
  99. # will not send any more members.
  100. # Defaults to no local limit (-> limited to 10000 by server)
  101. max_initial_member_sync: -1
  102. # Whether or not to sync the member list in channels.
  103. # If no channel admins have logged into the bridge, the bridge won't be able to sync the member
  104. # list regardless of this setting.
  105. sync_channel_members: true
  106. # The maximum number of simultaneous Telegram deletions to handle.
  107. # A large number of simultaneous redactions could put strain on your homeserver.
  108. max_telegram_delete: 10
  109. # Allow logging in within Matrix. If false, the only way to log in is using the out-of-Matrix
  110. # login website (see appservice.public config section)
  111. allow_matrix_login: true
  112. # Use inline images instead of m.image to make rich captions possible.
  113. # N.B. Inline images are not supported on all clients (e.g. Riot iOS).
  114. inline_images: true
  115. # Whether or not to bridge plaintext highlights.
  116. # Only enable this if your displayname_template has some static part that the bridge can use to
  117. # reliably identify what is a plaintext highlight.
  118. plaintext_highlights: false
  119. # Whether or not to make portals of publicly joinable channels/supergroups publicly joinable on Matrix.
  120. public_portals: true
  121. # Whether to send stickers as the new native m.sticker type or normal m.images.
  122. # Old versions of Riot don't support the new type at all.
  123. # Remember that proper sticker support always requires Pillow to convert webp into png.
  124. native_stickers: true
  125. # Whether or not to fetch and handle Telegram updates at startup from the time the bridge was down.
  126. # WARNING: Probably buggy, might get stuck in infinite loop.
  127. catch_up: false
  128. # Whether or not to use /sync to get presence, read receipts and typing notifications when using
  129. # your own Matrix account as the Matrix puppet for your Telegram account.
  130. sync_with_custom_puppets: true
  131. # Some config options related to Telegram message deduplication.
  132. # The default values are usually fine, but some debug messages/warnings might recommend you
  133. # change these.
  134. deduplication:
  135. # Whether or not to check the database if the message about to be sent is a duplicate.
  136. pre_db_check: false
  137. # The number of latest events to keep when checking for duplicates.
  138. # You might need to increase this on high-traffic bridge instances.
  139. cache_queue_length: 20
  140. # The formats to use when sending messages to Telegram via the relay bot.
  141. #
  142. # Telegram doesn't have built-in emotes, so the m.emote format is also used for non-relaybot users.
  143. #
  144. # Available variables:
  145. # $sender_displayname - The display name of the sender (e.g. Example User)
  146. # $sender_username - The username (Matrix ID localpart) of the sender (e.g. exampleuser)
  147. # $sender_mxid - The Matrix ID of the sender (e.g. @exampleuser:example.com)
  148. # $message - The message content as HTML
  149. message_formats:
  150. m.text: "<b>$sender_displayname</b>: $message"
  151. m.emote: "* <b>$sender_displayname</b> $message"
  152. m.file: "<b>$sender_displayname</b> sent a file: $message"
  153. m.image: "<b>$sender_displayname</b> sent an image: $message"
  154. m.audio: "<b>$sender_displayname</b> sent an audio file: $message"
  155. m.video: "<b>$sender_displayname</b> sent a video: $message"
  156. m.location: "<b>$sender_displayname</b> sent a location: $message"
  157. # The formats to use when sending state events to Telegram via the relay bot.
  158. #
  159. # Variables from `message_formats` that have the `sender_` prefix are available without the prefix.
  160. # In name_change events, `$prev_displayname` is the previous displayname.
  161. #
  162. # Set format to an empty string to disable the messages for that event.
  163. state_event_formats:
  164. join: "<b>$displayname</b> joined the room."
  165. leave: "<b>$displayname</b> left the room."
  166. name_change: "<b>$prev_displayname</b> changed their name to <b>$displayname</b>"
  167. # Filter rooms that can/can't be bridged. Can also be managed using the `filter` and
  168. # `filter-mode` management commands.
  169. #
  170. # Filters do not affect direct chats.
  171. # An empty blacklist will essentially disable the filter.
  172. filter:
  173. # Filter mode to use. Either "blacklist" or "whitelist".
  174. # If the mode is "blacklist", the listed chats will never be bridged.
  175. # If the mode is "whitelist", only the listed chats can be bridged.
  176. mode: blacklist
  177. # The list of group/channel IDs to filter.
  178. list: []
  179. # The prefix for commands. Only required in non-management rooms.
  180. command_prefix: "!tg"
  181. # Permissions for using the bridge.
  182. # Permitted values:
  183. # relaybot - Only use the bridge via the relaybot, no access to commands.
  184. # user - Relaybot level + access to commands to create bridges.
  185. # puppeting - User level + logging in with a Telegram account.
  186. # full - Full access to use the bridge, i.e. previous levels + Matrix login.
  187. # admin - Full access to use the bridge and some extra administration commands.
  188. # Permitted keys:
  189. # * - All Matrix users
  190. # domain - All users on that homeserver
  191. # mxid - Specific user
  192. permissions:
  193. '{{ hostname_identity }}': full
  194. # Options related to the message relay Telegram bot.
  195. relaybot:
  196. # Whether or not to allow creating portals from Telegram.
  197. authless_portals: false
  198. # Whether or not to allow Telegram group admins to use the bot commands.
  199. whitelist_group_admins: false
  200. # Whether or not to ignore incoming events sent by the relay bot.
  201. ignore_own_incoming_events: true
  202. # List of usernames/user IDs who are also allowed to use the bot commands.
  203. whitelist:
  204. # Telegram config
  205. telegram:
  206. # Get your own API keys at https://my.telegram.org/apps
  207. api_id: {{ matrix_mautrix_telegram_api_id }}
  208. api_hash: {{ matrix_mautrix_telegram_api_hash }}
  209. # (Optional) Create your own bot at https://t.me/BotFather
  210. bot_token: disabled
  211. # Telethon proxy configuration.
  212. # You must install PySocks from pip for proxies to work.
  213. proxy:
  214. # Allowed types: disabled, socks4, socks5, http
  215. type: disabled
  216. # Proxy IP address and port.
  217. address: 127.0.0.1
  218. port: 1080
  219. # Whether or not to perform DNS resolving remotely.
  220. rdns: true
  221. # Proxy authentication (optional).
  222. username: ""
  223. password: ""
  224. # Python logging configuration.
  225. #
  226. # See section 16.7.2 of the Python documentation for more info:
  227. # https://docs.python.org/3.6/library/logging.config.html#configuration-dictionary-schema
  228. logging:
  229. version: 1
  230. formatters:
  231. precise:
  232. format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
  233. handlers:
  234. file:
  235. class: logging.handlers.RotatingFileHandler
  236. formatter: precise
  237. filename: ./mautrix-telegram.log
  238. maxBytes: 10485760
  239. backupCount: 10
  240. console:
  241. class: logging.StreamHandler
  242. formatter: precise
  243. loggers:
  244. mau:
  245. level: DEBUG
  246. telethon:
  247. level: DEBUG
  248. aiohttp:
  249. level: INFO
  250. root:
  251. level: DEBUG
  252. handlers: [file, console]