example-config.yaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. # Homeserver details
  2. homeserver:
  3. # The address that this appservice can use to connect to the homeserver.
  4. address: https://example.com
  5. # The domain of the homeserver (for MXIDs, etc).
  6. domain: example.com
  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. asmux: false
  11. # Number of retries for all HTTP requests if the homeserver isn't reachable.
  12. http_retry_count: 4
  13. # The URL to push real-time bridge status to.
  14. # If set, the bridge will make POST requests to this URL whenever a user's Signal connection state changes.
  15. # The bridge will use the appservice as_token to authorize requests.
  16. status_endpoint: null
  17. # Endpoint for reporting per-message status.
  18. message_send_checkpoint_endpoint: null
  19. # Maximum number of simultaneous HTTP connections to the homeserver.
  20. connection_limit: 100
  21. # Whether asynchronous uploads via MSC2246 should be enabled for media.
  22. # Requires a media repo that supports MSC2246.
  23. async_media: false
  24. # Application service host/registration related details
  25. # Changing these values requires regeneration of the registration.
  26. appservice:
  27. # The address that the homeserver can use to connect to this appservice.
  28. address: http://localhost:29328
  29. # When using https:// the TLS certificate and key files for the address.
  30. tls_cert: false
  31. tls_key: false
  32. # The hostname and port where this appservice should listen.
  33. hostname: 0.0.0.0
  34. port: 29328
  35. # The maximum body size of appservice API requests (from the homeserver) in mebibytes
  36. # Usually 1 is enough, but on high-traffic bridges you might need to increase this to avoid 413s
  37. max_body_size: 1
  38. # The full URI to the database. SQLite and Postgres are supported.
  39. # However, SQLite support is extremely experimental and should not be used.
  40. # Format examples:
  41. # SQLite: sqlite:///filename.db
  42. # Postgres: postgres://username:password@hostname/dbname
  43. database: postgres://username:password@hostname/db
  44. # Additional arguments for asyncpg.create_pool() or sqlite3.connect()
  45. # https://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.pool.create_pool
  46. # https://docs.python.org/3/library/sqlite3.html#sqlite3.connect
  47. # For sqlite, min_size is used as the connection thread pool size and max_size is ignored.
  48. database_opts:
  49. min_size: 5
  50. max_size: 10
  51. # The unique ID of this appservice.
  52. id: signal
  53. # Username of the appservice bot.
  54. bot_username: signalbot
  55. # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
  56. # to leave display name/avatar as-is.
  57. bot_displayname: Signal bridge bot
  58. bot_avatar: mxc://maunium.net/wPJgTQbZOtpBFmDNkiNEMDUp
  59. # Whether or not to receive ephemeral events via appservice transactions.
  60. # Requires MSC2409 support (i.e. Synapse 1.22+).
  61. # You should disable bridge -> sync_with_custom_puppets when this is enabled.
  62. ephemeral_events: false
  63. # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
  64. as_token: "This value is generated when generating the registration"
  65. hs_token: "This value is generated when generating the registration"
  66. # Prometheus telemetry config. Requires prometheus-client to be installed.
  67. metrics:
  68. enabled: false
  69. listen_port: 8000
  70. # Manhole config.
  71. manhole:
  72. # Whether or not opening the manhole is allowed.
  73. enabled: false
  74. # The path for the unix socket.
  75. path: /var/tmp/mautrix-signal.manhole
  76. # The list of UIDs who can be added to the whitelist.
  77. # If empty, any UIDs can be specified in the open-manhole command.
  78. whitelist:
  79. - 0
  80. signal:
  81. # Path to signald unix socket
  82. socket_path: /var/run/signald/signald.sock
  83. # Directory for temp files when sending files to Signal. This should be an
  84. # absolute path that signald can read. For attachments in the other direction,
  85. # make sure signald is configured to use an absolute path as the data directory.
  86. outgoing_attachment_dir: /tmp
  87. # Directory where signald stores avatars for groups.
  88. avatar_dir: ~/.config/signald/avatars
  89. # Directory where signald stores auth data. Used to delete data when logging out.
  90. data_dir: ~/.config/signald/data
  91. # Whether or not unknown signald accounts should be deleted when the bridge is started.
  92. # When this is enabled, any UserInUse errors should be resolved by restarting the bridge.
  93. delete_unknown_accounts_on_start: false
  94. # Whether or not message attachments should be removed from disk after they're bridged.
  95. remove_file_after_handling: true
  96. # Whether or not users can register a primary device
  97. registration_enabled: true
  98. # Whether or not to enable disappearing messages in groups. If enabled, then the expiration
  99. # time of the messages will be determined by the first users to read the message, rather
  100. # than individually. If the bridge has a single user, this can be turned on safely.
  101. enable_disappearing_messages_in_groups: false
  102. # Bridge config
  103. bridge:
  104. # Localpart template of MXIDs for Signal users.
  105. # {userid} is replaced with an identifier for the Signal user.
  106. username_template: "signal_{userid}"
  107. # Displayname template for Signal users.
  108. # {displayname} is replaced with the displayname of the Signal user, which is the first
  109. # available variable in displayname_preference. The variables in displayname_preference
  110. # can also be used here directly.
  111. displayname_template: "{displayname} (Signal)"
  112. # Whether or not contact list displaynames should be used.
  113. # Possible values: disallow, allow, prefer
  114. #
  115. # Multi-user instances are recommended to disallow contact list names, as otherwise there can
  116. # be conflicts between names from different users' contact lists.
  117. contact_list_names: disallow
  118. # Available variables: full_name, first_name, last_name, phone, uuid
  119. displayname_preference:
  120. - full_name
  121. - phone
  122. # Whether or not to create portals for all groups on login/connect.
  123. autocreate_group_portal: true
  124. # Whether or not to create portals for all contacts on login/connect.
  125. autocreate_contact_portal: false
  126. # Whether or not to use /sync to get read receipts and typing notifications
  127. # when double puppeting is enabled
  128. sync_with_custom_puppets: true
  129. # Whether or not to update the m.direct account data event when double puppeting is enabled.
  130. # Note that updating the m.direct event is not atomic (except with mautrix-asmux)
  131. # and is therefore prone to race conditions.
  132. sync_direct_chat_list: false
  133. # Allow using double puppeting from any server with a valid client .well-known file.
  134. double_puppet_allow_discovery: false
  135. # Servers to allow double puppeting from, even if double_puppet_allow_discovery is false.
  136. double_puppet_server_map:
  137. example.com: https://example.com
  138. # Shared secret for https://github.com/devture/matrix-synapse-shared-secret-auth
  139. #
  140. # If set, custom puppets will be enabled automatically for local users
  141. # instead of users having to find an access token and run `login-matrix`
  142. # manually.
  143. # If using this for other servers than the bridge's server,
  144. # you must also set the URL in the double_puppet_server_map.
  145. login_shared_secret_map:
  146. example.com: foo
  147. # Whether or not created rooms should have federation enabled.
  148. # If false, created portal rooms will never be federated.
  149. federate_rooms: true
  150. # End-to-bridge encryption support options.
  151. #
  152. # See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info.
  153. encryption:
  154. # Allow encryption, work in group chat rooms with e2ee enabled
  155. allow: false
  156. # Default to encryption, force-enable encryption in all portals the bridge creates
  157. # This will cause the bridge bot to be in private chats for the encryption to work properly.
  158. default: false
  159. # Require encryption, drop any unencrypted messages.
  160. require: true
  161. # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
  162. # You must use a client that supports requesting keys from other users to use this feature.
  163. allow_key_sharing: false
  164. # What level of device verification should be required from users?
  165. #
  166. # Valid levels:
  167. # unverified - Send keys to all device in the room.
  168. # cross-signed-untrusted - Require valid cross-signing, but trust all cross-signing keys.
  169. # cross-signed-tofu - Require valid cross-signing, trust cross-signing keys on first use (and reject changes).
  170. # cross-signed-verified - Require valid cross-signing, plus a valid user signature from the bridge bot.
  171. # Note that creating user signatures from the bridge bot is not currently possible.
  172. # verified - Require manual per-device verification
  173. # (currently only possible by modifying the `trust` column in the `crypto_device` database table).
  174. verification_levels:
  175. # Minimum level for which the bridge should send keys to when bridging messages from Telegram to Matrix.
  176. receive: unverified
  177. # Minimum level that the bridge should accept for incoming Matrix messages.
  178. send: unverified
  179. # Minimum level that the bridge should require for accepting key requests.
  180. share: cross-signed-tofu
  181. # Options for Megolm room key rotation. These options allow you to
  182. # configure the m.room.encryption event content. See:
  183. # https://spec.matrix.org/v1.3/client-server-api/#mroomencryption for
  184. # more information about that event.
  185. rotation:
  186. # Enable custom Megolm room key rotation settings. Note that these
  187. # settings will only apply to rooms created after this option is
  188. # set.
  189. enable_custom: false
  190. # The maximum number of milliseconds a session should be used
  191. # before changing it. The Matrix spec recommends 604800000 (a week)
  192. # as the default.
  193. milliseconds: 604800000
  194. # The maximum number of messages that should be sent with a given a
  195. # session before changing it. The Matrix spec recommends 100 as the
  196. # default.
  197. messages: 100
  198. # Whether or not to explicitly set the avatar and room name for private
  199. # chat portal rooms. This will be implicitly enabled if encryption.default is true.
  200. private_chat_portal_meta: false
  201. # Whether or not the bridge should send a read receipt from the bridge bot when a message has
  202. # been sent to Signal. This let's you check manually whether the bridge is receiving your
  203. # messages.
  204. # Note that this is not related to Signal delivery receipts.
  205. delivery_receipts: false
  206. # Whether or not delivery errors should be reported as messages in the Matrix room.
  207. delivery_error_reports: true
  208. # Whether the bridge should send the message status as a custom com.beeper.message_send_status event.
  209. message_status_events: false
  210. # Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run.
  211. # This field will automatically be changed back to false after it,
  212. # except if the config file is not writable.
  213. resend_bridge_info: false
  214. # Interval at which to resync contacts (in seconds).
  215. periodic_sync: 0
  216. # Should leaving the room on Matrix make the user leave on Signal?
  217. bridge_matrix_leave: true
  218. # Provisioning API part of the web server for automated portal creation and fetching information.
  219. # Used by things like mautrix-manager (https://github.com/tulir/mautrix-manager).
  220. provisioning:
  221. # Whether or not the provisioning API should be enabled.
  222. enabled: true
  223. # The prefix to use in the provisioning API endpoints.
  224. prefix: /_matrix/provision
  225. # The shared secret to authorize users of the API.
  226. # Set to "generate" to generate and save a new token.
  227. shared_secret: generate
  228. # Segment API key to enable analytics tracking for web server
  229. # endpoints. Set to null to disable.
  230. # Currently the only events are login start, QR code scan, and login
  231. # success/failure.
  232. segment_key: null
  233. # The prefix for commands. Only required in non-management rooms.
  234. command_prefix: "!signal"
  235. # Messages sent upon joining a management room.
  236. # Markdown is supported. The defaults are listed below.
  237. management_room_text:
  238. # Sent when joining a room.
  239. welcome: "Hello, I'm a Signal bridge bot."
  240. # Sent when joining a management room and the user is already logged in.
  241. welcome_connected: "Use `help` for help."
  242. # Sent when joining a management room and the user is not logged in.
  243. welcome_unconnected: "Use `help` for help or `link` to log in."
  244. # Optional extra text sent when joining a management room.
  245. additional_help: ""
  246. # Send each message separately (for readability in some clients)
  247. management_room_multiple_messages: false
  248. # Permissions for using the bridge.
  249. # Permitted values:
  250. # relay - Allowed to be relayed through the bridge, no access to commands.
  251. # user - Use the bridge with puppeting.
  252. # admin - Use and administrate the bridge.
  253. # Permitted keys:
  254. # * - All Matrix users
  255. # domain - All users on that homeserver
  256. # mxid - Specific user
  257. permissions:
  258. "*": "relay"
  259. "example.com": "user"
  260. "@admin:example.com": "admin"
  261. relay:
  262. # Whether relay mode should be allowed. If allowed, `!signal set-relay` can be used to turn any
  263. # authenticated user into a relaybot for that chat.
  264. enabled: false
  265. # The formats to use when sending messages to Signal via a relay user.
  266. #
  267. # Available variables:
  268. # $sender_displayname - The display name of the sender (e.g. Example User)
  269. # $sender_username - The username (Matrix ID localpart) of the sender (e.g. exampleuser)
  270. # $sender_mxid - The Matrix ID of the sender (e.g. @exampleuser:example.com)
  271. # $message - The message content
  272. message_formats:
  273. m.text: '$sender_displayname: $message'
  274. m.notice: '$sender_displayname: $message'
  275. m.emote: '* $sender_displayname $message'
  276. m.file: '$sender_displayname sent a file'
  277. m.image: '$sender_displayname sent an image'
  278. m.audio: '$sender_displayname sent an audio file'
  279. m.video: '$sender_displayname sent a video'
  280. m.location: '$sender_displayname sent a location'
  281. # Python logging configuration.
  282. #
  283. # See section 16.7.2 of the Python documentation for more info:
  284. # https://docs.python.org/3.6/library/logging.config.html#configuration-dictionary-schema
  285. logging:
  286. version: 1
  287. formatters:
  288. colored:
  289. (): mautrix_signal.util.ColorFormatter
  290. format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
  291. normal:
  292. format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
  293. handlers:
  294. file:
  295. class: logging.handlers.RotatingFileHandler
  296. formatter: normal
  297. filename: ./mautrix-signal.log
  298. maxBytes: 10485760
  299. backupCount: 10
  300. console:
  301. class: logging.StreamHandler
  302. formatter: colored
  303. loggers:
  304. mau:
  305. level: DEBUG
  306. aiohttp:
  307. level: INFO
  308. root:
  309. level: DEBUG
  310. handlers: [file, console]