example-config.yaml 14 KB

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