Matrix Docker Ansible eploy
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

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