example-config.yaml 13 KB

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