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.
 
 

387 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: 2
  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. # Configures the handling of presence events.
  61. presence:
  62. # Whether inbound presence events are allowed, e.g. receiving presence events from other servers
  63. enable_inbound: false
  64. # Whether outbound presence events are allowed, e.g. sending presence events to other servers
  65. enable_outbound: false
  66. # Server notices allows server admins to send messages to all users.
  67. server_notices:
  68. enabled: false
  69. # The server localpart to be used when sending notices, ensure this is not yet taken
  70. local_part: "_server"
  71. # The displayname to be used when sending notices
  72. display_name: "Server alerts"
  73. # The mxid of the avatar to use
  74. avatar_url: ""
  75. # The roomname to be used when creating messages
  76. room_name: "Server Alerts"
  77. # Configuration for NATS JetStream
  78. jetstream:
  79. # A list of NATS Server addresses to connect to. If none are specified, an
  80. # internal NATS server will be started automatically when running Dendrite
  81. # in monolith mode. It is required to specify the address of at least one
  82. # NATS Server node if running in polylith mode.
  83. addresses:
  84. # - jetstream:4222
  85. # Keep all NATS streams in memory, rather than persisting it to the storage
  86. # path below. This option is present primarily for integration testing and
  87. # should not be used on a real world Dendrite deployment.
  88. in_memory: false
  89. # Persistent directory to store JetStream streams in. This directory
  90. # should be preserved across Dendrite restarts.
  91. storage_path: "/matrix-nats-store"
  92. # The prefix to use for stream names for this homeserver - really only
  93. # useful if running more than one Dendrite on the same NATS deployment.
  94. topic_prefix: Dendrite
  95. # Configuration for Prometheus metric collection.
  96. metrics:
  97. # Whether or not Prometheus metrics are enabled.
  98. enabled: {{ matrix_dendrite_metrics_enabled|to_json }}
  99. # HTTP basic authentication to protect access to monitoring.
  100. basic_auth:
  101. username: {{ matrix_dendrite_metrics_username|to_json }}
  102. password: {{ matrix_dendrite_metrics_password|to_json }}
  103. # DNS cache options. The DNS cache may reduce the load on DNS servers
  104. # if there is no local caching resolver available for use.
  105. dns_cache:
  106. # Whether or not the DNS cache is enabled.
  107. enabled: false
  108. # Maximum number of entries to hold in the DNS cache, and
  109. # for how long those items should be considered valid in seconds.
  110. cache_size: 256
  111. cache_lifetime: "5m" # 5minutes; see https://pkg.go.dev/time@master#ParseDuration for more
  112. # Configuration for the Appservice API.
  113. app_service_api:
  114. internal_api:
  115. listen: http://0.0.0.0:7777
  116. connect: http://appservice_api:7777
  117. database:
  118. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_appservice_database }}?sslmode=disable
  119. max_open_conns: 10
  120. max_idle_conns: 2
  121. conn_max_lifetime: -1
  122. # Disable the validation of TLS certificates of appservices. This is
  123. # not recommended in production since it may allow appservice traffic
  124. # to be sent to an unverified endpoint.
  125. disable_tls_validation: {{ matrix_dendrite_disable_tls_validation|to_json }}
  126. # Appservice configuration files to load into this homeserver.
  127. config_files: {{ matrix_dendrite_app_service_config_files|to_json }}
  128. # Configuration for the Client API.
  129. client_api:
  130. internal_api:
  131. listen: http://0.0.0.0:7771
  132. connect: http://client_api:7771
  133. external_api:
  134. listen: http://0.0.0.0:8071
  135. # Prevents new users from being able to register on this homeserver, except when
  136. # using the registration shared secret below.
  137. registration_disabled: {{ matrix_dendrite_registration_disabled|to_json }}
  138. # Prevents new guest accounts from being created. Guest registration is also
  139. # disabled implicitly by setting 'registration_disabled' above.
  140. guests_disabled: true
  141. # If set, allows registration by anyone who knows the shared secret, regardless of
  142. # whether registration is otherwise disabled.
  143. registration_shared_secret: {{ matrix_dendrite_registration_shared_secret|string|to_json }}
  144. # Whether to require reCAPTCHA for registration.
  145. enable_registration_captcha: {{ matrix_dendrite_enable_registration_captcha|to_json }}
  146. # Settings for ReCAPTCHA.
  147. recaptcha_public_key: {{ matrix_dendrite_recaptcha_public_key|to_json }}
  148. recaptcha_private_key: {{ matrix_dendrite_recaptcha_private_key|to_json }}
  149. recaptcha_bypass_secret: ""
  150. recaptcha_siteverify_api: ""
  151. # TURN server information that this homeserver should send to clients.
  152. turn:
  153. turn_user_lifetime: ""
  154. turn_uris: {{ matrix_dendrite_turn_uris|to_json }}
  155. turn_shared_secret: {{ matrix_dendrite_turn_shared_secret|to_json }}
  156. turn_username: ""
  157. turn_password: ""
  158. # Settings for rate-limited endpoints. Rate limiting will kick in after the
  159. # threshold number of "slots" have been taken by requests from a specific
  160. # host. Each "slot" will be released after the cooloff time in milliseconds.
  161. rate_limiting:
  162. enabled: {{ matrix_dendrite_rate_limiting_enabled|to_json }}
  163. threshold: {{ matrix_dendrite_rate_limiting_threshold|to_json }}
  164. cooloff_ms: {{ matrix_dendrite_rate_limiting_cooloff_ms|to_json }}
  165. # Configuration for the Federation API.
  166. federation_api:
  167. internal_api:
  168. listen: http://0.0.0.0:7772
  169. connect: http://federation_api:7772
  170. external_api:
  171. listen: http://0.0.0.0:8072
  172. database:
  173. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_federationapi_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. # Not in dendrite-config.yaml, but is in build/docker/config/dendrite.yaml
  184. # Use the following proxy server for outbound federation traffic.
  185. #proxy_outbound:
  186. # enabled: false
  187. # protocol: http
  188. # host: localhost
  189. # port: 8080
  190. # Perspective keyservers to use as a backup when direct key fetches fail. This may
  191. # be required to satisfy key requests for servers that are no longer online when
  192. # joining some rooms.
  193. key_perspectives:
  194. - server_name: matrix.org
  195. keys:
  196. - key_id: ed25519:auto
  197. public_key: Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw
  198. - key_id: ed25519:a_RXGa
  199. public_key: l8Hft5qXKn1vfHrg3p4+W8gELQVo8N13JkluMfmn2sQ
  200. # This option will control whether Dendrite will prefer to look up keys directly
  201. # or whether it should try perspective servers first, using direct fetches as a
  202. # last resort.
  203. prefer_direct_fetch: false
  204. # Configuration for the Key Server (for end-to-end encryption).
  205. key_server:
  206. internal_api:
  207. listen: http://0.0.0.0:7779
  208. connect: http://key_server:7779
  209. database:
  210. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_keyserver_database }}?sslmode=disable
  211. max_open_conns: 10
  212. max_idle_conns: 2
  213. conn_max_lifetime: -1
  214. # Configuration for the Media API.
  215. media_api:
  216. internal_api:
  217. listen: http://0.0.0.0:7774
  218. connect: http://media_api:7774
  219. external_api:
  220. listen: http://0.0.0.0:8074
  221. database:
  222. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_mediaapi_database }}?sslmode=disable
  223. max_open_conns: 10
  224. max_idle_conns: 2
  225. conn_max_lifetime: -1
  226. # Storage path for uploaded media. May be relative or absolute.
  227. base_path: "/matrix-media-store-parent/{{ matrix_dendrite_media_store_directory_name }}"
  228. # The maximum allowed file size (in bytes) for media uploads to this homeserver
  229. # (0 = unlimited). If using a reverse proxy, ensure it allows requests at
  230. # least this large (e.g. client_max_body_size in nginx.)
  231. max_file_size_bytes: {{ matrix_dendrite_max_file_size_bytes|to_json }}
  232. # Whether to dynamically generate thumbnails if needed.
  233. dynamic_thumbnails: false
  234. # The maximum number of simultaneous thumbnail generators to run.
  235. max_thumbnail_generators: 10
  236. # A list of thumbnail sizes to be generated for media content.
  237. thumbnail_sizes:
  238. - width: 32
  239. height: 32
  240. method: crop
  241. - width: 96
  242. height: 96
  243. method: crop
  244. - width: 640
  245. height: 480
  246. method: scale
  247. # Configuration for experimental MSC's
  248. mscs:
  249. # A list of enabled MSC's
  250. # Currently valid values are:
  251. # - msc2836 (Threading, see https://github.com/matrix-org/matrix-doc/pull/2836)
  252. # - msc2946 (Spaces Summary, see https://github.com/matrix-org/matrix-doc/pull/2946)
  253. mscs: []
  254. database:
  255. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_mscs_database }}?sslmode=disable
  256. max_open_conns: 5
  257. max_idle_conns: 2
  258. conn_max_lifetime: -1
  259. # Configuration for the Room Server.
  260. room_server:
  261. internal_api:
  262. listen: http://0.0.0.0:7770
  263. connect: http://room_server:7770
  264. database:
  265. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_room_database }}?sslmode=disable
  266. max_open_conns: 10
  267. max_idle_conns: 2
  268. conn_max_lifetime: -1
  269. # Configuration for the Sync API.
  270. sync_api:
  271. internal_api:
  272. listen: http://0.0.0.0:7773
  273. connect: http://sync_api:7773
  274. external_api:
  275. listen: http://0.0.0.0:8073
  276. database:
  277. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_syncapi_database }}?sslmode=disable
  278. max_open_conns: 10
  279. max_idle_conns: 2
  280. conn_max_lifetime: -1
  281. # This option controls which HTTP header to inspect to find the real remote IP
  282. # address of the client. This is likely required if Dendrite is running behind
  283. # a reverse proxy server.
  284. # real_ip_header: X-Real-IP
  285. real_ip_header: {{ matrix_dendrite_sync_api_real_ip_header|to_json }}
  286. # Configuration for the User API.
  287. user_api:
  288. # The cost when hashing passwords on registration/login. Default: 10. Min: 4, Max: 31
  289. # See https://pkg.go.dev/golang.org/x/crypto/bcrypt for more information.
  290. # Setting this lower makes registration/login consume less CPU resources at the cost of security
  291. # should the database be compromised. Setting this higher makes registration/login consume more
  292. # CPU resources but makes it harder to brute force password hashes.
  293. # This value can be low if performing tests or on embedded Dendrite instances (e.g WASM builds)
  294. # bcrypt_cost: 10
  295. internal_api:
  296. listen: http://0.0.0.0:7781
  297. connect: http://user_api:7781
  298. account_database:
  299. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_userapi_database }}?sslmode=disable
  300. max_open_conns: 10
  301. max_idle_conns: 2
  302. conn_max_lifetime: -1
  303. # The length of time that a token issued for a relying party from
  304. # /_matrix/client/r0/user/{userId}/openid/request_token endpoint
  305. # is considered to be valid in milliseconds.
  306. # The default lifetime is 3600000ms (60 minutes).
  307. # openid_token_lifetime_ms: 3600000
  308. # Not in dendrite-config.yaml, but is in build/docker/config/dendrite.yaml
  309. # Configuration for the Push Server API.
  310. push_server:
  311. internal_api:
  312. listen: http://localhost:7782
  313. connect: http://localhost:7782
  314. database:
  315. connection_string: {{ matrix_dendrite_database_str }}/{{ matrix_dendrite_pushserver_database }}?sslmode=disable
  316. max_open_conns: 10
  317. max_idle_conns: 2
  318. conn_max_lifetime: -1
  319. # Configuration for Opentracing.
  320. # See https://github.com/matrix-org/dendrite/tree/master/docs/tracing for information on
  321. # how this works and how to set it up.
  322. tracing:
  323. enabled: false
  324. jaeger:
  325. serviceName: ""
  326. disabled: false
  327. rpc_metrics: false
  328. tags: []
  329. sampler: null
  330. reporter: null
  331. headers: null
  332. baggage_restrictions: null
  333. throttler: null
  334. # Logging configuration, in addition to the standard logging that is sent to
  335. # stdout by Dendrite.
  336. logging: []