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.
 
 

437 lines
18 KiB

  1. {#
  2. SPDX-FileCopyrightText: 2024 MDAD Team and contributors
  3. SPDX-License-Identifier: AGPL-3.0-or-later
  4. #}
  5. # This is the Dendrite configuration file.
  6. #
  7. # The configuration is split up into sections - each Dendrite component has a
  8. # configuration section, in addition to the "global" section which applies to
  9. # all components.
  10. #
  11. # At a minimum, to get started, you will need to update the settings in the
  12. # "global" section for your deployment, and you will need to check that the
  13. # database "connection_string" line in each component section is correct.
  14. #
  15. # Each component with a "database" section can accept the following formats
  16. # for "connection_string":
  17. # SQLite: file:filename.db
  18. # file:///path/to/filename.db
  19. # PostgreSQL: postgresql://user:pass@hostname/database?params=…
  20. #
  21. # SQLite is embedded into Dendrite and therefore no further prerequisites are
  22. # needed for the database when using SQLite mode. However, performance with
  23. # PostgreSQL is significantly better and recommended for multi-user deployments.
  24. # SQLite is typically around 20-30% slower than PostgreSQL when tested with a
  25. # small number of users and likely will perform worse still with a higher volume
  26. # of users.
  27. #
  28. # The "max_open_conns" and "max_idle_conns" settings configure the maximum
  29. # number of open/idle database connections. The value 0 will use the database
  30. # engine default, and a negative value will use unlimited connections. The
  31. # "conn_max_lifetime" option controls the maximum length of time a database
  32. # connection can be idle in seconds - a negative value is unlimited.
  33. # The version of the configuration file.
  34. version: 2
  35. # Global Matrix configuration. This configuration applies to all components.
  36. global:
  37. # The domain name of this homeserver.
  38. server_name: {{ matrix_domain|to_json }}
  39. # The path to the signing private key file, used to sign requests and events.
  40. # Note that this is NOT the same private key as used for TLS! To generate a
  41. # signing key, use "./bin/generate-keys --private-key matrix_key.pem".
  42. private_key: "/data/{{ matrix_server_fqn_matrix }}.signing.pem"
  43. # The paths and expiry timestamps (as a UNIX timestamp in millisecond precision)
  44. # to old signing private keys that were formerly in use on this domain. These
  45. # keys will not be used for federation request or event signing, but will be
  46. # provided to any other homeserver that asks when trying to verify old events.
  47. # old_private_keys:
  48. # - private_key: old_matrix_key.pem
  49. # expired_at: 1601024554498
  50. # How long a remote server can cache our server signing key before requesting it
  51. # again. Increasing this number will reduce the number of requests made by other
  52. # servers for our key but increases the period that a compromised key will be
  53. # considered valid by other homeservers.
  54. key_validity_period: 168h0m0s
  55. # The server name to delegate server-server communications to, with optional port
  56. # e.g. localhost:443
  57. well_known_server_name: ""
  58. # The server name to delegate client-server communications to, with optional port
  59. # e.g. localhost:443
  60. well_known_client_name: ""
  61. # Lists of domains that the server will trust as identity servers to verify third
  62. # party identifiers such as phone numbers and email addresses.
  63. trusted_third_party_id_servers: {{ matrix_dendrite_trusted_id_servers|to_json }}
  64. # Disables federation. Dendrite will not be able to make any outbound HTTP requests
  65. # to other servers and the federation API will not be exposed.
  66. disable_federation: {{ (not matrix_dendrite_federation_enabled)|to_json }}
  67. # Configures the handling of presence events.
  68. presence:
  69. # Whether inbound presence events are allowed, e.g. receiving presence events from other servers
  70. enable_inbound: false
  71. # Whether outbound presence events are allowed, e.g. sending presence events to other servers
  72. enable_outbound: false
  73. # Configuration for in-memory caches. Caches can often improve performance by
  74. # keeping frequently accessed items (like events, identifiers etc.) in memory
  75. # rather than having to read them from the database.
  76. cache:
  77. # The estimated maximum size for the global cache in bytes, or in terabytes,
  78. # gigabytes, megabytes or kilobytes when the appropriate 'tb', 'gb', 'mb' or
  79. # 'kb' suffix is specified. Note that this is not a hard limit, nor is it a
  80. # memory limit for the entire process. A cache that is too small may ultimately
  81. # provide little or no benefit.
  82. max_size_estimated: 1gb
  83. # The maximum amount of time that a cache entry can live for in memory before
  84. # it will be evicted and/or refreshed from the database. Lower values result in
  85. # easier admission of new cache entries but may also increase database load in
  86. # comparison to higher values, so adjust conservatively. Higher values may make
  87. # it harder for new items to make it into the cache, e.g. if new rooms suddenly
  88. # become popular.
  89. max_age: 1h
  90. # Server notices allows server admins to send messages to all users.
  91. server_notices:
  92. enabled: false
  93. # The server localpart to be used when sending notices, ensure this is not yet taken
  94. local_part: "_server"
  95. # The displayname to be used when sending notices
  96. display_name: "Server alerts"
  97. # The mxid of the avatar to use
  98. avatar_url: ""
  99. # The roomname to be used when creating messages
  100. room_name: "Server Alerts"
  101. # Configuration for NATS JetStream
  102. jetstream:
  103. # A list of NATS Server addresses to connect to. If none are specified, an
  104. # internal NATS server will be started automatically when running Dendrite
  105. # in monolith mode. It is required to specify the address of at least one
  106. # NATS Server node if running in polylith mode.
  107. addresses:
  108. # - jetstream:4222
  109. # Keep all NATS streams in memory, rather than persisting it to the storage
  110. # path below. This option is present primarily for integration testing and
  111. # should not be used on a real world Dendrite deployment.
  112. in_memory: false
  113. # Persistent directory to store JetStream streams in. This directory
  114. # should be preserved across Dendrite restarts.
  115. storage_path: "/matrix-nats-store"
  116. # The prefix to use for stream names for this homeserver - really only
  117. # useful if running more than one Dendrite on the same NATS deployment.
  118. topic_prefix: Dendrite
  119. # Configuration for Prometheus metric collection.
  120. metrics:
  121. # Whether or not Prometheus metrics are enabled.
  122. enabled: {{ matrix_dendrite_metrics_enabled|to_json }}
  123. # HTTP basic authentication to protect access to monitoring.
  124. basic_auth:
  125. username: {{ matrix_dendrite_metrics_username|to_json }}
  126. password: {{ matrix_dendrite_metrics_password|to_json }}
  127. # DNS cache options. The DNS cache may reduce the load on DNS servers
  128. # if there is no local caching resolver available for use.
  129. dns_cache:
  130. # Whether or not the DNS cache is enabled.
  131. enabled: false
  132. # Maximum number of entries to hold in the DNS cache, and
  133. # for how long those items should be considered valid in seconds.
  134. cache_size: 256
  135. cache_lifetime: "5m" # 5minutes; see https://pkg.go.dev/time@master#ParseDuration for more
  136. # Configuration for the Appservice API.
  137. app_service_api:
  138. internal_api:
  139. listen: http://0.0.0.0:7777
  140. connect: http://appservice_api:7777
  141. # Disable the validation of TLS certificates of appservices. This is
  142. # not recommended in production since it may allow appservice traffic
  143. # to be sent to an unverified endpoint.
  144. disable_tls_validation: {{ matrix_dendrite_disable_tls_validation|to_json }}
  145. # Appservice configuration files to load into this homeserver.
  146. config_files: {{ matrix_dendrite_app_service_config_files_final|to_json }}
  147. # Configuration for the Client API.
  148. client_api:
  149. internal_api:
  150. listen: http://0.0.0.0:7771
  151. connect: http://client_api:7771
  152. external_api:
  153. listen: http://0.0.0.0:8071
  154. # Prevents new users from being able to register on this homeserver, except when
  155. # using the registration shared secret below.
  156. registration_disabled: {{ matrix_dendrite_client_api_registration_disabled | to_json }}
  157. # Prevents new guest accounts from being created. Guest registration is also
  158. # disabled implicitly by setting 'registration_disabled' above.
  159. guests_disabled: true
  160. # If set, allows registration by anyone who knows the shared secret, regardless of
  161. # whether registration is otherwise disabled.
  162. registration_shared_secret: {{ matrix_dendrite_client_api_registration_shared_secret | string | to_json }}
  163. # Whether to require reCAPTCHA for registration.
  164. enable_registration_captcha: {{ matrix_dendrite_client_api_enable_registration_captcha | to_json }}
  165. # Settings for ReCAPTCHA.
  166. recaptcha_public_key: {{ matrix_dendrite_client_api_recaptcha_public_key | to_json }}
  167. recaptcha_private_key: {{ matrix_dendrite_client_api_recaptcha_private_key | to_json }}
  168. recaptcha_bypass_secret: ""
  169. recaptcha_siteverify_api: {{ matrix_dendrite_client_api_recaptcha_siteverify_api | to_json }}
  170. recaptcha_api_js_url: {{ matrix_dendrite_client_api_recaptcha_api_js_url | to_json }}
  171. recaptcha_form_field: {{ matrix_dendrite_client_api_recaptcha_form_field | to_json }}
  172. recaptcha_sitekey_class: {{ matrix_dendrite_client_api_recaptcha_sitekey_class | to_json }}
  173. # TURN server information that this homeserver should send to clients.
  174. turn:
  175. turn_user_lifetime: ""
  176. turn_uris: {{ matrix_dendrite_client_api_turn_uris | to_json }}
  177. turn_shared_secret: {{ matrix_dendrite_client_api_turn_shared_secret | to_json }}
  178. turn_username: {{ matrix_dendrite_client_api_turn_username | to_json }}
  179. turn_password: {{ matrix_dendrite_client_api_turn_password | to_json }}
  180. # Settings for rate-limited endpoints. Rate limiting will kick in after the
  181. # threshold number of "slots" have been taken by requests from a specific
  182. # host. Each "slot" will be released after the cooloff time in milliseconds.
  183. rate_limiting:
  184. enabled: {{ matrix_dendrite_client_api_rate_limiting_enabled | to_json }}
  185. threshold: {{ matrix_dendrite_client_api_rate_limiting_threshold | to_json }}
  186. cooloff_ms: {{ matrix_dendrite_client_api_rate_limiting_cooloff_ms | to_json }}
  187. exempt_user_ids:
  188. # - "@user:{{ matrix_domain }}"
  189. # Configuration for the Federation API.
  190. federation_api:
  191. internal_api:
  192. listen: http://0.0.0.0:7772
  193. connect: http://federation_api:7772
  194. external_api:
  195. listen: http://0.0.0.0:8072
  196. database:
  197. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_federation_api_database }}?sslmode={{ matrix_dendrite_database_sslmode }}
  198. max_open_conns: 10
  199. max_idle_conns: 2
  200. conn_max_lifetime: -1
  201. # How many times we will try to resend a failed transaction to a specific server. The
  202. # backoff is 2**x seconds, so 1 = 2 seconds, 2 = 4 seconds, 3 = 8 seconds etc.
  203. send_max_retries: 16
  204. # Disable the validation of TLS certificates of remote federated homeservers. Do not
  205. # enable this option in production as it presents a security risk!
  206. disable_tls_validation: {{ matrix_dendrite_disable_tls_validation|to_json }}
  207. # Not in dendrite-config.yaml, but is in build/docker/config/dendrite.yaml
  208. # Use the following proxy server for outbound federation traffic.
  209. #proxy_outbound:
  210. # enabled: false
  211. # protocol: http
  212. # host: localhost
  213. # port: 8080
  214. # Perspective keyservers to use as a backup when direct key fetches fail. This may
  215. # be required to satisfy key requests for servers that are no longer online when
  216. # joining some rooms.
  217. key_perspectives:
  218. - server_name: matrix.org
  219. keys:
  220. - key_id: ed25519:auto
  221. public_key: Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw
  222. - key_id: ed25519:a_RXGa
  223. public_key: l8Hft5qXKn1vfHrg3p4+W8gELQVo8N13JkluMfmn2sQ
  224. # This option will control whether Dendrite will prefer to look up keys directly
  225. # or whether it should try perspective servers first, using direct fetches as a
  226. # last resort.
  227. prefer_direct_fetch: false
  228. # Configuration for the Key Server (for end-to-end encryption).
  229. key_server:
  230. internal_api:
  231. listen: http://0.0.0.0:7779
  232. connect: http://key_server:7779
  233. database:
  234. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_key_server_database }}?sslmode={{ matrix_dendrite_database_sslmode }}
  235. max_open_conns: 10
  236. max_idle_conns: 2
  237. conn_max_lifetime: -1
  238. # Configuration for the Media API.
  239. media_api:
  240. internal_api:
  241. listen: http://0.0.0.0:7774
  242. connect: http://media_api:7774
  243. external_api:
  244. listen: http://0.0.0.0:8074
  245. database:
  246. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_media_api_database }}?sslmode={{ matrix_dendrite_database_sslmode }}
  247. max_open_conns: 10
  248. max_idle_conns: 2
  249. conn_max_lifetime: -1
  250. # Storage path for uploaded media. May be relative or absolute.
  251. base_path: "/matrix-media-store-parent/{{ matrix_dendrite_media_store_directory_name }}"
  252. # The maximum allowed file size (in bytes) for media uploads to this homeserver
  253. # (0 = unlimited). If using a reverse proxy, ensure it allows requests at
  254. # least this large (e.g. client_max_body_size in nginx.)
  255. max_file_size_bytes: {{ matrix_dendrite_max_file_size_bytes|to_json }}
  256. # Whether to dynamically generate thumbnails if needed.
  257. dynamic_thumbnails: {{ matrix_dendrite_media_api_dynamic_thumbnails|to_json }}
  258. # The maximum number of simultaneous thumbnail generators to run.
  259. max_thumbnail_generators: {{ matrix_dendrite_media_api_max_thumbnail_generators|to_json }}
  260. # A list of thumbnail sizes to be generated for media content.
  261. thumbnail_sizes:
  262. - width: 32
  263. height: 32
  264. method: crop
  265. - width: 96
  266. height: 96
  267. method: crop
  268. - width: 640
  269. height: 480
  270. method: scale
  271. # Configuration for experimental MSC's
  272. mscs:
  273. # A list of enabled MSC's
  274. # Currently valid values are:
  275. # - msc2836 (Threading, see https://github.com/matrix-org/matrix-doc/pull/2836)
  276. # - msc2946 (Spaces Summary, see https://github.com/matrix-org/matrix-doc/pull/2946)
  277. mscs: []
  278. database:
  279. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_mscs_database }}?sslmode={{ matrix_dendrite_database_sslmode }}
  280. max_open_conns: 5
  281. max_idle_conns: 2
  282. conn_max_lifetime: -1
  283. # Configuration for the Room Server.
  284. room_server:
  285. internal_api:
  286. listen: http://0.0.0.0:7770
  287. connect: http://room_server:7770
  288. database:
  289. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_room_database }}?sslmode={{ matrix_dendrite_database_sslmode }}
  290. max_open_conns: 10
  291. max_idle_conns: 2
  292. conn_max_lifetime: -1
  293. # Configuration for the Sync API.
  294. sync_api:
  295. internal_api:
  296. listen: http://0.0.0.0:7773
  297. connect: http://sync_api:7773
  298. external_api:
  299. listen: http://0.0.0.0:8073
  300. database:
  301. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_sync_api_database }}?sslmode={{ matrix_dendrite_database_sslmode }}
  302. max_open_conns: 10
  303. max_idle_conns: 2
  304. conn_max_lifetime: -1
  305. # This option controls which HTTP header to inspect to find the real remote IP
  306. # address of the client. This is likely required if Dendrite is running behind
  307. # a reverse proxy server.
  308. # real_ip_header: X-Real-IP
  309. real_ip_header: {{ matrix_dendrite_sync_api_real_ip_header|to_json }}
  310. # Configuration for the full-text search engine.
  311. search:
  312. # Whether or not search is enabled.
  313. enabled: {{ matrix_dendrite_sync_api_search_enabled|to_json }}
  314. # The path where the search index will be created in.
  315. index_path: "/matrix-media-store-parent/searchindex"
  316. # The language most likely to be used on the server - used when indexing, to
  317. # ensure the returned results match expectations. A full list of possible languages
  318. # can be found at https://github.com/blevesearch/bleve/tree/master/analysis/lang
  319. language: "en"
  320. # Configuration for the User API.
  321. user_api:
  322. # The cost when hashing passwords on registration/login. Default: 10. Min: 4, Max: 31
  323. # See https://pkg.go.dev/golang.org/x/crypto/bcrypt for more information.
  324. # Setting this lower makes registration/login consume less CPU resources at the cost of security
  325. # should the database be compromised. Setting this higher makes registration/login consume more
  326. # CPU resources but makes it harder to brute force password hashes.
  327. # This value can be low if performing tests or on embedded Dendrite instances (e.g WASM builds)
  328. # bcrypt_cost: 10
  329. internal_api:
  330. listen: http://0.0.0.0:7781
  331. connect: http://user_api:7781
  332. account_database:
  333. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_user_api_database }}?sslmode={{ matrix_dendrite_database_sslmode }}
  334. max_open_conns: 10
  335. max_idle_conns: 2
  336. conn_max_lifetime: -1
  337. # The length of time that a token issued for a relying party from
  338. # /_matrix/client/r0/user/{userId}/openid/request_token endpoint
  339. # is considered to be valid in milliseconds.
  340. # The default lifetime is 3600000ms (60 minutes).
  341. # openid_token_lifetime_ms: 3600000
  342. auto_join_rooms: {{ matrix_dendrite_user_api_auto_join_rooms | to_json }}
  343. # Not in dendrite-config.yaml, but is in build/docker/config/dendrite.yaml
  344. # Configuration for the Push Server API.
  345. push_server:
  346. internal_api:
  347. listen: http://localhost:7782
  348. connect: http://localhost:7782
  349. database:
  350. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_push_server_database }}?sslmode={{ matrix_dendrite_database_sslmode }}
  351. max_open_conns: 10
  352. max_idle_conns: 2
  353. conn_max_lifetime: -1
  354. #
  355. #
  356. relay_api:
  357. database:
  358. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_relay_api_database }}?sslmode={{ matrix_dendrite_database_sslmode }}
  359. # Configuration for Opentracing.
  360. # See https://github.com/matrix-org/dendrite/tree/master/docs/tracing for information on
  361. # how this works and how to set it up.
  362. tracing:
  363. enabled: false
  364. jaeger:
  365. serviceName: ""
  366. disabled: false
  367. rpc_metrics: false
  368. tags: []
  369. sampler: null
  370. reporter: null
  371. headers: null
  372. baggage_restrictions: null
  373. throttler: null
  374. # Logging configuration, in addition to the standard logging that is sent to
  375. # stdout by Dendrite.
  376. logging: []
  377. # statistics reporting configuration. These statistics contain the server
  378. # name, number of active users and some information on your deployment config.
  379. report_stats: {{ matrix_dendrite_report_stats|to_json }}