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