example-config.yaml 13 KB

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