example-config.yaml 17 KB

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