example-config.yaml 13 KB

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