example-config.yaml 18 KB

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