example-config.yaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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. # Options for automatic key sharing.
  160. key_sharing:
  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: false
  164. # Require the requesting device to have a valid cross-signing signature?
  165. # This doesn't require that the bridge has verified the device, only that the user has verified it.
  166. # Not yet implemented.
  167. require_cross_signing: false
  168. # Require devices to be verified by the bridge?
  169. # Verification by the bridge is not yet implemented.
  170. require_verification: true
  171. # Whether or not to explicitly set the avatar and room name for private
  172. # chat portal rooms. This will be implicitly enabled if encryption.default is true.
  173. private_chat_portal_meta: false
  174. # Whether or not the bridge should send a read receipt from the bridge bot when a message has
  175. # been sent to Signal. This let's you check manually whether the bridge is receiving your
  176. # messages.
  177. # Note that this is not related to Signal delivery receipts.
  178. delivery_receipts: false
  179. # Whether or not delivery errors should be reported as messages in the Matrix room. (not yet implemented)
  180. delivery_error_reports: false
  181. # Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run.
  182. # This field will automatically be changed back to false after it,
  183. # except if the config file is not writable.
  184. resend_bridge_info: false
  185. # Interval at which to resync contacts (in seconds).
  186. periodic_sync: 0
  187. # Should leaving the room on Matrix make the user leave on Signal?
  188. bridge_matrix_leave: true
  189. # Provisioning API part of the web server for automated portal creation and fetching information.
  190. # Used by things like mautrix-manager (https://github.com/tulir/mautrix-manager).
  191. provisioning:
  192. # Whether or not the provisioning API should be enabled.
  193. enabled: true
  194. # The prefix to use in the provisioning API endpoints.
  195. prefix: /_matrix/provision
  196. # The shared secret to authorize users of the API.
  197. # Set to "generate" to generate and save a new token.
  198. shared_secret: generate
  199. # Segment API key to enable analytics tracking for web server
  200. # endpoints. Set to null to disable.
  201. # Currently the only events are login start, QR code scan, and login
  202. # success/failure.
  203. segment_key: null
  204. # The prefix for commands. Only required in non-management rooms.
  205. command_prefix: "!signal"
  206. # Messages sent upon joining a management room.
  207. # Markdown is supported. The defaults are listed below.
  208. management_room_text:
  209. # Sent when joining a room.
  210. welcome: "Hello, I'm a Signal bridge bot."
  211. # Sent when joining a management room and the user is already logged in.
  212. welcome_connected: "Use `help` for help."
  213. # Sent when joining a management room and the user is not logged in.
  214. welcome_unconnected: "Use `help` for help or `link` to log in."
  215. # Optional extra text sent when joining a management room.
  216. additional_help: ""
  217. # Send each message separately (for readability in some clients)
  218. management_room_multiple_messages: false
  219. # Permissions for using the bridge.
  220. # Permitted values:
  221. # relay - Allowed to be relayed through the bridge, no access to commands.
  222. # user - Use the bridge with puppeting.
  223. # admin - Use and administrate the bridge.
  224. # Permitted keys:
  225. # * - All Matrix users
  226. # domain - All users on that homeserver
  227. # mxid - Specific user
  228. permissions:
  229. "*": "relay"
  230. "example.com": "user"
  231. "@admin:example.com": "admin"
  232. relay:
  233. # Whether relay mode should be allowed. If allowed, `!signal set-relay` can be used to turn any
  234. # authenticated user into a relaybot for that chat.
  235. enabled: false
  236. # The formats to use when sending messages to Signal via a relay user.
  237. #
  238. # Available variables:
  239. # $sender_displayname - The display name of the sender (e.g. Example User)
  240. # $sender_username - The username (Matrix ID localpart) of the sender (e.g. exampleuser)
  241. # $sender_mxid - The Matrix ID of the sender (e.g. @exampleuser:example.com)
  242. # $message - The message content
  243. message_formats:
  244. m.text: '$sender_displayname: $message'
  245. m.notice: '$sender_displayname: $message'
  246. m.emote: '* $sender_displayname $message'
  247. m.file: '$sender_displayname sent a file'
  248. m.image: '$sender_displayname sent an image'
  249. m.audio: '$sender_displayname sent an audio file'
  250. m.video: '$sender_displayname sent a video'
  251. m.location: '$sender_displayname sent a location'
  252. # Python logging configuration.
  253. #
  254. # See section 16.7.2 of the Python documentation for more info:
  255. # https://docs.python.org/3.6/library/logging.config.html#configuration-dictionary-schema
  256. logging:
  257. version: 1
  258. formatters:
  259. colored:
  260. (): mautrix_signal.util.ColorFormatter
  261. format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
  262. normal:
  263. format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
  264. handlers:
  265. file:
  266. class: logging.handlers.RotatingFileHandler
  267. formatter: normal
  268. filename: ./mautrix-signal.log
  269. maxBytes: 10485760
  270. backupCount: 10
  271. console:
  272. class: logging.StreamHandler
  273. formatter: colored
  274. loggers:
  275. mau:
  276. level: DEBUG
  277. aiohttp:
  278. level: INFO
  279. root:
  280. level: DEBUG
  281. handlers: [file, console]