Matrix Docker Ansible eploy
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

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