example-config.yaml 13 KB

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