example-config.yaml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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 message attachments should be removed from disk after they're bridged.
  70. remove_file_after_handling: true
  71. # Bridge config
  72. bridge:
  73. # Localpart template of MXIDs for Signal users.
  74. # {userid} is replaced with an identifier for the Signal user.
  75. username_template: "signal_{userid}"
  76. # Displayname template for Signal users.
  77. # {displayname} is replaced with the displayname of the Signal user, which is the first
  78. # available variable in displayname_preference. The variables in displayname_preference
  79. # can also be used here directly.
  80. displayname_template: "{displayname} (Signal)"
  81. # Whether or not contact list displaynames should be used.
  82. # Possible values: disallow, allow, prefer
  83. #
  84. # Multi-user instances are recommended to disallow contact list names, as otherwise there can
  85. # be conflicts between names from different users' contact lists.
  86. contact_list_names: disallow
  87. # Available variables: full_name, first_name, last_name, phone, uuid
  88. displayname_preference:
  89. - full_name
  90. - phone
  91. # Whether or not to create portals for all groups on login/connect.
  92. autocreate_group_portal: true
  93. # Whether or not to create portals for all contacts on login/connect.
  94. autocreate_contact_portal: false
  95. # Whether or not to use /sync to get read receipts and typing notifications
  96. # when double puppeting is enabled
  97. sync_with_custom_puppets: true
  98. # Whether or not to update the m.direct account data event when double puppeting is enabled.
  99. # Note that updating the m.direct event is not atomic (except with mautrix-asmux)
  100. # and is therefore prone to race conditions.
  101. sync_direct_chat_list: false
  102. # Allow using double puppeting from any server with a valid client .well-known file.
  103. double_puppet_allow_discovery: false
  104. # Servers to allow double puppeting from, even if double_puppet_allow_discovery is false.
  105. double_puppet_server_map:
  106. example.com: https://example.com
  107. # Shared secret for https://github.com/devture/matrix-synapse-shared-secret-auth
  108. #
  109. # If set, custom puppets will be enabled automatically for local users
  110. # instead of users having to find an access token and run `login-matrix`
  111. # manually.
  112. # If using this for other servers than the bridge's server,
  113. # you must also set the URL in the double_puppet_server_map.
  114. login_shared_secret_map:
  115. example.com: foo
  116. # Whether or not created rooms should have federation enabled.
  117. # If false, created portal rooms will never be federated.
  118. federate_rooms: true
  119. # End-to-bridge encryption support options. You must install the e2be optional dependency for
  120. # this to work. See https://github.com/tulir/mautrix-telegram/wiki/End‐to‐bridge-encryption
  121. encryption:
  122. # Allow encryption, work in group chat rooms with e2ee enabled
  123. allow: false
  124. # Default to encryption, force-enable encryption in all portals the bridge creates
  125. # This will cause the bridge bot to be in private chats for the encryption to work properly.
  126. default: false
  127. # Options for automatic key sharing.
  128. key_sharing:
  129. # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
  130. # You must use a client that supports requesting keys from other users to use this feature.
  131. allow: false
  132. # Require the requesting device to have a valid cross-signing signature?
  133. # This doesn't require that the bridge has verified the device, only that the user has verified it.
  134. # Not yet implemented.
  135. require_cross_signing: false
  136. # Require devices to be verified by the bridge?
  137. # Verification by the bridge is not yet implemented.
  138. require_verification: true
  139. # Whether or not to explicitly set the avatar and room name for private
  140. # chat portal rooms. This will be implicitly enabled if encryption.default is true.
  141. private_chat_portal_meta: false
  142. # Whether or not the bridge should send a read receipt from the bridge bot when a message has
  143. # been sent to Signal. This let's you check manually whether the bridge is receiving your
  144. # messages.
  145. # Note that this is not related to Signal delivery receipts.
  146. delivery_receipts: false
  147. # Whether or not delivery errors should be reported as messages in the Matrix room. (not yet implemented)
  148. delivery_error_reports: false
  149. # Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run.
  150. # This field will automatically be changed back to false after it,
  151. # except if the config file is not writable.
  152. resend_bridge_info: false
  153. # Interval at which to resync contacts.
  154. periodic_sync: 0
  155. # Provisioning API part of the web server for automated portal creation and fetching information.
  156. # Used by things like mautrix-manager (https://github.com/tulir/mautrix-manager).
  157. provisioning:
  158. # Whether or not the provisioning API should be enabled.
  159. enabled: true
  160. # The prefix to use in the provisioning API endpoints.
  161. prefix: /_matrix/provision/v1
  162. # The shared secret to authorize users of the API.
  163. # Set to "generate" to generate and save a new token.
  164. shared_secret: generate
  165. # The prefix for commands. Only required in non-management rooms.
  166. command_prefix: "!signal"
  167. # Permissions for using the bridge.
  168. # Permitted values:
  169. # user - Use the bridge with puppeting.
  170. # admin - Use and administrate the bridge.
  171. # Permitted keys:
  172. # * - All Matrix users
  173. # domain - All users on that homeserver
  174. # mxid - Specific user
  175. permissions:
  176. "example.com": "user"
  177. "@admin:example.com": "admin"
  178. # Python logging configuration.
  179. #
  180. # See section 16.7.2 of the Python documentation for more info:
  181. # https://docs.python.org/3.6/library/logging.config.html#configuration-dictionary-schema
  182. logging:
  183. version: 1
  184. formatters:
  185. colored:
  186. (): mautrix_signal.util.ColorFormatter
  187. format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
  188. normal:
  189. format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
  190. handlers:
  191. file:
  192. class: logging.handlers.RotatingFileHandler
  193. formatter: normal
  194. filename: ./mautrix-signal.log
  195. maxBytes: 10485760
  196. backupCount: 10
  197. console:
  198. class: logging.StreamHandler
  199. formatter: colored
  200. loggers:
  201. mau:
  202. level: DEBUG
  203. aiohttp:
  204. level: INFO
  205. root:
  206. level: DEBUG
  207. handlers: [file, console]