example-config.yaml 11 KB

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