example-config.yaml 10 KB

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