Matrix Docker Ansible eploy
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

441 Zeilen
18 KiB

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