Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

390 lines
15 KiB

  1. # This is the Dendrite configuration file.
  2. #
  3. # The configuration is split up into sections - each Dendrite component has a
  4. # configuration section, in addition to the "global" section which applies to
  5. # all components.
  6. #
  7. # At a minimum, to get started, you will need to update the settings in the
  8. # "global" section for your deployment, and you will need to check that the
  9. # database "connection_string" line in each component section is correct.
  10. #
  11. # Each component with a "database" section can accept the following formats
  12. # for "connection_string":
  13. # SQLite: file:filename.db
  14. # file:///path/to/filename.db
  15. # PostgreSQL: postgresql://user:pass@hostname/database?params=...
  16. #
  17. # SQLite is embedded into Dendrite and therefore no further prerequisites are
  18. # needed for the database when using SQLite mode. However, performance with
  19. # PostgreSQL is significantly better and recommended for multi-user deployments.
  20. # SQLite is typically around 20-30% slower than PostgreSQL when tested with a
  21. # small number of users and likely will perform worse still with a higher volume
  22. # of users.
  23. #
  24. # The "max_open_conns" and "max_idle_conns" settings configure the maximum
  25. # number of open/idle database connections. The value 0 will use the database
  26. # engine default, and a negative value will use unlimited connections. The
  27. # "conn_max_lifetime" option controls the maximum length of time a database
  28. # connection can be idle in seconds - a negative value is unlimited.
  29. # The version of the configuration file.
  30. version: 1
  31. # Global Matrix configuration. This configuration applies to all components.
  32. global:
  33. # The domain name of this homeserver.
  34. server_name: {{ matrix_domain|to_json }}
  35. # The path to the signing private key file, used to sign requests and events.
  36. # Note that this is NOT the same private key as used for TLS! To generate a
  37. # signing key, use "./bin/generate-keys --private-key matrix_key.pem".
  38. private_key: "/data/{{ matrix_server_fqn_matrix }}.signing.pem"
  39. # The paths and expiry timestamps (as a UNIX timestamp in millisecond precision)
  40. # to old signing private keys that were formerly in use on this domain. These
  41. # keys will not be used for federation request or event signing, but will be
  42. # provided to any other homeserver that asks when trying to verify old events.
  43. # old_private_keys:
  44. # - private_key: old_matrix_key.pem
  45. # expired_at: 1601024554498
  46. # How long a remote server can cache our server signing key before requesting it
  47. # again. Increasing this number will reduce the number of requests made by other
  48. # servers for our key but increases the period that a compromised key will be
  49. # considered valid by other homeservers.
  50. key_validity_period: 168h0m0s
  51. # The server name to delegate server-server communications to, with optional port
  52. # e.g. localhost:443
  53. well_known_server_name: ""
  54. # Lists of domains that the server will trust as identity servers to verify third
  55. # party identifiers such as phone numbers and email addresses.
  56. trusted_third_party_id_servers: {{ matrix_dendrite_trusted_id_servers|to_json }}
  57. # Disables federation. Dendrite will not be able to make any outbound HTTP requests
  58. # to other servers and the federation API will not be exposed.
  59. disable_federation: {{ (not matrix_dendrite_federation_enabled)|to_json }}
  60. # Configuration for Kafka/Naffka.
  61. kafka:
  62. # List of Kafka broker addresses to connect to. This is not needed if using
  63. # Naffka in monolith mode.
  64. addresses: []
  65. # The prefix to use for Kafka topic names for this homeserver. Change this only if
  66. # you are running more than one Dendrite homeserver on the same Kafka deployment.
  67. topic_prefix: Dendrite
  68. # Whether to use Naffka instead of Kafka. This is only available in monolith
  69. # mode, but means that you can run a single-process server without requiring
  70. # Kafka.
  71. use_naffka: true
  72. # The max size a Kafka message is allowed to use.
  73. # You only need to change this value, if you encounter issues with too large messages.
  74. # Must be less than/equal to "max.message.bytes" configured in Kafka.
  75. # Defaults to 8388608 bytes.
  76. # max_message_bytes: 8388608
  77. # Naffka database options. Not required when using Kafka.
  78. naffka_database:
  79. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_naffka_database }}?sslmode=disable
  80. max_open_conns: 10
  81. max_idle_conns: 2
  82. conn_max_lifetime: -1
  83. # Configuration for Prometheus metric collection.
  84. metrics:
  85. # Whether or not Prometheus metrics are enabled.
  86. enabled: {{ matrix_dendrite_metrics_enabled|to_json }}
  87. # HTTP basic authentication to protect access to monitoring.
  88. basic_auth:
  89. username: {{ matrix_dendrite_metrics_username|to_json }}
  90. password: {{ matrix_dendrite_metrics_password|to_json }}
  91. # DNS cache options. The DNS cache may reduce the load on DNS servers
  92. # if there is no local caching resolver available for use.
  93. dns_cache:
  94. # Whether or not the DNS cache is enabled.
  95. enabled: false
  96. # Maximum number of entries to hold in the DNS cache, and
  97. # for how long those items should be considered valid in seconds.
  98. cache_size: 256
  99. cache_lifetime: "5m" # 5minutes; see https://pkg.go.dev/time@master#ParseDuration for more
  100. # Configuration for the Appservice API.
  101. app_service_api:
  102. internal_api:
  103. listen: http://0.0.0.0:7777
  104. connect: http://appservice_api:7777
  105. database:
  106. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_appservice_database }}?sslmode=disable
  107. max_open_conns: 10
  108. max_idle_conns: 2
  109. conn_max_lifetime: -1
  110. # Disable the validation of TLS certificates of appservices. This is
  111. # not recommended in production since it may allow appservice traffic
  112. # to be sent to an unverified endpoint.
  113. disable_tls_validation: false
  114. # Appservice configuration files to load into this homeserver.
  115. config_files: {{ matrix_dendrite_app_service_config_files|to_json }}
  116. # Configuration for the Client API.
  117. client_api:
  118. internal_api:
  119. listen: http://0.0.0.0:7771
  120. connect: http://client_api:7771
  121. external_api:
  122. listen: http://0.0.0.0:8071
  123. # Prevents new users from being able to register on this homeserver, except when
  124. # using the registration shared secret below.
  125. registration_disabled: {{ matrix_dendrite_registration_disabled|to_json }}
  126. # If set, allows registration by anyone who knows the shared secret, regardless of
  127. # whether registration is otherwise disabled.
  128. registration_shared_secret: {{ matrix_dendrite_registration_shared_secret|string|to_json }}
  129. # Whether to require reCAPTCHA for registration.
  130. enable_registration_captcha: {{ matrix_dendrite_enable_registration_captcha|to_json }}
  131. # Settings for ReCAPTCHA.
  132. recaptcha_public_key: {{ matrix_dendrite_recaptcha_public_key|to_json }}
  133. recaptcha_private_key: {{ matrix_dendrite_recaptcha_private_key|to_json }}
  134. recaptcha_bypass_secret: ""
  135. recaptcha_siteverify_api: ""
  136. # TURN server information that this homeserver should send to clients.
  137. turn:
  138. turn_user_lifetime: ""
  139. turn_uris: {{ matrix_dendrite_turn_uris|to_json }}
  140. turn_shared_secret: {{ matrix_dendrite_turn_shared_secret|to_json }}
  141. turn_username: ""
  142. turn_password: ""
  143. # Settings for rate-limited endpoints. Rate limiting will kick in after the
  144. # threshold number of "slots" have been taken by requests from a specific
  145. # host. Each "slot" will be released after the cooloff time in milliseconds.
  146. rate_limiting:
  147. enabled: {{ matrix_dendrite_rate_limiting_enabled|to_json }}
  148. threshold: {{ matrix_dendrite_rate_limiting_threshold|to_json }}
  149. cooloff_ms: {{ matrix_dendrite_rate_limiting_cooloff_ms|to_json }}
  150. # Configuration for the EDU server.
  151. edu_server:
  152. internal_api:
  153. listen: http://0.0.0.0:7778
  154. connect: http://edu_server:7778
  155. # Configuration for the Federation API.
  156. federation_api:
  157. internal_api:
  158. listen: http://0.0.0.0:7772
  159. connect: http://federation_api:7772
  160. external_api:
  161. listen: http://0.0.0.0:8072
  162. # List of paths to X.509 certificates to be used by the external federation listeners.
  163. # These certificates will be used to calculate the TLS fingerprints and other servers
  164. # will expect the certificate to match these fingerprints. Certificates must be in PEM
  165. # format.
  166. federation_certificates: []
  167. # Configuration for the Federation Sender.
  168. federation_sender:
  169. internal_api:
  170. listen: http://0.0.0.0:7775
  171. connect: http://federation_sender:7775
  172. database:
  173. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_federationsender_database }}?sslmode=disable
  174. max_open_conns: 10
  175. max_idle_conns: 2
  176. conn_max_lifetime: -1
  177. # How many times we will try to resend a failed transaction to a specific server. The
  178. # backoff is 2**x seconds, so 1 = 2 seconds, 2 = 4 seconds, 3 = 8 seconds etc.
  179. send_max_retries: 16
  180. # Disable the validation of TLS certificates of remote federated homeservers. Do not
  181. # enable this option in production as it presents a security risk!
  182. disable_tls_validation: {{ matrix_dendrite_disable_tls_validation|to_json }}
  183. # Use the following proxy server for outbound federation traffic.
  184. proxy_outbound:
  185. enabled: false
  186. protocol: http
  187. host: localhost
  188. port: 8080
  189. # Configuration for the Key Server (for end-to-end encryption).
  190. key_server:
  191. internal_api:
  192. listen: http://0.0.0.0:7779
  193. connect: http://key_server:7779
  194. database:
  195. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_keyserver_database }}?sslmode=disable
  196. max_open_conns: 10
  197. max_idle_conns: 2
  198. conn_max_lifetime: -1
  199. # Configuration for the Media API.
  200. media_api:
  201. internal_api:
  202. listen: http://0.0.0.0:7774
  203. connect: http://media_api:7774
  204. external_api:
  205. listen: http://0.0.0.0:8074
  206. database:
  207. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_mediaapi_database }}?sslmode=disable
  208. max_open_conns: 10
  209. max_idle_conns: 2
  210. conn_max_lifetime: -1
  211. # Storage path for uploaded media. May be relative or absolute.
  212. base_path: "/matrix-media-store-parent/{{ matrix_dendrite_media_store_directory_name }}"
  213. # The maximum allowed file size (in bytes) for media uploads to this homeserver
  214. # (0 = unlimited). If using a reverse proxy, ensure it allows requests at
  215. # least this large (e.g. client_max_body_size in nginx.)
  216. max_file_size_bytes: {{ matrix_dendrite_max_file_size_bytes|to_json }}
  217. # Whether to dynamically generate thumbnails if needed.
  218. dynamic_thumbnails: false
  219. # The maximum number of simultaneous thumbnail generators to run.
  220. max_thumbnail_generators: 10
  221. # A list of thumbnail sizes to be generated for media content.
  222. thumbnail_sizes:
  223. - width: 32
  224. height: 32
  225. method: crop
  226. - width: 96
  227. height: 96
  228. method: crop
  229. - width: 640
  230. height: 480
  231. method: scale
  232. # Configuration for experimental MSC's
  233. mscs:
  234. # A list of enabled MSC's
  235. # Currently valid values are:
  236. # - msc2836 (Threading, see https://github.com/matrix-org/matrix-doc/pull/2836)
  237. # - msc2946 (Spaces Summary, see https://github.com/matrix-org/matrix-doc/pull/2946)
  238. mscs: []
  239. database:
  240. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_mscs_database }}?sslmode=disable
  241. max_open_conns: 5
  242. max_idle_conns: 2
  243. conn_max_lifetime: -1
  244. # Configuration for the Room Server.
  245. room_server:
  246. internal_api:
  247. listen: http://0.0.0.0:7770
  248. connect: http://room_server:7770
  249. database:
  250. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_room_database }}?sslmode=disable
  251. max_open_conns: 10
  252. max_idle_conns: 2
  253. conn_max_lifetime: -1
  254. # Configuration for the Signing Key Server (for server signing keys).
  255. signing_key_server:
  256. internal_api:
  257. listen: http://0.0.0.0:7780
  258. connect: http://signing_key_server:7780
  259. database:
  260. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_singingkeyserver_database }}?sslmode=disable
  261. max_open_conns: 10
  262. max_idle_conns: 2
  263. conn_max_lifetime: -1
  264. # Perspective keyservers to use as a backup when direct key fetches fail. This may
  265. # be required to satisfy key requests for servers that are no longer online when
  266. # joining some rooms.
  267. key_perspectives:
  268. - server_name: matrix.org
  269. keys:
  270. - key_id: ed25519:auto
  271. public_key: Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw
  272. - key_id: ed25519:a_RXGa
  273. public_key: l8Hft5qXKn1vfHrg3p4+W8gELQVo8N13JkluMfmn2sQ
  274. # This option will control whether Dendrite will prefer to look up keys directly
  275. # or whether it should try perspective servers first, using direct fetches as a
  276. # last resort.
  277. prefer_direct_fetch: false
  278. # Configuration for the Sync API.
  279. sync_api:
  280. internal_api:
  281. listen: http://0.0.0.0:7773
  282. connect: http://sync_api:7773
  283. external_api:
  284. listen: http://0.0.0.0:8073
  285. database:
  286. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_syncapi_database }}?sslmode=disable
  287. max_open_conns: 10
  288. max_idle_conns: 2
  289. conn_max_lifetime: -1
  290. # This option controls which HTTP header to inspect to find the real remote IP
  291. # address of the client. This is likely required if Dendrite is running behind
  292. # a reverse proxy server.
  293. # real_ip_header: X-Real-IP
  294. # Configuration for the User API.
  295. user_api:
  296. # The cost when hashing passwords on registration/login. Default: 10. Min: 4, Max: 31
  297. # See https://pkg.go.dev/golang.org/x/crypto/bcrypt for more information.
  298. # Setting this lower makes registration/login consume less CPU resources at the cost of security
  299. # should the database be compromised. Setting this higher makes registration/login consume more
  300. # CPU resources but makes it harder to brute force password hashes.
  301. # This value can be low if performing tests or on embedded Dendrite instances (e.g WASM builds)
  302. # bcrypt_cost: 10
  303. internal_api:
  304. listen: http://0.0.0.0:7781
  305. connect: http://user_api:7781
  306. account_database:
  307. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_account_database }}?sslmode=disable
  308. max_open_conns: 10
  309. max_idle_conns: 2
  310. conn_max_lifetime: -1
  311. device_database:
  312. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_device_database }}?sslmode=disable
  313. max_open_conns: 10
  314. max_idle_conns: 2
  315. conn_max_lifetime: -1
  316. # The length of time that a token issued for a relying party from
  317. # /_matrix/client/r0/user/{userId}/openid/request_token endpoint
  318. # is considered to be valid in milliseconds.
  319. # The default lifetime is 3600000ms (60 minutes).
  320. # openid_token_lifetime_ms: 3600000
  321. # Configuration for Opentracing.
  322. # See https://github.com/matrix-org/dendrite/tree/master/docs/tracing for information on
  323. # how this works and how to set it up.
  324. tracing:
  325. enabled: false
  326. jaeger:
  327. serviceName: ""
  328. disabled: false
  329. rpc_metrics: false
  330. tags: []
  331. sampler: null
  332. reporter: null
  333. headers: null
  334. baggage_restrictions: null
  335. throttler: null
  336. # Logging configuration, in addition to the standard logging that is sent to
  337. # stdout by Dendrite.
  338. logging: []