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.
 
 

942 lines
54 KiB

  1. # SPDX-FileCopyrightText: 2023 - 2024 Michael Hollister
  2. # SPDX-FileCopyrightText: 2023 - 2025 Slavi Pantaleev
  3. # SPDX-FileCopyrightText: 2023 MDAD project contributors
  4. # SPDX-FileCopyrightText: 2023 Samuel Meenzen
  5. # SPDX-FileCopyrightText: 2024 Suguru Hirahara
  6. #
  7. # SPDX-License-Identifier: AGPL-3.0-or-later
  8. ---
  9. # matrix-media-repo is a highly customizable multi-domain media repository for Matrix.
  10. # Intended for medium to large environments consisting of several homeservers, this
  11. # media repo de-duplicates media (including remote media) while being fully compliant
  12. # with the specification.
  13. # See: https://github.com/turt2live/matrix-media-repo
  14. matrix_media_repo_enabled: false
  15. # matrix_media_repo_identifier controls the identifier of this media-repo instance, which influences:
  16. # - the default storage path
  17. # - the names of systemd services and containers
  18. matrix_media_repo_identifier: matrix-media-repo
  19. matrix_media_repo_container_image_self_build: false
  20. matrix_media_repo_container_image_self_build_repo: "https://github.com/turt2live/matrix-media-repo.git"
  21. matrix_media_repo_docker_image_path: "t2bot/matrix-media-repo"
  22. matrix_media_repo_docker_image: "{{ matrix_media_repo_docker_image_registry_prefix }}{{ matrix_media_repo_docker_image_path }}:{{ matrix_media_repo_docker_image_tag }}"
  23. matrix_media_repo_docker_image_registry_prefix: "{{ 'localhost/' if matrix_media_repo_container_image_self_build else matrix_media_repo_docker_image_registry_prefix_upstream }}"
  24. matrix_media_repo_docker_image_registry_prefix_upstream: "{{ matrix_media_repo_docker_image_registry_prefix_upstream_default }}"
  25. matrix_media_repo_docker_image_registry_prefix_upstream_default: "ghcr.io/"
  26. # renovate: datasource=docker depName=ghcr.io/t2bot/matrix-media-repo
  27. matrix_media_repo_docker_image_tag: "v1.3.8"
  28. matrix_media_repo_docker_image_force_pull: "{{ matrix_media_repo_docker_image.endswith(':latest') }}"
  29. matrix_media_repo_base_path: "{{ matrix_base_data_path }}/{{ matrix_media_repo_identifier }}"
  30. matrix_media_repo_config_path: "{{ matrix_media_repo_base_path }}/config"
  31. matrix_media_repo_data_path: "{{ matrix_media_repo_base_path }}/data"
  32. matrix_media_repo_docker_src_files_path: "{{ matrix_media_repo_base_path }}/docker-src"
  33. # List of systemd services that matrix-media-repo.service depends on
  34. matrix_media_repo_systemd_required_services_list: "{{ matrix_media_repo_systemd_required_services_list_default + matrix_media_repo_systemd_required_services_list_auto + matrix_media_repo_systemd_required_services_list_custom }}"
  35. matrix_media_repo_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
  36. matrix_media_repo_systemd_required_services_list_auto: []
  37. matrix_media_repo_systemd_required_services_list_custom: []
  38. # List of systemd services that matrix-media-repo.service wants
  39. matrix_media_repo_systemd_wanted_services_list: []
  40. # The base container network. It will be auto-created by this role if it doesn't exist already.
  41. matrix_media_repo_container_network: "{{ matrix_media_repo_identifier }}"
  42. # A list of additional container networks that the container would be connected to.
  43. # The role does not create these networks, so make sure they already exist.
  44. # Use this to expose this container to another reverse proxy, which runs in a different container network.
  45. matrix_media_repo_container_additional_networks: []
  46. # Controls whether media repo metrics should be proxied (exposed) on `matrix.example.com/metrics/matrix-media-repo`
  47. matrix_media_repo_metrics_proxying_enabled: false
  48. matrix_media_repo_metrics_proxying_hostname: ""
  49. matrix_media_repo_metrics_proxying_path: "/metrics/matrix-media-repo"
  50. # Controls whether the matrix-media-repo container exposes its HTTP port (tcp/8000 in the container).
  51. #
  52. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8000"), or empty string to not expose.
  53. matrix_media_repo_container_http_host_bind_port: ""
  54. # Controls whether the matrix-media-repo container exposes its metrics port (tcp/9000 in the container).
  55. #
  56. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:9000"), or empty string to not expose.
  57. matrix_media_repo_container_metrics_host_bind_port: ""
  58. # Extra arguments for the Docker container
  59. matrix_media_repo_container_extra_arguments: []
  60. # matrix_media_repo_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
  61. # See `../templates/labels.j2` for details.
  62. #
  63. # To inject your own other container labels, see `matrix_media_repo_container_labels_additional_labels`.
  64. matrix_media_repo_container_labels_traefik_enabled: true
  65. matrix_media_repo_container_labels_traefik_docker_network: "{{ matrix_media_repo_container_network }}"
  66. matrix_media_repo_container_labels_traefik_entrypoints: web-secure
  67. # Traefik labels handling the old `/_matrix/media` endpoints on the Client-API (web-secure) entrypoint.
  68. # These are being superseded by `/_matrix/client/VERSION/media` endpoints - see `matrix_media_repo_container_labels_traefik_client_matrix_client_media_*`.
  69. matrix_media_repo_container_labels_traefik_media_enabled: true
  70. matrix_media_repo_container_labels_traefik_media_path_prefix: "/_matrix/media"
  71. matrix_media_repo_container_labels_traefik_media_rule: "Host(`{{ matrix_server_fqn_matrix }}`) && PathPrefix(`{{ matrix_media_repo_container_labels_traefik_media_path_prefix }}`)"
  72. matrix_media_repo_container_labels_traefik_media_priority: 0
  73. matrix_media_repo_container_labels_traefik_media_entrypoints: "{{ matrix_media_repo_container_labels_traefik_entrypoints }}"
  74. matrix_media_repo_container_labels_traefik_media_tls: "{{ matrix_media_repo_container_labels_traefik_media_entrypoints != 'web' }}"
  75. matrix_media_repo_container_labels_traefik_media_tls_certResolver: default # noqa var-naming
  76. # Traefik labels handling the new `/_matrix/client/VERSION/media` endpoints on the Client-API (web-secure) entrypoint.
  77. # See: https://github.com/matrix-org/matrix-spec-proposals/pull/3916
  78. matrix_media_repo_container_labels_traefik_client_matrix_client_media_enabled: true
  79. matrix_media_repo_container_labels_traefik_client_matrix_client_media_path_regexp: "/_matrix/client/(?P<version>(v1))/media"
  80. matrix_media_repo_container_labels_traefik_client_matrix_client_media_rule: "Host(`{{ matrix_server_fqn_matrix }}`) && PathRegexp(`{{ matrix_media_repo_container_labels_traefik_client_matrix_client_media_path_regexp }}`)"
  81. matrix_media_repo_container_labels_traefik_client_matrix_client_media_priority: 0
  82. matrix_media_repo_container_labels_traefik_client_matrix_client_media_entrypoints: "{{ matrix_media_repo_container_labels_traefik_entrypoints }}"
  83. matrix_media_repo_container_labels_traefik_client_matrix_client_media_tls: "{{ matrix_media_repo_container_labels_traefik_client_matrix_client_media_entrypoints != 'web' }}"
  84. matrix_media_repo_container_labels_traefik_client_matrix_client_media_tls_certResolver: default # noqa var-naming
  85. # Traefik labels handling the old `/_matrix/media` endpoints on the internal entrypoint.
  86. # This is like `matrix_media_repo_container_labels_traefik_media_*`, but on an internal Traefik entrypoint.
  87. # These are being superseded by `/_matrix/client/VERSION/media` endpoints - see `matrix_media_repo_container_labels_traefik_internal_matrix_client_media_*`.
  88. matrix_media_repo_container_labels_traefik_internal_media_enabled: false
  89. matrix_media_repo_container_labels_traefik_internal_media_path_prefix: "{{ matrix_media_repo_container_labels_traefik_media_path_prefix }}"
  90. matrix_media_repo_container_labels_traefik_internal_media_rule: "PathPrefix(`{{ matrix_media_repo_container_labels_traefik_internal_media_path_prefix }}`)"
  91. matrix_media_repo_container_labels_traefik_internal_media_priority: "{{ matrix_media_repo_container_labels_traefik_media_priority }}"
  92. matrix_media_repo_container_labels_traefik_internal_media_entrypoints: ""
  93. # Traefik labels handling the new `/_matrix/client/VERSION/media` endpoints on the internal entrypoint.
  94. # See: https://github.com/matrix-org/matrix-spec-proposals/pull/3916
  95. matrix_media_repo_container_labels_traefik_internal_matrix_client_media_enabled: false
  96. matrix_media_repo_container_labels_traefik_internal_matrix_client_media_path_regexp: "{{ matrix_media_repo_container_labels_traefik_client_matrix_client_media_path_regexp }}"
  97. matrix_media_repo_container_labels_traefik_internal_matrix_client_media_rule: "PathRegexp(`{{ matrix_media_repo_container_labels_traefik_internal_matrix_client_media_path_regexp }}`)"
  98. matrix_media_repo_container_labels_traefik_internal_matrix_client_media_priority: "{{ matrix_media_repo_container_labels_traefik_client_matrix_client_media_priority }}"
  99. matrix_media_repo_container_labels_traefik_internal_matrix_client_media_entrypoints: ""
  100. # Traefik labels handling some additional routes on the Client-API (web-secure) entrypoint:
  101. # - /_matrix/client/r0/logout
  102. # - /_matrix/client/r0/logout/all
  103. matrix_media_repo_container_labels_traefik_logout_enabled: true
  104. matrix_media_repo_container_labels_traefik_logout_path_regexp: "^/_matrix/client/(?P<version>r0|v1|v3|unstable)/(?P<endpoint>logout|logout/all)"
  105. matrix_media_repo_container_labels_traefik_logout_rule: "Host(`{{ matrix_server_fqn_matrix }}`) && PathRegexp(`{{ matrix_media_repo_container_labels_traefik_logout_path_regexp }}`)"
  106. matrix_media_repo_container_labels_traefik_logout_priority: 0
  107. matrix_media_repo_container_labels_traefik_logout_entrypoints: "{{ matrix_media_repo_container_labels_traefik_entrypoints }}"
  108. matrix_media_repo_container_labels_traefik_logout_tls: "{{ matrix_media_repo_container_labels_traefik_logout_entrypoints != 'web' }}"
  109. matrix_media_repo_container_labels_traefik_logout_tls_certResolver: default # noqa var-naming
  110. # Traefik labels handling some additional routes on the Client-API (web-secure) entrypoint:
  111. # - /_matrix/client/r0/admin/purge_media_cache
  112. # - /_matrix/client/r0/admin/quarantine_media/{roomId:[^/]+}
  113. matrix_media_repo_container_labels_traefik_admin_enabled: true
  114. matrix_media_repo_container_labels_traefik_admin_path_regexp: "^/_matrix/client/(?P<version>(r0|v1|v3|unstable))/admin/(?P<endpoint>(purge_media_cache|quarantine_media/.*))"
  115. matrix_media_repo_container_labels_traefik_admin_rule: "Host(`{{ matrix_server_fqn_matrix }}`) && PathRegexp(`{{ matrix_media_repo_container_labels_traefik_admin_path_regexp }}`)"
  116. matrix_media_repo_container_labels_traefik_admin_priority: 0
  117. matrix_media_repo_container_labels_traefik_admin_entrypoints: "{{ matrix_media_repo_container_labels_traefik_entrypoints }}"
  118. matrix_media_repo_container_labels_traefik_admin_tls: "{{ matrix_media_repo_container_labels_traefik_admin_entrypoints != 'web' }}"
  119. matrix_media_repo_container_labels_traefik_admin_tls_certResolver: default # noqa var-naming
  120. # Traefik labels handling some additional routes on the Client-API (web-secure) entrypoint:
  121. # - /_matrix/client/unstable/io.t2bot.media
  122. matrix_media_repo_container_labels_traefik_t2bot_enabled: true
  123. matrix_media_repo_container_labels_traefik_t2bot_path_prefix: "/_matrix/client/unstable/io.t2bot.media"
  124. matrix_media_repo_container_labels_traefik_t2bot_rule: "Host(`{{ matrix_server_fqn_matrix }}`) && PathPrefix(`{{ matrix_media_repo_container_labels_traefik_t2bot_path_prefix }}`)"
  125. matrix_media_repo_container_labels_traefik_t2bot_priority: 0
  126. matrix_media_repo_container_labels_traefik_t2bot_entrypoints: "{{ matrix_media_repo_container_labels_traefik_entrypoints }}"
  127. matrix_media_repo_container_labels_traefik_t2bot_tls: "{{ matrix_media_repo_container_labels_traefik_t2bot_entrypoints != 'web' }}"
  128. matrix_media_repo_container_labels_traefik_t2bot_tls_certResolver: default # noqa var-naming
  129. # Controls whether labels will be added that expose the media repo metrics endpoint
  130. matrix_media_repo_container_labels_traefik_metrics_enabled: "{{ matrix_media_repo_metrics_enabled and matrix_media_repo_metrics_proxying_enabled }}"
  131. matrix_media_repo_container_labels_traefik_metrics_rule: "Host(`{{ matrix_media_repo_metrics_proxying_hostname }}`) && PathPrefix(`{{ matrix_media_repo_metrics_proxying_path }}`)"
  132. matrix_media_repo_container_labels_traefik_metrics_priority: 0
  133. matrix_media_repo_container_labels_traefik_metrics_entrypoints: "{{ matrix_media_repo_container_labels_traefik_entrypoints }}"
  134. matrix_media_repo_container_labels_traefik_metrics_tls: "{{ matrix_media_repo_container_labels_traefik_t2bot_entrypoints != 'web' }}"
  135. matrix_media_repo_container_labels_traefik_metrics_tls_certResolver: default # noqa var-naming
  136. matrix_media_repo_container_labels_traefik_metrics_middleware_basic_auth_enabled: false
  137. # See: https://doc.traefik.io/traefik/middlewares/http/basicauth/#users
  138. matrix_media_repo_container_labels_traefik_metrics_middleware_basic_auth_users: ''
  139. # Traefik labels handling the old `/_matrix/media` endpoints on the federation entrypint.
  140. # These are being superseded by `/_matrix/federation/VERSION/media` endpoints - see `matrix_media_repo_container_labels_traefik_federation_matrix_federation_media_*`.
  141. matrix_media_repo_container_labels_traefik_media_federation_enabled: true
  142. matrix_media_repo_container_labels_traefik_media_federation_path_prefix: "/_matrix/media"
  143. matrix_media_repo_container_labels_traefik_media_federation_rule: "Host(`{{ matrix_server_fqn_matrix }}`) && PathPrefix(`{{ matrix_media_repo_container_labels_traefik_media_path_prefix }}`)"
  144. matrix_media_repo_container_labels_traefik_media_federation_priority: 0
  145. matrix_media_repo_container_labels_traefik_media_federation_entrypoints: "{{ matrix_federation_traefik_entrypoint_name }}"
  146. matrix_media_repo_container_labels_traefik_media_federation_tls: "{{ matrix_media_repo_container_labels_traefik_media_entrypoints != 'web' }}"
  147. matrix_media_repo_container_labels_traefik_media_federation_tls_certResolver: default # noqa var-naming
  148. # Traefik labels handling the new `/_matrix/federation/VERSION/media` endpoints on the federation entrypint.
  149. # See: https://github.com/matrix-org/matrix-spec-proposals/pull/3916
  150. matrix_media_repo_container_labels_traefik_federation_matrix_federation_media_enabled: true
  151. matrix_media_repo_container_labels_traefik_federation_matrix_federation_media_path_regexp: "/_matrix/federation/(?P<version>(v1))/media"
  152. matrix_media_repo_container_labels_traefik_federation_matrix_federation_media_rule: "Host(`{{ matrix_server_fqn_matrix }}`) && PathRegexp(`{{ matrix_media_repo_container_labels_traefik_federation_matrix_federation_media_path_regexp }}`)"
  153. matrix_media_repo_container_labels_traefik_federation_matrix_federation_media_priority: 0
  154. matrix_media_repo_container_labels_traefik_federation_matrix_federation_media_entrypoints: "{{ matrix_federation_traefik_entrypoint_name }}"
  155. matrix_media_repo_container_labels_traefik_federation_matrix_federation_media_tls: "{{ matrix_media_repo_container_labels_traefik_federation_matrix_federation_media_entrypoints != 'web' }}"
  156. matrix_media_repo_container_labels_traefik_federation_matrix_federation_media_tls_certResolver: default # noqa var-naming
  157. # Traefik labels handling some additional routes on the federation entrypoint:
  158. # - /_matrix/client/r0/logout
  159. # - /_matrix/client/r0/logout/all
  160. matrix_media_repo_container_labels_traefik_logout_federation_enabled: true
  161. matrix_media_repo_container_labels_traefik_logout_federation_path_regexp: "{{ matrix_media_repo_container_labels_traefik_logout_path_regexp }}"
  162. matrix_media_repo_container_labels_traefik_logout_federation_rule: "Host(`{{ matrix_server_fqn_matrix }}`) && PathRegexp(`{{ matrix_media_repo_container_labels_traefik_logout_federation_path_regexp }}`)"
  163. matrix_media_repo_container_labels_traefik_logout_federation_priority: 0
  164. matrix_media_repo_container_labels_traefik_logout_federation_entrypoints: "{{ matrix_federation_traefik_entrypoint_name }}"
  165. matrix_media_repo_container_labels_traefik_logout_federation_tls: "{{ matrix_media_repo_container_labels_traefik_logout_entrypoints != 'web' }}"
  166. matrix_media_repo_container_labels_traefik_logout_federation_tls_certResolver: default # noqa var-naming
  167. # Traefik labels handling some additional routes on the federation entrypoint:
  168. # - /_matrix/client/r0/admin/purge_media_cache
  169. # - /_matrix/client/r0/admin/quarantine_media/{roomId:[^/]+}
  170. matrix_media_repo_container_labels_traefik_admin_federation_enabled: true
  171. matrix_media_repo_container_labels_traefik_admin_federation_path_regexp: "{{ matrix_media_repo_container_labels_traefik_admin_path_regexp }}"
  172. matrix_media_repo_container_labels_traefik_admin_federation_rule: "Host(`{{ matrix_server_fqn_matrix }}`) && PathRegexp(`{{ matrix_media_repo_container_labels_traefik_admin_federation_path_regexp }}`)"
  173. matrix_media_repo_container_labels_traefik_admin_federation_priority: 0
  174. matrix_media_repo_container_labels_traefik_admin_federation_entrypoints: "{{ matrix_federation_traefik_entrypoint_name }}"
  175. matrix_media_repo_container_labels_traefik_admin_federation_tls: "{{ matrix_media_repo_container_labels_traefik_admin_entrypoints != 'web' }}"
  176. matrix_media_repo_container_labels_traefik_admin_federation_tls_certResolver: default # noqa var-naming
  177. # Traefik labels handling some additional routes on the federation entrypoint:
  178. # - /_matrix/client/unstable/io.t2bot.media
  179. matrix_media_repo_container_labels_traefik_t2bot_federation_enabled: true
  180. matrix_media_repo_container_labels_traefik_t2bot_federation_path_prefix: "/_matrix/client/unstable/io.t2bot.media"
  181. matrix_media_repo_container_labels_traefik_t2bot_federation_rule: "Host(`{{ matrix_server_fqn_matrix }}`) && PathPrefix(`{{ matrix_media_repo_container_labels_traefik_t2bot_path_prefix }}`)"
  182. matrix_media_repo_container_labels_traefik_t2bot_federation_priority: 0
  183. matrix_media_repo_container_labels_traefik_t2bot_federation_entrypoints: "{{ matrix_federation_traefik_entrypoint_name }}"
  184. matrix_media_repo_container_labels_traefik_t2bot_federation_tls: "{{ matrix_media_repo_container_labels_traefik_t2bot_entrypoints != 'web' }}"
  185. matrix_media_repo_container_labels_traefik_t2bot_federation_tls_certResolver: default # noqa var-naming
  186. # Controls which additional headers to attach to all HTTP requests.
  187. # To add your own headers, use `matrix_media_repo_container_labels_traefik_additional_request_headers_custom`
  188. matrix_media_repo_container_labels_traefik_additional_request_headers: "{{ matrix_media_repo_container_labels_traefik_additional_request_headers_auto | combine(matrix_media_repo_container_labels_traefik_additional_request_headers_custom) }}"
  189. matrix_media_repo_container_labels_traefik_additional_request_headers_auto: |
  190. {{
  191. {}
  192. | combine ({'X-Forwarded-Host': matrix_domain} if matrix_domain else {})
  193. }}
  194. matrix_media_repo_container_labels_traefik_additional_request_headers_custom: {}
  195. # matrix_media_repo_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
  196. # See `../templates/labels.j2` for details.
  197. #
  198. # Example:
  199. # matrix_media_repo_container_labels_additional_labels: |
  200. # my.label=1
  201. # another.label="here"
  202. matrix_media_repo_container_labels_additional_labels: ''
  203. # matrix_media_repo_dashboard_urls contains a list of URLs with Grafana dashboard definitions.
  204. # If the Grafana role is enabled, these dashboards will be downloaded.
  205. matrix_media_repo_dashboard_urls:
  206. - https://raw.githubusercontent.com/spantaleev/matrix-docker-ansible-deploy/master/roles/custom/matrix-media-repo/templates/grafana/media-repo.json
  207. # *****************************************************************************
  208. # Configuration File Settings
  209. # *****************************************************************************
  210. # General repo configuration
  211. matrix_media_repo_bind_address: '0.0.0.0'
  212. matrix_media_repo_port: 8000
  213. # Where to store the logs, relative to where the repo is started from. Logs will be automatically
  214. # rotated every day and held for 14 days. To disable the repo logging to files, set this to
  215. # "-" (including quotation marks).
  216. #
  217. # Note: to change the log directory you'll have to restart the repository. This setting cannot be
  218. # live reloaded.
  219. matrix_media_repo_log_directory: "-"
  220. # Set to true to enable color coding in your logs. Note that this may cause escape sequences to
  221. # appear in logs which render them unreadable, which is why colors are disabled by default.
  222. matrix_media_repo_log_colors: false
  223. # Set to true to enable JSON logging for consumption by things like logstash. Note that this is
  224. # incompatible with the log color option and will always render without colors.
  225. matrix_media_repo_json_logs: false
  226. # The log level to log at. Note that this will need to be at least "info" to receive support.
  227. #
  228. # Values (in increasing spam): panic | fatal | error | warn | info | debug | trace
  229. matrix_media_repo_log_level: "info"
  230. # If true, the media repo will accept any X-Forwarded-For header without validation. In most cases
  231. # this option should be left as "false". Note that the media repo already expects an X-Forwarded-For
  232. # header, but validates it to ensure the IP being given makes sense.
  233. matrix_media_repo_trust_any_forwarded_address: false
  234. # If false, the media repo will not use the X-Forwarded-Host header commonly added by reverse proxies.
  235. # Typically this should remain as true, though in some circumstances it may need to be disabled.
  236. # See https://github.com/turt2live/matrix-media-repo/issues/202 for more information.
  237. matrix_media_repo_use_forwarded_host: true
  238. # Options for dealing with federation
  239. # On a per-host basis, the number of consecutive failures in calling the host before the
  240. # media repo will back off. This defaults to 20 if not given. Note that 404 errors from
  241. # the remote server do not count towards this.
  242. matrix_media_repo_federation_backoff_at: 20
  243. # The domains the media repo should never serve media for. Existing media already stored from
  244. # these domains will remain, however will not be downloadable without a data export. Media
  245. # repo administrators will bypass this check. Admin APIs will still work for media on these
  246. # domains.
  247. #
  248. # This will not prevent the listed domains from accessing media on this media repo - it only
  249. # stops users on *this* media repo from accessing media originally uploaded to the listed domains.
  250. #
  251. # Note: Adding domains controlled by the media repo itself to this list is not advisable.
  252. # matrix_media_repo_federation_ignored_hosts: [
  253. # "example.org"
  254. # ]
  255. matrix_media_repo_federation_ignored_hosts: []
  256. # The database configuration for the media repository
  257. # Do NOT put your homeserver's existing database credentials here. Create a new database and
  258. # user instead. Using the same server is fine, just not the same username and database.
  259. matrix_media_repo_database_username: "matrix_media_repo"
  260. matrix_media_repo_database_password: ""
  261. matrix_media_repo_database_hostname: ""
  262. matrix_media_repo_database_port: 5432
  263. matrix_media_repo_database_name: "matrix_media_repo"
  264. matrix_media_repo_database_sslmode: disable
  265. # Currently only "postgres" is supported.
  266. matrix_media_repo_database_postgres: "postgres://{{ matrix_media_repo_database_username }}:{{ matrix_media_repo_database_password }}@{{ matrix_media_repo_database_hostname }}:{{ matrix_media_repo_database_port }}/{{ matrix_media_repo_database_name }}?sslmode={{ matrix_media_repo_database_sslmode }}"
  267. # The database pooling options
  268. # The maximum number of connects to hold open. More of these allow for more concurrent
  269. # processes to happen.
  270. matrix_media_repo_database_max_connections: 25
  271. # The maximum number of connects to leave idle. More of these reduces the time it takes
  272. # to serve requests in low-traffic scenarios.
  273. matrix_media_repo_database_max_idle_connections: 5
  274. # The configuration for the homeservers this media repository is known to control. Servers
  275. # not listed here will not be able to upload media.
  276. matrix_media_repo_homeservers: "{{ matrix_media_repo_homeservers_auto + matrix_media_repo_homeservers_additional }}"
  277. # Auto configured server setup by the playbook
  278. matrix_media_repo_homeservers_auto: []
  279. # Additional servers to be managed by MMR
  280. matrix_media_repo_homeservers_additional: []
  281. # If true, the playbook will generate a signing key when the setup role is invoked.
  282. # This is adjusted in `group_vars/matrix_servers` depending on the homeserver implementation.
  283. matrix_media_repo_generate_signing_key: false
  284. # Path where the homeserver signing key is located. Set automatically in
  285. # `group_vars/matrix_servers` depending on which homeserver is being used.
  286. matrix_media_repo_homeserver_signing_key: ""
  287. # Options for controlling how access tokens work with the media repo. It is recommended that if
  288. # you are going to use these options that the `/logout` and `/logout/all` client-server endpoints
  289. # be proxied through this process. They will also be called on the homeserver, and the response
  290. # sent straight through the client - they are simply used to invalidate the cache faster for
  291. # a particular user. Without these, the access tokens might still work for a short period of time
  292. # after the user has already invalidated them.
  293. #
  294. # This will also cache errors from the homeserver.
  295. #
  296. # Note that when this config block is used outside of a per-domain config, all hosts will be
  297. # subject to the same cache. This also means that application services on limited homeservers
  298. # could be authorized on the wrong domain.
  299. #
  300. # ***************************************************************************
  301. # * IT IS HIGHLY RECOMMENDED TO USE PER-DOMAIN CONFIGS WITH THIS FEATURE. *
  302. # ***************************************************************************
  303. # The maximum time a cached access token will be considered valid. Set to zero (the default)
  304. # to disable the cache and constantly hit the homeserver. This is recommended to be set to
  305. # 43200 (12 hours) on servers with the logout endpoints proxied through the media repo, and
  306. # zero for servers who do not proxy the endpoints through.
  307. matrix_media_repo_access_tokens_max_cache_time_seconds: 43200
  308. # Whether or not to use the `appservices` config option below. If disabled (the default),
  309. # the regular access token cache will be used for each user, potentially leading to high
  310. # memory usage.
  311. matrix_media_repo_access_tokens_use_local_appservice_config: false
  312. # The application services (and their namespaces) registered on the homeserver. Only used
  313. # if `useLocalAppserviceConfig` is enabled (recommended).
  314. #
  315. # Usually the appservice will provide you with these config details - they'll just need
  316. # translating from the appservice registration to here. Note that this does not require
  317. # all options from the registration, and only requires the bare minimum required to run
  318. # the media repo.
  319. # matrix_media_repo_access_tokens_appservices: [
  320. # {
  321. # id: "Name_of_appservice_for_your_reference",
  322. # asToken: "Secret_token_for_appservices_to_use",
  323. # senderUserId: "@_example_bridge:example.com",
  324. # userNamespaces: [
  325. # regex: "@_example_bridge_.+:example.com"
  326. # # A note about regexes: it is best to suffix *all* namespaces with the homeserver
  327. # # domain users are valid for, as otherwise the appservice can use any user with
  328. # # any domain name it feels like, even if that domain is not configured with the
  329. # # media repo. This will lead to inaccurate reporting in the case of the media
  330. # # repo, and potentially leading to media being considered "remote".
  331. # ]
  332. # }
  333. # ]
  334. matrix_media_repo_access_tokens_appservices: []
  335. # These users have full access to the administrative functions of the media repository.
  336. # See docs/admin.md for information on what these people can do. They must belong to one of the
  337. # configured homeservers above.
  338. # matrix_media_repo_admins: [
  339. # "@alice:example.org"
  340. # ]
  341. matrix_media_repo_admins: []
  342. # Shared secret auth is useful for applications building on top of the media repository, such
  343. # as a management interface. The `token` provided here is treated as a repository administrator
  344. # when shared secret auth is enabled: if the `token` is used in place of an access token, the'
  345. # request will be authorized. This is not limited to any particular domain, giving applications
  346. # the ability to use it on any configured hostname.
  347. # Set this to true to enable shared secret auth.
  348. matrix_media_repo_shared_secret_auth_enabled: false
  349. # Use a secure value here to prevent unauthorized access to the media repository.
  350. matrix_media_repo_shared_secret_auth_token: "PutSomeRandomSecureValueHere"
  351. # Datastores are places where media should be persisted. This isn't dedicated for just uploads:
  352. # thumbnails and other misc data is also stored in these places. The media repo, when looking
  353. # for a datastore to use, will always use the smallest datastore first.
  354. # ID for the file datastore. Any unique alphanumeric string (e.g. generated via `pwgen -s 64 1`).
  355. # This value CANNOT be changed after media has been stored — matrix-media-repo ties media to this ID.
  356. matrix_media_repo_datastore_file_id: ""
  357. # Datastores can be split into many areas when handling uploads. Media is still de-duplicated
  358. # across all datastores (local content which duplicates remote content will re-use the remote
  359. # content's location). This option is useful if your datastore is becoming very large, or if
  360. # you want faster storage for a particular kind of media.
  361. #
  362. # To disable this datastore, making it readonly, specify `forKinds: []`.
  363. #
  364. # The kinds available are:
  365. # thumbnails - Used to store thumbnails of media (local and remote).
  366. # remote_media - Original copies of remote media (servers not configured by this repo).
  367. # local_media - Original uploads for local media.
  368. # archives - Archives of content (GDPR and similar requests).
  369. matrix_media_repo_datastore_file_for_kinds: ["thumbnails", "remote_media", "local_media", "archives"]
  370. # Path to datastore, relative to matrix-media-repo directory root
  371. matrix_media_repo_datastore_opts_path: "/data/media"
  372. # ID for the S3 datastore. Any unique alphanumeric string (e.g. generated via `pwgen -s 64 1`).
  373. # This value CANNOT be changed after media has been stored — matrix-media-repo ties media to this ID.
  374. matrix_media_repo_datastore_s3_id: ""
  375. # Datastores can be split into many areas when handling uploads. Media is still de-duplicated
  376. # across all datastores (local content which duplicates remote content will re-use the remote
  377. # content's location). This option is useful if your datastore is becoming very large, or if
  378. # you want faster storage for a particular kind of media.
  379. #
  380. # To disable this datastore, making it readonly, specify `forKinds: []`.
  381. #
  382. # The kinds available are:
  383. # thumbnails - Used to store thumbnails of media (local and remote).
  384. # remote_media - Original copies of remote media (servers not configured by this repo).
  385. # local_media - Original uploads for local media.
  386. # archives - Archives of content (GDPR and similar requests).
  387. matrix_media_repo_datastore_s3_for_kinds: []
  388. # The s3 uploader needs a temporary location to buffer files to reduce memory usage on
  389. # small file uploads. If the file size is unknown, the file is written to this location
  390. # before being uploaded to s3 (then the file is deleted). If you aren't concerned about
  391. # memory usage, set this to an empty string.
  392. matrix_media_repo_datastore_s3_opts_temp_path: ""
  393. matrix_media_repo_datastore_s3_opts_endpoint: "sfo2.digitaloceanspaces.com"
  394. matrix_media_repo_datastore_s3_opts_access_key_id: ""
  395. matrix_media_repo_datastore_s3_opts_access_secret: ""
  396. matrix_media_repo_datastore_s3_opts_ssl: true
  397. matrix_media_repo_datastore_s3_opts_bucket_name: "your-media-bucket"
  398. # An optional region for where this S3 endpoint is located. Typically not needed, though
  399. # some providers will need this (like Scaleway). Uncomment to use.
  400. # matrix_media_repo_datastore_s3_opts_region: "sfo2"
  401. # An optional storage class for tuning how the media is stored at s3.
  402. # See https://aws.amazon.com/s3/storage-classes/ for details; uncomment to use.
  403. # matrix_media_repo_datastore_s3_opts_storage_class: "STANDARD"
  404. # When set, if the requesting user/server supports being redirected, and MMR is capable
  405. # of performing that redirection, they will be redirected to the given object location.
  406. # The object ID used in S3 is assumed to be the file name, and will simply be appended.
  407. # It is therefore important to include any trailing slashes or path information. For
  408. # example, an object with ID "hello/world" will get converted to "https://mycdn.example.org/hello/world".
  409. # Note that MMR may not redirect in all cases, even if the client/server requests the
  410. # capability. MMR may still be responsible for bandwidth charges incurred from going to
  411. # the bucket directly.
  412. # matrix_media_repo_datastore_s3_opts_public_base_url: "https://mycdn.example.org/"
  413. # Set to `true` to bypass any local cache when `publicBaseUrl` is set. Has no effect
  414. # when `publicBaseUrl` is unset. Defaults to false (cached media will be served by MMR
  415. # before redirection if present).
  416. matrix_media_repo_datastore_s3_opts_redirect_when_cached: true
  417. # The size of the prefix (path component) to use when storing media in S3. This can
  418. # help improve download speeds in some S3 providers. Should not be set to higher than
  419. # 16 to avoid future incompatibilities with MMR. Defaults to zero (no prefix).
  420. matrix_media_repo_datastore_s3_opts_prefix_length: 0
  421. # Options for controlling archives. Archives are exports of a particular user's content for
  422. # the purpose of GDPR or moving media to a different server.
  423. # Whether archiving is enabled or not. Default enabled.
  424. matrix_media_repo_archiving_enabled: true
  425. # If true, users can request a copy of their own data. By default, only repository administrators
  426. # can request a copy.
  427. # This includes the ability for homeserver admins to request a copy of their own server's
  428. # data, as known to the repo.
  429. matrix_media_repo_archiving_self_service: false
  430. # The number of bytes to target per archive before breaking up the files. This is independent
  431. # of any file upload limits and will require a similar amount of memory when performing an export.
  432. # The file size is also a target, not a guarantee - it is possible to have files that are smaller
  433. # or larger than the target. This is recommended to be approximately double the size of your
  434. # file upload limit, provided there is enough memory available for the demand of exporting.
  435. matrix_media_repo_archiving_target_bytes_per_part: 209715200 # 200mb default
  436. # The file upload settings for the media repository
  437. # The maximum individual file size a user can upload.
  438. matrix_media_repo_max_bytes: 104857600 # 100MB default, 0 to disable
  439. # The minimum number of bytes to let people upload. This is recommended to be non-zero to
  440. # ensure that the "cost" of running the media repo is worthwhile - small file uploads tend
  441. # to waste more CPU and database resources than small files, thus a default of 100 bytes
  442. # is applied here as an approximate break-even point.
  443. matrix_media_repo_min_bytes: 100 # 100 bytes by default
  444. # The number of bytes to claim as the maximum size for uploads for the limits API. If this
  445. # is not provided then the maxBytes setting will be used instead. This is useful to provide
  446. # if the media repo's settings and the reverse proxy do not match for maximum request size.
  447. # This is purely for informational reasons and does not actually limit any functionality.
  448. # Set this to -1 to indicate that there is no limit. Zero will force the use of maxBytes.
  449. matrix_media_repo_reported_max_bytes: 0
  450. # The number of pending uploads a user is permitted to have at a given time. They must cancel,
  451. # complete, or otherwise let pending requests expire before uploading any more media. Set to
  452. # zero to disable.
  453. matrix_media_repo_max_pending: 5
  454. # The duration the server will wait to receive media that was asynchronously uploaded before
  455. # expiring it entirely. This should be set sufficiently high for a client on poor connectivity
  456. # to upload something. The Matrix specification recommends 24 hours (86400 seconds), however
  457. # this project recommends 30 minutes (1800 seconds).
  458. matrix_media_repo_max_age_seconds: 1800
  459. # Options for limiting how much content a user can upload. Quotas are applied to content
  460. # associated with a user regardless of de-duplication. Quotas which affect remote servers
  461. # or users will not take effect. When a user exceeds their quota they will be unable to
  462. # upload any more media.
  463. # Whether quotas are enabled/enforced. Note that even when disabled the media repo will
  464. # track how much media a user has uploaded. Quotas are disabled by default.
  465. matrix_media_repo_quotas_enabled: false
  466. # The upload quota rules which affect users. The first rule to match the user ID will take
  467. # effect. If a user does not match a rule, the defaults implied by the above config will
  468. # take effect instead. The user will not be permitted to upload anything above these quota
  469. # values, but can match them exactly.
  470. matrix_media_repo_quotas_users: "{{ matrix_media_repo_quotas_users_auto + matrix_media_repo_quotas_users_additional }}"
  471. matrix_media_repo_quotas_users_auto:
  472. - glob: "@*:*" # Affect all users. Use asterisks (*) to match any character.
  473. # The maximum number of TOTAL bytes a user can upload. Defaults to zero (no limit).
  474. maxBytes: 53687063712 # 50gb
  475. # The same as maxPending above - the number of uploads the user can have waiting to
  476. # complete before starting another one. Defaults to maxPending above. Set to 0 to
  477. # disable.
  478. maxPending: 5
  479. # The maximum number of uploaded files a user can have. Defaults to zero (no limit).
  480. # If both maxBytes and maxFiles are in use then the first condition a user triggers
  481. # will prevent upload. Note that a user can still have uploads contributing to maxPending,
  482. # but will not be able to complete them if they are at maxFiles.
  483. maxFiles: 0
  484. # Additional quota glob patterns
  485. matrix_media_repo_quotas_users_additional: []
  486. # Settings related to downloading files from the media repository
  487. # The maximum number of bytes to download from other servers
  488. matrix_media_repo_downloads_max_bytes: 104857600 # 100MB default, 0 to disable
  489. # The number of workers to use when downloading remote media. Raise this number if remote
  490. # media is downloading slowly or timing out.
  491. #
  492. # Maximum memory usage = numWorkers multiplied by the maximum download size
  493. # Average memory usage is dependent on how many concurrent downloads your users are doing.
  494. matrix_media_repo_downloads_num_workers: 10
  495. # How long, in minutes, to cache errors related to downloading remote media. Once this time
  496. # has passed, the media is able to be re-requested.
  497. matrix_media_repo_downloads_failure_cache_minutes: 5
  498. # How many days after a piece of remote content is downloaded before it expires. It can be
  499. # re-downloaded on demand, this just helps free up space in your datastore. Set to zero or
  500. # negative to disable. Defaults to disabled.
  501. matrix_media_repo_downloads_expire_after_days: 0
  502. # The default size, in bytes, to return for range requests on media. Range requests are used
  503. # by clients when they only need part of a file, such as a video or audio element. Note that
  504. # the entire file will still be cached (if enabled), but only part of it will be returned.
  505. # If the client requests a larger or smaller range, that will be honoured.
  506. matrix_media_repo_downloads_default_range_chunk_size_bytes: 10485760 # 10MB default
  507. # URL Preview settings
  508. # If enabled, the preview_url routes will be accessible
  509. matrix_media_repo_url_previews_enabled: true
  510. # 10MB default, 0 to disable
  511. matrix_media_repo_url_previews_max_page_size_bytes: 10485760
  512. # If true, the media repository will try to provide previews for URLs with invalid or unsafe
  513. # certificates. If false (the default), the media repo will fail requests to said URLs.
  514. matrix_media_repo_url_previews_preview_unsafe_certificates: false
  515. # Note: URL previews are limited to a given number of words, which are then limited to a number
  516. # of characters, taking off the last word if it needs to. This also applies for the title.
  517. # The number of words to include in a preview (maximum)
  518. matrix_media_repo_url_previews_num_words: 50
  519. # The maximum number of characters for a description
  520. matrix_media_repo_url_previews_max_length: 200
  521. # The maximum number of words to include in a preview's title
  522. matrix_media_repo_url_previews_num_title_words: 30
  523. # The maximum number of characters for a title
  524. matrix_media_repo_url_previews_max_title_length: 150
  525. # The mime types to preview when OpenGraph previews cannot be rendered. OpenGraph previews are
  526. # calculated on anything matching "text/*". To have a thumbnail in the preview the URL must be
  527. # an image and the image's type must be allowed by the thumbnailer.
  528. matrix_media_repo_url_previews_file_preview_types:
  529. - "image/*"
  530. # The number of workers to use when generating url previews. Raise this number if url
  531. # previews are slow or timing out.
  532. #
  533. # Maximum memory usage = numWorkers multiplied by the maximum page size
  534. # Average memory usage is dependent on how many concurrent urls your users are previewing.
  535. matrix_media_repo_url_previews_num_workers: 10
  536. # Either allowedNetworks or disallowedNetworks must be provided. If both are provided, they
  537. # will be merged. URL previews will be disabled if neither is supplied. Each entry must be
  538. # a CIDR range.
  539. matrix_media_repo_url_previews_disallowed_networks:
  540. - "127.0.0.1/8"
  541. - "10.0.0.0/8"
  542. - "172.16.0.0/12"
  543. - "192.168.0.0/16"
  544. - "100.64.0.0/10"
  545. - "169.254.0.0/16"
  546. - '::1/128'
  547. - 'fe80::/64'
  548. - 'fc00::/7'
  549. matrix_media_repo_url_previews_allowed_networks:
  550. # "Everything". The blacklist will help limit this.
  551. # This is the default value for this field.
  552. - "0.0.0.0/0"
  553. # How many days after a preview is generated before it expires and is deleted. The preview
  554. # can be regenerated safely - this just helps free up some space in your database. Set to
  555. # zero or negative to disable. Defaults to disabled.
  556. matrix_media_repo_url_previews_expire_after_days: 0
  557. # The default Accept-Language header to supply when generating URL previews when one isn't
  558. # supplied by the client.
  559. # Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language
  560. matrix_media_repo_url_previews_default_language: "en-US,en"
  561. # Set the User-Agent header to supply when generating URL previews
  562. matrix_media_repo_url_previews_user_agent: "matrix-media-repo"
  563. # When true, oEmbed previews will be enabled. Typically these kinds of previews are used for
  564. # sites that do not support OpenGraph or page scraping, such as Twitter. For information on
  565. # specifying providers for oEmbed, including your own, see the following documentation:
  566. # https://docs.t2bot.io/matrix-media-repo/url-previews/oembed.html
  567. # Defaults to disabled.
  568. matrix_media_repo_url_previews_o_embed: false
  569. # The thumbnail configuration for the media repository.
  570. # The maximum number of bytes an image can be before the thumbnailer refuses.
  571. matrix_media_repo_thumbnails_max_source_bytes: 10485760 # 10MB default, 0 to disable
  572. # The maximum number of pixels an image can have before the thumbnailer refuses. Note that
  573. # this only applies to image types: file types like audio and video are affected solely by
  574. # the maxSourceBytes.
  575. matrix_media_repo_thumbnails_max_pixels: 32000000 # 32M default
  576. # The number of workers to use when generating thumbnails. Raise this number if thumbnails
  577. # are slow to generate or timing out.
  578. #
  579. # Maximum memory usage = numWorkers multiplied by the maximum image source size
  580. # Average memory usage is dependent on how many thumbnails are being generated by your users
  581. matrix_media_repo_thumbnails_num_workers: 100
  582. # All thumbnails are generated into one of the sizes listed here. The first size is used as
  583. # the default for when no width or height is requested. The media repository will return
  584. # either an exact match or the next largest size of thumbnail.
  585. matrix_media_repo_thumbnails_sizes:
  586. - width: 32
  587. height: 32
  588. - width: 96
  589. height: 96
  590. - width: 320
  591. height: 240
  592. - width: 640
  593. height: 480
  594. - width: 768 # This size is primarily used for audio thumbnailing.
  595. height: 240
  596. - width: 800
  597. height: 600
  598. # To allow for thumbnails to be any size, not just in the sizes specified above, set this to
  599. # true (default false). When enabled, whatever size requested by the client will be generated
  600. # up to a maximum of the largest possible dimensions in the `sizes` list. For best results,
  601. # specify only one size in the `sizes` list when this option is enabled.
  602. matrix_media_repo_thumbnails_dynamic_sizing: false
  603. # The content types to thumbnail when requested. Types that are not supported by the media repo
  604. # will not be thumbnailed (adding application/json here won't work). Clients may still not request
  605. # thumbnails for these types - this won't make clients automatically thumbnail these file types.
  606. matrix_media_repo_thumbnails_types:
  607. - "image/jpeg"
  608. - "image/jpg"
  609. - "image/png"
  610. - "image/apng"
  611. - "image/gif"
  612. - "image/heif"
  613. - "image/heic"
  614. - "image/webp"
  615. - "image/bmp"
  616. - "image/tiff"
  617. # - "image/svg+xml" # Be sure to have ImageMagick installed to thumbnail SVG files
  618. - "audio/mpeg"
  619. - "audio/ogg"
  620. - "audio/wav"
  621. - "audio/flac"
  622. # - "video/mp4" # Be sure to have ffmpeg installed to thumbnail video files
  623. # Animated thumbnails can be CPU intensive to generate. To disable the generation of animated
  624. # thumbnails, set this to false. If disabled, regular thumbnails will be returned.
  625. matrix_media_repo_thumbnails_allow_animated: true
  626. # Default to animated thumbnails, if available
  627. matrix_media_repo_thumbnails_default_animated: false
  628. # The maximum file size to thumbnail when a capable animated thumbnail is requested. If the image
  629. # is larger than this, the thumbnail will be generated as a static image.
  630. matrix_media_repo_thumbnails_max_animate_size_bytes: 10485760 # 10MB default, 0 to disable
  631. # On a scale of 0 (start of animation) to 1 (end of animation), where should the thumbnailer try
  632. # and thumbnail animated content? Defaults to 0.5 (middle of animation).
  633. matrix_media_repo_thumbnails_still_frame: 0.5
  634. # How many days after a thumbnail is generated before it expires and is deleted. The thumbnail
  635. # can be regenerated safely - this just helps free up some space in your datastores. Set to
  636. # zero or negative to disable. Defaults to disabled.
  637. matrix_media_repo_thumbnails_expire_after_days: 0
  638. # Controls for the rate limit functionality
  639. # Set this to false if rate limiting is handled at a higher level or you don't want it enabled.
  640. matrix_media_repo_rate_limit_enabled: true
  641. # The number of requests per second before an IP will be rate limited. Must be a whole number.
  642. matrix_media_repo_rate_limit_requests_per_second: 1
  643. # The number of requests an IP can send at once before the rate limit is actually considered.
  644. matrix_media_repo_rate_limit_burst: 10
  645. # The 'leaky bucket' configurations for MMR. Leaky buckets are limited in size and have a slow
  646. # drain rate, minimizing the ability for a user to consume large amounts of resources.
  647. #
  648. # Buckets are checked and applied after the requests per second configuration above. Buckets are
  649. # disabled when rate limiting is disabled.
  650. #
  651. # Note: buckets are *not* shared across processes. If download requests could end up at two different
  652. # processes, two different buckets may be filled. This behaviour may change in the future.
  653. # The download bucket applies to both download requests and thumbnail requests. Each anonymous
  654. # user is assigned a single bucket from their IP address. Authenticated requests (when supported)
  655. # will use the authenticated entity as the subject - either a user or remote server.
  656. # The maximum size of each bucket.
  657. matrix_media_repo_rate_limit_buckets_download_capacity_bytes: 524288000 # 500mb default
  658. # The number of bytes to "drain" from the bucket every minute.
  659. matrix_media_repo_rate_limit_buckets_download_drain_bytes_per_minute: 5242880 # 5mb default
  660. # The number of bytes a requester can go over the capacity, once. This is used to give some
  661. # buffer to allow a single file to be downloaded when the caller is near the limit. This
  662. # should be set to either your max remote download size or 30% of the capacityBytes, whichever
  663. # is smaller.
  664. matrix_media_repo_rate_limit_buckets_download_overflow_limit_bytes: 104857600 # 100mb default (the same as the default remote download maxBytes)
  665. # Identicons are generated avatars for a given username. Some clients use these to give users a
  666. # default avatar after signing up. Identicons are not part of the official Matrix spec, therefore
  667. # this feature is completely optional.
  668. matrix_media_repo_identicons_enabled: true
  669. # The quarantine media settings.
  670. # If true, when a thumbnail of quarantined media is requested an image will be returned. If no
  671. # image is given in the thumbnailPath below then a generated image will be provided. This does
  672. # not affect regular downloads of files.
  673. matrix_media_repo_quarantine_replace_thumbnails: true
  674. # If true, when media which has been quarantined is requested an image will be returned. If
  675. # no image is given in the thumbnailPath below then a generated image will be provided. This
  676. # will replace media which is not an image (ie: quarantining a PDF will replace the PDF with
  677. # an image).
  678. matrix_media_repo_quarantine_replace_downloads: false
  679. # If provided, the given image will be returned as a thumbnail for media that is quarantined.
  680. matrix_media_repo_quarantine_thumbnail_path: ""
  681. # If true, administrators of the configured homeservers may quarantine media for their server
  682. # only. Global administrators can quarantine any media (local or remote) regardless of this
  683. # flag.
  684. matrix_media_repo_quarantine_allow_local_admins: true
  685. # The various timeouts that the media repo will use.
  686. # The maximum amount of time the media repo should spend trying to fetch a resource that is
  687. # being previewed.
  688. matrix_media_repo_timeouts_url_preview_timeout_seconds: 10
  689. # The maximum amount of time the media repo will spend making remote requests to other repos
  690. # or homeservers. This is primarily used to download media.
  691. matrix_media_repo_timeouts_federation_timeout_seconds: 120
  692. # The maximum amount of time the media repo will spend talking to your configured homeservers.
  693. # This is usually used to verify a user's identity.
  694. matrix_media_repo_timeouts_client_server_timeout_seconds: 30
  695. # Prometheus metrics configuration
  696. # For an example Grafana dashboard, import the following JSON:
  697. # https://github.com/turt2live/matrix-media-repo/blob/master/docs/grafana.json
  698. # If true, the bindAddress and port below will serve GET /metrics for Prometheus to scrape.
  699. matrix_media_repo_metrics_enabled: false
  700. # The address to listen on. Typically "127.0.0.1" or "0.0.0.0" for all interfaces.
  701. matrix_media_repo_metrics_bind_address: "0.0.0.0"
  702. # The port to listen on. Cannot be the same as the general web server port.
  703. matrix_media_repo_metrics_port: 9000
  704. # Plugins are optional pieces of the media repo used to extend the functionality offered.
  705. # Currently there are only antispam plugins, but in future there should be more options.
  706. # Plugins are not supported on per-domain paths and are instead repo-wide. For more
  707. # information on writing plugins, please visit #matrix-media-repo:t2bot.io on Matrix.
  708. matrix_media_repo_plugins:
  709. plugins: []
  710. # An example OCR plugin to block images with certain text. Note that the Docker image
  711. # for the media repo automatically ships this at /plugins/plugin_antispam_ocr
  712. # - exec: /plugins/plugin_antispam_ocr
  713. # config:
  714. # # The URL to your OCR server (https://github.com/otiai10/ocrserver)
  715. # ocrServer: "http://localhost:8080"
  716. # # The keywords to scan for. The image must contain at least one of the keywords
  717. # # from each list to qualify for spam.
  718. # keywordGroups:
  719. # - - elon
  720. # - musk
  721. # - elonmusk
  722. # - - bitcoin
  723. # # The minimum (and maximum) sizes of images to process.
  724. # minSizeBytes: 20000
  725. # maxSizeBytes: 200000
  726. # # The types of files to process
  727. # types: ["image/png", "image/jpeg", "image/jpg"]
  728. # # The user ID regex to check against
  729. # userIds: "@telegram_.*"
  730. # # How much of the image's height, starting from the top, to consider before
  731. # # discarding the rest. Set to 1.0 to consider the whole image.
  732. # percentageOfHeight: 0.35
  733. # Options for controlling various MSCs/unstable features of the media repo
  734. # Sections of this config might disappear or be added over time. By default all
  735. # features are disabled in here and must be explicitly enabled to be used.
  736. # featureSupport:
  737. # No unstable features are currently supported.
  738. # Support for redis as a cache mechanism
  739. #
  740. # Note: Enabling Redis support will mean that the existing cache mechanism will do nothing.
  741. # It can be safely disabled once Redis support is enabled.
  742. #
  743. # See docs/redis.md for more information on how this works and how to set it up.
  744. # Whether or not use Redis instead of in-process caching.
  745. matrix_media_repo_redis_enabled: false
  746. # The database number to use. Leave at zero if using a dedicated Redis instance.
  747. matrix_media_repo_redis_database_number: 0
  748. # The Redis shards that should be used by the media repo in the ring. The names of the
  749. # shards are for your reference and have no bearing on the connection, but must be unique.
  750. matrix_media_repo_redis_shards: []
  751. # Optional sentry (https://sentry.io/) configuration for the media repo
  752. # Whether or not to set up error reporting. Defaults to off.
  753. matrix_media_repo_sentry_enabled: false
  754. # Get this value from the setup instructions in Sentry
  755. matrix_media_repo_sentry_dsn: "https://examplePublicKey@ingest.sentry.io/0"
  756. # Optional environment flag. Defaults to an empty string.
  757. matrix_media_repo_sentry_environment: ""
  758. # Whether or not to turn on sentry's built in debugging. This will increase log output.
  759. matrix_media_repo_sentry_debug: false
  760. # Configuration for the internal tasks engine in the media repo. Note that this only applies
  761. # to the media repo process with machine ID zero (the default in single-instance mode).
  762. #
  763. # Tasks include things like data imports/exports.
  764. # The number of workers to have available for tasks. Defaults to 5.
  765. matrix_media_repo_tasks_num_workers: 5
  766. # Options for collecting PGO-compatible CPU profiles and submitting them to a hosted pgo-fleet
  767. # server. See https://github.com/t2bot/pgo-fleet for collection/more detail.
  768. #
  769. # If you process more than 1Hz of requests or have more than a dozen media repos deployed, please
  770. # get in contact with `@travis:t2l.io` to submit profiles directly to MMR. Submitted profiles are
  771. # used to improve the build speed for everyone.
  772. # Whether collection is enabled. Defaults to false.
  773. matrix_media_repo_pgo_enabled: false
  774. # The pgo-fleet submit URL.
  775. matrix_media_repo_pgo_submit_url: "https://pgo-mmr.t2host.io/v1/submit"
  776. # The pgo-fleet submit key.
  777. matrix_media_repo_pgo_submit_key: "INSERT_VALUE_HERE"
  778. # Specifies whether the homeserver supports federation
  779. matrix_media_repo_homeserver_federation_enabled: true