example-config.yaml 13 KB

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