Matrix Docker Ansible eploy
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

398 wiersze
18 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. # 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: {{ matrix_mautrix_telegram_appservice_address }}
  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: {{ matrix_mautrix_telegram_appservice_public_external }}
  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.
  58. as_token: "{{ matrix_mautrix_telegram_appservice_token }}"
  59. hs_token: "{{ matrix_mautrix_telegram_homeserver_token }}"
  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. # Maximum length of displayname
  90. displayname_max_length: 100
  91. # Maximum number of members to sync per portal when starting up. Other members will be
  92. # synced when they send messages. The maximum is 10000, after which the Telegram server
  93. # will not send any more members.
  94. # Defaults to no local limit (-> limited to 10000 by server)
  95. max_initial_member_sync: -1
  96. # Whether or not to sync the member list in channels.
  97. # If no channel admins have logged into the bridge, the bridge won't be able to sync the member
  98. # list regardless of this setting.
  99. sync_channel_members: true
  100. # Whether or not to skip deleted members when syncing members.
  101. skip_deleted_members: true
  102. # Whether or not to automatically synchronize contacts and chats of Matrix users logged into
  103. # their Telegram account at startup.
  104. startup_sync: true
  105. # Number of most recently active dialogs to check when syncing chats.
  106. # Dialogs include groups and private chats, but only groups are synced.
  107. # Set to 0 to remove limit.
  108. sync_dialog_limit: 30
  109. # Whether or not to sync and create portals for direct chats at startup.
  110. sync_direct_chats: false
  111. # The maximum number of simultaneous Telegram deletions to handle.
  112. # A large number of simultaneous redactions could put strain on your homeserver.
  113. max_telegram_delete: 10
  114. # Whether or not to automatically sync the Matrix room state (mostly unpuppeted displaynames)
  115. # at startup and when creating a bridge.
  116. sync_matrix_state: true
  117. # Allow logging in within Matrix. If false, the only way to log in is using the out-of-Matrix
  118. # login website (see appservice.public config section)
  119. allow_matrix_login: true
  120. # Whether or not to bridge plaintext highlights.
  121. # Only enable this if your displayname_template has some static part that the bridge can use to
  122. # reliably identify what is a plaintext highlight.
  123. plaintext_highlights: false
  124. # Whether or not to make portals of publicly joinable channels/supergroups publicly joinable on Matrix.
  125. public_portals: true
  126. # Whether or not to use /sync to get presence, read receipts and typing notifications when using
  127. # your own Matrix account as the Matrix puppet for your Telegram account.
  128. sync_with_custom_puppets: true
  129. # Shared secret for https://github.com/devture/matrix-synapse-shared-secret-auth
  130. #
  131. # If set, custom puppets will be enabled automatically for local users
  132. # instead of users having to find an access token and run `login-matrix`
  133. # manually.
  134. login_shared_secret: {{ matrix_mautrix_telegram_login_shared_secret|to_json }}
  135. # Set to false to disable link previews in messages sent to Telegram.
  136. telegram_link_preview: true
  137. # Use inline images instead of a separate message for the caption.
  138. # N.B. Inline images are not supported on all clients (e.g. Riot iOS).
  139. inline_images: false
  140. # Maximum size of image in megabytes before sending to Telegram as a document.
  141. image_as_file_size: 10
  142. # Maximum size of Telegram documents in megabytes to bridge.
  143. max_document_size: 100
  144. # Enable experimental parallel file transfer, which makes uploads/downloads much faster by
  145. # streaming from/to Matrix and using many connections for Telegram.
  146. # Note that generating HQ thumbnails for videos is not possible with streamed transfers.
  147. parallel_file_transfer: false
  148. # Whether or not created rooms should have federation enabled.
  149. # If false, created portal rooms will never be federated.
  150. federate_rooms: true
  151. # Settings for converting animated stickers.
  152. animated_sticker:
  153. # Format to which animated stickers should be converted.
  154. # disable - No conversion, send as-is (gzipped lottie)
  155. # png - converts to non-animated png (fastest),
  156. # gif - converts to animated gif, but loses transparency
  157. # webm - converts to webm video, requires ffmpeg executable with vp9 codec and webm container support
  158. target: gif
  159. # Arguments for converter. All converters take width and height.
  160. # GIF converter takes background as a hex color.
  161. args:
  162. width: 256
  163. height: 256
  164. background: "020202" # only for gif
  165. fps: 30 # only for webm
  166. # End-to-bridge encryption support options. These require matrix-nio to be installed with pip
  167. # and login_shared_secret to be configured in order to get a device for the bridge bot.
  168. #
  169. # Additionally, https://github.com/matrix-org/synapse/pull/5758 is required if using a normal
  170. # application service.
  171. encryption:
  172. # Allow encryption, work in group chat rooms with e2ee enabled
  173. allow: false
  174. # Default to encryption, force-enable encryption in all portals the bridge creates
  175. # This will cause the bridge bot to be in private chats for the encryption to work properly.
  176. default: false
  177. # Overrides for base power levels.
  178. initial_power_level_overrides:
  179. user: {}
  180. group: {}
  181. # Whether to bridge Telegram bot messages as m.notices or m.texts.
  182. bot_messages_as_notices: true
  183. bridge_notices:
  184. # Whether or not Matrix bot messages (type m.notice) should be bridged.
  185. default: false
  186. # List of user IDs for whom the previous flag is flipped.
  187. # e.g. if bridge_notices.default is false, notices from other users will not be bridged, but
  188. # notices from users listed here will be bridged.
  189. exceptions: []
  190. # Some config options related to Telegram message deduplication.
  191. # The default values are usually fine, but some debug messages/warnings might recommend you
  192. # change these.
  193. deduplication:
  194. # Whether or not to check the database if the message about to be sent is a duplicate.
  195. pre_db_check: false
  196. # The number of latest events to keep when checking for duplicates.
  197. # You might need to increase this on high-traffic bridge instances.
  198. cache_queue_length: 20
  199. # The formats to use when sending messages to Telegram via the relay bot.
  200. #
  201. # Telegram doesn't have built-in emotes, so the m.emote format is also used for non-relaybot users.
  202. #
  203. # Available variables:
  204. # $sender_displayname - The display name of the sender (e.g. Example User)
  205. # $sender_username - The username (Matrix ID localpart) of the sender (e.g. exampleuser)
  206. # $sender_mxid - The Matrix ID of the sender (e.g. @exampleuser:example.com)
  207. # $message - The message content as HTML
  208. message_formats:
  209. m.text: "<b>$sender_displayname</b>: $message"
  210. m.notice: "<b>$sender_displayname</b>: $message"
  211. m.emote: "* <b>$sender_displayname</b> $message"
  212. m.file: "<b>$sender_displayname</b> sent a file: $message"
  213. m.image: "<b>$sender_displayname</b> sent an image: $message"
  214. m.audio: "<b>$sender_displayname</b> sent an audio file: $message"
  215. m.video: "<b>$sender_displayname</b> sent a video: $message"
  216. m.location: "<b>$sender_displayname</b> sent a location: $message"
  217. # Telegram doesn't have built-in emotes, this field specifies how m.emote's from authenticated
  218. # users are sent to telegram. All fields in message_formats are supported. Additionally, the
  219. # Telegram user info is available in the following variables:
  220. # $displayname - Telegram displayname
  221. # $username - Telegram username (may not exist)
  222. # $mention - Telegram @username or displayname mention (depending on which exists)
  223. emote_format: "* $mention $formatted_body"
  224. # The formats to use when sending state events to Telegram via the relay bot.
  225. #
  226. # Variables from `message_formats` that have the `sender_` prefix are available without the prefix.
  227. # In name_change events, `$prev_displayname` is the previous displayname.
  228. #
  229. # Set format to an empty string to disable the messages for that event.
  230. state_event_formats:
  231. join: "<b>$displayname</b> joined the room."
  232. leave: "<b>$displayname</b> left the room."
  233. name_change: "<b>$prev_displayname</b> changed their name to <b>$displayname</b>"
  234. # Filter rooms that can/can't be bridged. Can also be managed using the `filter` and
  235. # `filter-mode` management commands.
  236. #
  237. # Filters do not affect direct chats.
  238. # An empty blacklist will essentially disable the filter.
  239. filter:
  240. # Filter mode to use. Either "blacklist" or "whitelist".
  241. # If the mode is "blacklist", the listed chats will never be bridged.
  242. # If the mode is "whitelist", only the listed chats can be bridged.
  243. mode: blacklist
  244. # The list of group/channel IDs to filter.
  245. list: []
  246. # The prefix for commands. Only required in non-management rooms.
  247. command_prefix: "!tg"
  248. # Permissions for using the bridge.
  249. # Permitted values:
  250. # relaybot - Only use the bridge via the relaybot, no access to commands.
  251. # user - Relaybot level + access to commands to create bridges.
  252. # puppeting - User level + logging in with a Telegram account.
  253. # full - Full access to use the bridge, i.e. previous levels + Matrix login.
  254. # admin - Full access to use the bridge and some extra administration commands.
  255. # Permitted keys:
  256. # * - All Matrix users
  257. # domain - All users on that homeserver
  258. # mxid - Specific user
  259. permissions:
  260. '{{ matrix_mautrix_telegram_homeserver_domain }}': full
  261. # Options related to the message relay Telegram bot.
  262. relaybot:
  263. private_chat:
  264. # List of users to invite to the portal when someone starts a private chat with the bot.
  265. # If empty, private chats with the bot won't create a portal.
  266. invite: []
  267. # Whether or not to bridge state change messages in relaybot private chats.
  268. state_changes: true
  269. # When private_chat_invite is empty, this message is sent to users /starting the
  270. # relaybot. Telegram's "markdown" is supported.
  271. message: This is a Matrix bridge relaybot and does not support direct chats
  272. # List of users to invite to all group chat portals created by the bridge.
  273. group_chat_invite: []
  274. # Whether or not the relaybot should not bridge events in unbridged group chats.
  275. # If false, portals will be created when the relaybot receives messages, just like normal
  276. # users. This behavior is usually not desirable, as it interferes with manually bridging
  277. # the chat to another room.
  278. ignore_unbridged_group_chat: true
  279. # Whether or not to allow creating portals from Telegram.
  280. authless_portals: true
  281. # Whether or not to allow Telegram group admins to use the bot commands.
  282. whitelist_group_admins: true
  283. # Whether or not to ignore incoming events sent by the relay bot.
  284. ignore_own_incoming_events: true
  285. # List of usernames/user IDs who are also allowed to use the bot commands.
  286. whitelist: []
  287. # Telegram config
  288. telegram:
  289. # Get your own API keys at https://my.telegram.org/apps
  290. api_id: {{ matrix_mautrix_telegram_api_id }}
  291. api_hash: {{ matrix_mautrix_telegram_api_hash }}
  292. # (Optional) Create your own bot at https://t.me/BotFather
  293. bot_token: {{ matrix_mautrix_telegram_bot_token }}
  294. # Telethon connection options.
  295. connection:
  296. # The timeout in seconds to be used when connecting.
  297. timeout: 120
  298. # How many times the reconnection should retry, either on the initial connection or when
  299. # Telegram disconnects us. May be set to a negative or null value for infinite retries, but
  300. # this is not recommended, since the program can get stuck in an infinite loop.
  301. retries: 5
  302. # The delay in seconds to sleep between automatic reconnections.
  303. retry_delay: 1
  304. # The threshold below which the library should automatically sleep on flood wait errors
  305. # (inclusive). For instance, if a FloodWaitError for 17s occurs and flood_sleep_threshold
  306. # is 20s, the library will sleep automatically. If the error was for 21s, it would raise
  307. # the error instead. Values larger than a day (86400) will be changed to a day.
  308. flood_sleep_threshold: 60
  309. # How many times a request should be retried. Request are retried when Telegram is having
  310. # internal issues, when there is a FloodWaitError less than flood_sleep_threshold, or when
  311. # there's a migrate error. May take a negative or null value for infinite retries, but this
  312. # is not recommended, since some requests can always trigger a call fail (such as searching
  313. # for messages).
  314. request_retries: 5
  315. # Device info sent to Telegram.
  316. device_info:
  317. # "auto" = OS name+version.
  318. device_model: auto
  319. # "auto" = Telethon version.
  320. system_version: auto
  321. # "auto" = mautrix-telegram version.
  322. app_version: auto
  323. lang_code: en
  324. system_lang_code: en
  325. # Custom server to connect to.
  326. server:
  327. # Set to true to use these server settings. If false, will automatically
  328. # use production server assigned by Telegram. Set to false in production.
  329. enabled: false
  330. # The DC ID to connect to.
  331. dc: 2
  332. # The IP to connect to.
  333. ip: 149.154.167.40
  334. # The port to connect to. 443 may not work, 80 is better and both are equally secure.
  335. port: 80
  336. # Telethon proxy configuration.
  337. # You must install PySocks from pip for proxies to work.
  338. proxy:
  339. # Allowed types: disabled, socks4, socks5, http
  340. type: disabled
  341. # Proxy IP address and port.
  342. address: 127.0.0.1
  343. port: 1080
  344. # Whether or not to perform DNS resolving remotely.
  345. rdns: true
  346. # Proxy authentication (optional).
  347. username: ""
  348. password: ""
  349. # Python logging configuration.
  350. #
  351. # See section 16.7.2 of the Python documentation for more info:
  352. # https://docs.python.org/3.6/library/logging.config.html#configuration-dictionary-schema
  353. logging:
  354. version: 1
  355. formatters:
  356. precise:
  357. format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
  358. handlers:
  359. console:
  360. class: logging.StreamHandler
  361. formatter: precise
  362. loggers:
  363. mau:
  364. level: DEBUG
  365. telethon:
  366. level: DEBUG
  367. aiohttp:
  368. level: INFO
  369. root:
  370. level: DEBUG
  371. handlers: [console]