Matrix Docker Ansible eploy
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

732 行
36 KiB

  1. ---
  2. # matrix-media-repo is a highly customizable multi-domain media repository for Matrix.
  3. # Intended for medium to large environments consisting of several homeservers, this
  4. # media repo de-duplicates media (including remote media) while being fully compliant
  5. # with the specification.
  6. # See: https://github.com/turt2live/matrix-media-repo
  7. matrix_media_repo_enabled: false
  8. # matrix_media_repo_identifier controls the identifier of this media-repo instance, which influences:
  9. # - the default storage path
  10. # - the names of systemd services
  11. matrix_media_repo_identifier: matrix-media-repo
  12. matrix_media_repo_container_image_self_build: false
  13. matrix_media_repo_container_image_self_build_repo: "https://github.com/turt2live/matrix-media-repo.git"
  14. matrix_media_repo_docker_image_path: "turt2live/matrix-media-repo"
  15. matrix_media_repo_docker_image: "{{ matrix_media_repo_docker_image_name_prefix }}{{ matrix_media_repo_docker_image_path }}:{{ matrix_media_repo_docker_image_tag }}"
  16. matrix_media_repo_docker_image_name_prefix: "{{ 'localhost/' if matrix_media_repo_container_image_self_build else matrix_container_global_registry_prefix }}"
  17. # renovate: datasource=docker depName=turt2live/matrix-media-repo
  18. matrix_media_repo_docker_image_tag: "v1.3.3"
  19. matrix_media_repo_docker_image_force_pull: "{{ matrix_media_repo_docker_image.endswith(':latest') }}"
  20. matrix_media_repo_base_path: "{{ matrix_base_data_path }}/{{ matrix_media_repo_identifier }}"
  21. matrix_media_repo_config_path: "{{ matrix_media_repo_base_path }}/config"
  22. matrix_media_repo_data_path: "{{ matrix_media_repo_base_path }}/data"
  23. matrix_media_repo_docker_src_files_path: "{{ matrix_media_repo_base_path }}/docker-src"
  24. # List of systemd services that matrix-conduit.service depends on
  25. matrix_media_repo_systemd_required_services_list: ["docker.service"]
  26. # List of systemd services that matrix-conduit.service wants
  27. matrix_media_repo_systemd_wanted_services_list: []
  28. # The base container network. It will be auto-created by this role if it doesn't exist already.
  29. matrix_media_repo_container_network: "{{ matrix_docker_network }}"
  30. # A list of additional container networks that the container would be connected to.
  31. # The role does not create these networks, so make sure they already exist.
  32. # Use this to expose this container to another reverse proxy, which runs in a different container network.
  33. matrix_media_repo_container_additional_networks: []
  34. # Controls whether the matrix-media-repo container exposes its HTTP port (tcp/8000 in the container).
  35. #
  36. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8000"), or empty string to not expose.
  37. matrix_media_repo_container_http_host_bind_port: ""
  38. # Controls whether the matrix-media-repo container exposes its metrics port (tcp/9000 in the container).
  39. #
  40. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:9000"), or empty string to not expose.
  41. matrix_media_repo_container_metrics_host_bind_port: ""
  42. # Extra arguments for the Docker container
  43. matrix_media_repo_container_extra_arguments: []
  44. # matrix_media_repo_dashboard_urls contains a list of URLs with Grafana dashboard definitions.
  45. # If the Grafana role is enabled, these dashboards will be downloaded.
  46. matrix_media_repo_dashboard_urls:
  47. - https://raw.githubusercontent.com/spantaleev/matrix-docker-ansible-deploy/master/roles/custom/matrix-media-repo/templates/grafana/media-repo.json
  48. # *****************************************************************************
  49. # Configuration File Settings
  50. # *****************************************************************************
  51. # General repo configuration
  52. matrix_media_repo_bind_address: '0.0.0.0'
  53. matrix_media_repo_port: 8000
  54. # Where to store the logs, relative to where the repo is started from. Logs will be automatically
  55. # rotated every day and held for 14 days. To disable the repo logging to files, set this to
  56. # "-" (including quotation marks).
  57. #
  58. # Note: to change the log directory you'll have to restart the repository. This setting cannot be
  59. # live reloaded.
  60. matrix_media_repo_log_directory: "-"
  61. # Set to true to enable color coding in your logs. Note that this may cause escape sequences to
  62. # appear in logs which render them unreadable, which is why colors are disabled by default.
  63. matrix_media_repo_log_colors: false
  64. # Set to true to enable JSON logging for consumption by things like logstash. Note that this is
  65. # incompatible with the log color option and will always render without colors.
  66. matrix_media_repo_json_logs: false
  67. # The log level to log at. Note that this will need to be at least "info" to receive support.
  68. #
  69. # Values (in increasing spam): panic | fatal | error | warn | info | debug | trace
  70. matrix_media_repo_log_level: "info"
  71. # If true, the media repo will accept any X-Forwarded-For header without validation. In most cases
  72. # this option should be left as "false". Note that the media repo already expects an X-Forwarded-For
  73. # header, but validates it to ensure the IP being given makes sense.
  74. matrix_media_repo_trust_any_forwarded_address: false
  75. # If false, the media repo will not use the X-Forwarded-Host header commonly added by reverse proxies.
  76. # Typically this should remain as true, though in some circumstances it may need to be disabled.
  77. # See https://github.com/turt2live/matrix-media-repo/issues/202 for more information.
  78. matrix_media_repo_use_forwarded_host: true
  79. # Options for dealing with federation
  80. # On a per-host basis, the number of consecutive failures in calling the host before the
  81. # media repo will back off. This defaults to 20 if not given. Note that 404 errors from
  82. # the remote server do not count towards this.
  83. matrix_media_repo_federation_backoff_at: 20
  84. # The domains the media repo should never serve media for. Existing media already stored from
  85. # these domains will remain, however will not be downloadable without a data export. Media
  86. # repo administrators will bypass this check. Admin APIs will still work for media on these
  87. # domains.
  88. #
  89. # This will not prevent the listed domains from accessing media on this media repo - it only
  90. # stops users on *this* media repo from accessing media originally uploaded to the listed domains.
  91. #
  92. # Note: Adding domains controlled by the media repo itself to this list is not advisable.
  93. # matrix_media_repo_federation_ignored_hosts: [
  94. # "example.org"
  95. # ]
  96. matrix_media_repo_federation_ignored_hosts: []
  97. # The database configuration for the media repository
  98. # Do NOT put your homeserver's existing database credentials here. Create a new database and
  99. # user instead. Using the same server is fine, just not the same username and database.
  100. matrix_media_repo_database_username: "matrix_media_repo"
  101. matrix_media_repo_database_password: "your_password"
  102. matrix_media_repo_database_hostname: "{{ devture_postgres_identifier }}"
  103. matrix_media_repo_database_port: 5432
  104. matrix_media_repo_database_name: "matrix_media_repo"
  105. matrix_media_repo_database_sslmode: disable
  106. # Currently only "postgres" is supported.
  107. 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 }}"
  108. # The database pooling options
  109. # The maximum number of connects to hold open. More of these allow for more concurrent
  110. # processes to happen.
  111. matrix_media_repo_database_max_connections: 25
  112. # The maximum number of connects to leave idle. More of these reduces the time it takes
  113. # to serve requests in low-traffic scenarios.
  114. matrix_media_repo_database_max_idle_connections: 5
  115. # The configuration for the homeservers this media repository is known to control. Servers
  116. # not listed here will not be able to upload media.
  117. matrix_media_repo_homeservers: "{{ matrix_media_repo_homeservers_auto + matrix_media_repo_homeservers_additional }}"
  118. # Auto configured server setup by the playbook
  119. matrix_media_repo_homeservers_auto:
  120. - # Keep the dash from this line.
  121. # This should match the server_name of your homeserver, and the Host header
  122. # provided to the media repo.
  123. name: "{{ matrix_server_fqn_matrix }}"
  124. # The base URL to where the homeserver can actually be reached by MMR.
  125. csApi: "http://{{ matrix_nginx_proxy_proxy_matrix_client_api_addr_with_container }}"
  126. # The number of consecutive failures in calling this homeserver before the
  127. # media repository will start backing off. This defaults to 10 if not given.
  128. backoffAt: 10
  129. # The admin API interface supported by the homeserver. MMR uses a subset of the admin API
  130. # during certain operations, like attempting to purge media from a room or validating server
  131. # admin status. This should be set to one of "synapse", "dendrite", or "matrix". When set
  132. # to "matrix", most functionality requiring the admin API will not work.
  133. adminApiKind: "{{ 'synapse' if matrix_homeserver_implementation == 'synapse' else ('dendrite' if matrix_homeserver_implementation == 'dendrite' else 'matrix') }}"
  134. # Additional servers to be managed by MMR
  135. matrix_media_repo_homeservers_additional: []
  136. # Options for controlling how access tokens work with the media repo. It is recommended that if
  137. # you are going to use these options that the `/logout` and `/logout/all` client-server endpoints
  138. # be proxied through this process. They will also be called on the homeserver, and the response
  139. # sent straight through the client - they are simply used to invalidate the cache faster for
  140. # a particular user. Without these, the access tokens might still work for a short period of time
  141. # after the user has already invalidated them.
  142. #
  143. # This will also cache errors from the homeserver.
  144. #
  145. # Note that when this config block is used outside of a per-domain config, all hosts will be
  146. # subject to the same cache. This also means that application services on limited homeservers
  147. # could be authorized on the wrong domain.
  148. #
  149. # ***************************************************************************
  150. # * IT IS HIGHLY RECOMMENDED TO USE PER-DOMAIN CONFIGS WITH THIS FEATURE. *
  151. # ***************************************************************************
  152. # The maximum time a cached access token will be considered valid. Set to zero (the default)
  153. # to disable the cache and constantly hit the homeserver. This is recommended to be set to
  154. # 43200 (12 hours) on servers with the logout endpoints proxied through the media repo, and
  155. # zero for servers who do not proxy the endpoints through.
  156. matrix_media_repo_access_tokens_max_cache_time_seconds: 43200
  157. # Whether or not to use the `appservices` config option below. If disabled (the default),
  158. # the regular access token cache will be used for each user, potentially leading to high
  159. # memory usage.
  160. matrix_media_repo_access_tokens_use_local_appservice_config: false
  161. # The application services (and their namespaces) registered on the homeserver. Only used
  162. # if `useLocalAppserviceConfig` is enabled (recommended).
  163. #
  164. # Usually the appservice will provide you with these config details - they'll just need
  165. # translating from the appservice registration to here. Note that this does not require
  166. # all options from the registration, and only requires the bare minimum required to run
  167. # the media repo.
  168. # matrix_media_repo_access_tokens_appservices: [
  169. # {
  170. # id: "Name_of_appservice_for_your_reference",
  171. # asToken: "Secret_token_for_appservices_to_use",
  172. # senderUserId: "@_example_bridge:yourdomain.com",
  173. # userNamespaces: [
  174. # regex: "@_example_bridge_.+:yourdomain.com"
  175. # # A note about regexes: it is best to suffix *all* namespaces with the homeserver
  176. # # domain users are valid for, as otherwise the appservice can use any user with
  177. # # any domain name it feels like, even if that domain is not configured with the
  178. # # media repo. This will lead to inaccurate reporting in the case of the media
  179. # # repo, and potentially leading to media being considered "remote".
  180. # ]
  181. # }
  182. # ]
  183. matrix_media_repo_access_tokens_appservices: []
  184. # These users have full access to the administrative functions of the media repository.
  185. # See docs/admin.md for information on what these people can do. They must belong to one of the
  186. # configured homeservers above.
  187. # matrix_media_repo_admins: [
  188. # "@your_username:example.org"
  189. # ]
  190. matrix_media_repo_admins: []
  191. # Shared secret auth is useful for applications building on top of the media repository, such
  192. # as a management interface. The `token` provided here is treated as a repository administrator
  193. # when shared secret auth is enabled: if the `token` is used in place of an access token, the'
  194. # request will be authorized. This is not limited to any particular domain, giving applications
  195. # the ability to use it on any configured hostname.
  196. # Set this to true to enable shared secret auth.
  197. matrix_media_repo_shared_secret_auth_enabled: false
  198. # Use a secure value here to prevent unauthorized access to the media repository.
  199. matrix_media_repo_shared_secret_auth_token: "PutSomeRandomSecureValueHere"
  200. # Datastores are places where media should be persisted. This isn't dedicated for just uploads:
  201. # thumbnails and other misc data is also stored in these places. The media repo, when looking
  202. # for a datastore to use, will always use the smallest datastore first.
  203. # ID for the file datastore (cannot change). Alphanumeric recommended.
  204. matrix_media_repo_datastore_file_id: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'filestore.db', rounds=655555) | to_uuid }}"
  205. # Datastores can be split into many areas when handling uploads. Media is still de-duplicated
  206. # across all datastores (local content which duplicates remote content will re-use the remote
  207. # content's location). This option is useful if your datastore is becoming very large, or if
  208. # you want faster storage for a particular kind of media.
  209. #
  210. # To disable this datastore, making it readonly, specify `forKinds: []`.
  211. #
  212. # The kinds available are:
  213. # thumbnails - Used to store thumbnails of media (local and remote).
  214. # remote_media - Original copies of remote media (servers not configured by this repo).
  215. # local_media - Original uploads for local media.
  216. # archives - Archives of content (GDPR and similar requests).
  217. matrix_media_repo_datastore_file_for_kinds: ["thumbnails", "remote_media", "local_media", "archives"]
  218. # Path to datastore, relative to matrix-media-repo directory root
  219. matrix_media_repo_datastore_opts_path: "/data/media"
  220. # ID for the s3 datastore (cannot change). Alphanumeric recommended.
  221. matrix_media_repo_datastore_s3_id: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 's3store.db', rounds=655555) | to_uuid }}"
  222. # Datastores can be split into many areas when handling uploads. Media is still de-duplicated
  223. # across all datastores (local content which duplicates remote content will re-use the remote
  224. # content's location). This option is useful if your datastore is becoming very large, or if
  225. # you want faster storage for a particular kind of media.
  226. #
  227. # To disable this datastore, making it readonly, specify `forKinds: []`.
  228. #
  229. # The kinds available are:
  230. # thumbnails - Used to store thumbnails of media (local and remote).
  231. # remote_media - Original copies of remote media (servers not configured by this repo).
  232. # local_media - Original uploads for local media.
  233. # archives - Archives of content (GDPR and similar requests).
  234. matrix_media_repo_datastore_s3_for_kinds: []
  235. # The s3 uploader needs a temporary location to buffer files to reduce memory usage on
  236. # small file uploads. If the file size is unknown, the file is written to this location
  237. # before being uploaded to s3 (then the file is deleted). If you aren't concerned about
  238. # memory usage, set this to an empty string.
  239. matrix_media_repo_datastore_s3_opts_temp_path: "/tmp/mediarepo_s3_upload"
  240. matrix_media_repo_datastore_s3_opts_endpoint: "sfo2.digitaloceanspaces.com"
  241. matrix_media_repo_datastore_s3_opts_access_key_id: ""
  242. matrix_media_repo_datastore_s3_opts_access_secret: ""
  243. matrix_media_repo_datastore_s3_opts_ssl: true
  244. matrix_media_repo_datastore_s3_opts_bucket_name: "your-media-bucket"
  245. # An optional region for where this S3 endpoint is located. Typically not needed, though
  246. # some providers will need this (like Scaleway). Uncomment to use.
  247. # matrix_media_repo_datastore_s3_opts_region: "sfo2"
  248. # An optional storage class for tuning how the media is stored at s3.
  249. # See https://aws.amazon.com/s3/storage-classes/ for details; uncomment to use.
  250. # matrix_media_repo_datastore_s3_opts_storage_class: "STANDARD"
  251. # Options for controlling archives. Archives are exports of a particular user's content for
  252. # the purpose of GDPR or moving media to a different server.
  253. # Whether archiving is enabled or not. Default enabled.
  254. matrix_media_repo_archiving_enabled: true
  255. # If true, users can request a copy of their own data. By default, only repository administrators
  256. # can request a copy.
  257. # This includes the ability for homeserver admins to request a copy of their own server's
  258. # data, as known to the repo.
  259. matrix_media_repo_archiving_self_service: false
  260. # The number of bytes to target per archive before breaking up the files. This is independent
  261. # of any file upload limits and will require a similar amount of memory when performing an export.
  262. # The file size is also a target, not a guarantee - it is possible to have files that are smaller
  263. # or larger than the target. This is recommended to be approximately double the size of your
  264. # file upload limit, provided there is enough memory available for the demand of exporting.
  265. matrix_media_repo_archiving_target_bytes_per_part: 209715200 # 200mb default
  266. # The file upload settings for the media repository
  267. # The maximum individual file size a user can upload.
  268. matrix_media_repo_max_bytes: 104857600 # 100MB default, 0 to disable
  269. # The minimum number of bytes to let people upload. This is recommended to be non-zero to
  270. # ensure that the "cost" of running the media repo is worthwhile - small file uploads tend
  271. # to waste more CPU and database resources than small files, thus a default of 100 bytes
  272. # is applied here as an approximate break-even point.
  273. matrix_media_repo_min_bytes: 100 # 100 bytes by default
  274. # The number of bytes to claim as the maximum size for uploads for the limits API. If this
  275. # is not provided then the maxBytes setting will be used instead. This is useful to provide
  276. # if the media repo's settings and the reverse proxy do not match for maximum request size.
  277. # This is purely for informational reasons and does not actually limit any functionality.
  278. # Set this to -1 to indicate that there is no limit. Zero will force the use of maxBytes.
  279. matrix_media_repo_reported_max_bytes: 0
  280. # The number of pending uploads a user is permitted to have at a given time. They must cancel,
  281. # complete, or otherwise let pending requests expire before uploading any more media. Set to
  282. # zero to disable.
  283. matrix_media_repo_max_pending: 5
  284. # The duration the server will wait to receive media that was asynchronously uploaded before
  285. # expiring it entirely. This should be set sufficiently high for a client on poor connectivity
  286. # to upload something. The Matrix specification recommends 24 hours (86400 seconds), however
  287. # this project recommends 30 minutes (1800 seconds).
  288. matrix_media_repo_max_age_seconds: 1800
  289. # Options for limiting how much content a user can upload. Quotas are applied to content
  290. # associated with a user regardless of de-duplication. Quotas which affect remote servers
  291. # or users will not take effect. When a user exceeds their quota they will be unable to
  292. # upload any more media.
  293. # Whether quotas are enabled/enforced. Note that even when disabled the media repo will
  294. # track how much media a user has uploaded. Quotas are disabled by default.
  295. matrix_media_repo_quotas_enabled: false
  296. # The upload quota rules which affect users. The first rule to match the user ID will take
  297. # effect. If a user does not match a rule, the defaults implied by the above config will
  298. # take effect instead. The user will not be permitted to upload anything above these quota
  299. # values, but can match them exactly.
  300. matrix_media_repo_quotas_users: "{{ matrix_media_repo_quotas_users_auto + matrix_media_repo_quotas_users_additional }}"
  301. matrix_media_repo_quotas_users_auto:
  302. - glob: "@*:*" # Affect all users. Use asterisks (*) to match any character.
  303. # The maximum number of TOTAL bytes a user can upload. Defaults to zero (no limit).
  304. maxBytes: 53687063712 # 50gb
  305. # The same as maxPending above - the number of uploads the user can have waiting to
  306. # complete before starting another one. Defaults to maxPending above. Set to 0 to
  307. # disable.
  308. maxPending: 5
  309. # The maximum number of uploaded files a user can have. Defaults to zero (no limit).
  310. # If both maxBytes and maxFiles are in use then the first condition a user triggers
  311. # will prevent upload. Note that a user can still have uploads contributing to maxPending,
  312. # but will not be able to complete them if they are at maxFiles.
  313. maxFiles: 0
  314. # Additional quota glob patterns
  315. matrix_media_repo_quotas_users_additional: []
  316. # Settings related to downloading files from the media repository
  317. # The maximum number of bytes to download from other servers
  318. matrix_media_repo_downloads_max_bytes: 104857600 # 100MB default, 0 to disable
  319. # The number of workers to use when downloading remote media. Raise this number if remote
  320. # media is downloading slowly or timing out.
  321. #
  322. # Maximum memory usage = numWorkers multiplied by the maximum download size
  323. # Average memory usage is dependent on how many concurrent downloads your users are doing.
  324. matrix_media_repo_downloads_num_workers: 10
  325. # How long, in minutes, to cache errors related to downloading remote media. Once this time
  326. # has passed, the media is able to be re-requested.
  327. matrix_media_repo_downloads_failure_cache_minutes: 5
  328. # How many days after a piece of remote content is downloaded before it expires. It can be
  329. # re-downloaded on demand, this just helps free up space in your datastore. Set to zero or
  330. # negative to disable. Defaults to disabled.
  331. matrix_media_repo_downloads_expire_after_days: 0
  332. # The default size, in bytes, to return for range requests on media. Range requests are used
  333. # by clients when they only need part of a file, such as a video or audio element. Note that
  334. # the entire file will still be cached (if enabled), but only part of it will be returned.
  335. # If the client requests a larger or smaller range, that will be honoured.
  336. matrix_media_repo_downloads_default_range_chunk_size_bytes: 10485760 # 10MB default
  337. # URL Preview settings
  338. # If enabled, the preview_url routes will be accessible
  339. matrix_media_repo_url_previews_enabled: true
  340. # 10MB default, 0 to disable
  341. matrix_media_repo_url_previews_max_page_size_bytes: 10485760
  342. # If true, the media repository will try to provide previews for URLs with invalid or unsafe
  343. # certificates. If false (the default), the media repo will fail requests to said URLs.
  344. matrix_media_repo_url_previews_preview_unsafe_certificates: false
  345. # Note: URL previews are limited to a given number of words, which are then limited to a number
  346. # of characters, taking off the last word if it needs to. This also applies for the title.
  347. # The number of words to include in a preview (maximum)
  348. matrix_media_repo_url_previews_num_words: 50
  349. # The maximum number of characters for a description
  350. matrix_media_repo_url_previews_max_length: 200
  351. # The maximum number of words to include in a preview's title
  352. matrix_media_repo_url_previews_num_title_words: 30
  353. # The maximum number of characters for a title
  354. matrix_media_repo_url_previews_max_title_length: 150
  355. # The mime types to preview when OpenGraph previews cannot be rendered. OpenGraph previews are
  356. # calculated on anything matching "text/*". To have a thumbnail in the preview the URL must be
  357. # an image and the image's type must be allowed by the thumbnailer.
  358. matrix_media_repo_url_previews_file_preview_types:
  359. - "image/*"
  360. # The number of workers to use when generating url previews. Raise this number if url
  361. # previews are slow or timing out.
  362. #
  363. # Maximum memory usage = numWorkers multiplied by the maximum page size
  364. # Average memory usage is dependent on how many concurrent urls your users are previewing.
  365. matrix_media_repo_url_previews_num_workers: 10
  366. # Either allowedNetworks or disallowedNetworks must be provided. If both are provided, they
  367. # will be merged. URL previews will be disabled if neither is supplied. Each entry must be
  368. # a CIDR range.
  369. matrix_media_repo_url_previews_disallowed_networks:
  370. - "127.0.0.1/8"
  371. - "10.0.0.0/8"
  372. - "172.16.0.0/12"
  373. - "192.168.0.0/16"
  374. - "100.64.0.0/10"
  375. - "169.254.0.0/16"
  376. - '::1/128'
  377. - 'fe80::/64'
  378. - 'fc00::/7'
  379. matrix_media_repo_url_previews_allowed_networks:
  380. # "Everything". The blacklist will help limit this.
  381. # This is the default value for this field.
  382. - "0.0.0.0/0"
  383. # How many days after a preview is generated before it expires and is deleted. The preview
  384. # can be regenerated safely - this just helps free up some space in your database. Set to
  385. # zero or negative to disable. Defaults to disabled.
  386. matrix_media_repo_url_previews_expire_after_days: 0
  387. # The default Accept-Language header to supply when generating URL previews when one isn't
  388. # supplied by the client.
  389. # Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language
  390. matrix_media_repo_url_previews_default_language: "en-US,en"
  391. # Set the User-Agent header to supply when generating URL previews
  392. matrix_media_repo_url_previews_user_agent: "matrix-media-repo"
  393. # When true, oEmbed previews will be enabled. Typically these kinds of previews are used for
  394. # sites that do not support OpenGraph or page scraping, such as Twitter. For information on
  395. # specifying providers for oEmbed, including your own, see the following documentation:
  396. # https://docs.t2bot.io/matrix-media-repo/url-previews/oembed.html
  397. # Defaults to disabled.
  398. matrix_media_repo_url_previews_o_embed: false
  399. # The thumbnail configuration for the media repository.
  400. # The maximum number of bytes an image can be before the thumbnailer refuses.
  401. matrix_media_repo_thumbnails_max_source_bytes: 10485760 # 10MB default, 0 to disable
  402. # The maximum number of pixels an image can have before the thumbnailer refuses. Note that
  403. # this only applies to image types: file types like audio and video are affected solely by
  404. # the maxSourceBytes.
  405. matrix_media_repo_thumbnails_max_pixels: 32000000 # 32M default
  406. # The number of workers to use when generating thumbnails. Raise this number if thumbnails
  407. # are slow to generate or timing out.
  408. #
  409. # Maximum memory usage = numWorkers multiplied by the maximum image source size
  410. # Average memory usage is dependent on how many thumbnails are being generated by your users
  411. matrix_media_repo_thumbnails_num_workers: 100
  412. # All thumbnails are generated into one of the sizes listed here. The first size is used as
  413. # the default for when no width or height is requested. The media repository will return
  414. # either an exact match or the next largest size of thumbnail.
  415. matrix_media_repo_thumbnails_sizes:
  416. - width: 32
  417. height: 32
  418. - width: 96
  419. height: 96
  420. - width: 320
  421. height: 240
  422. - width: 640
  423. height: 480
  424. - width: 768 # This size is primarily used for audio thumbnailing.
  425. height: 240
  426. - width: 800
  427. height: 600
  428. # To allow for thumbnails to be any size, not just in the sizes specified above, set this to
  429. # true (default false). When enabled, whatever size requested by the client will be generated
  430. # up to a maximum of the largest possible dimensions in the `sizes` list. For best results,
  431. # specify only one size in the `sizes` list when this option is enabled.
  432. matrix_media_repo_thumbnails_dynamic_sizing: false
  433. # The content types to thumbnail when requested. Types that are not supported by the media repo
  434. # will not be thumbnailed (adding application/json here won't work). Clients may still not request
  435. # thumbnails for these types - this won't make clients automatically thumbnail these file types.
  436. matrix_media_repo_thumbnails_types:
  437. - "image/jpeg"
  438. - "image/jpg"
  439. - "image/png"
  440. - "image/apng"
  441. - "image/gif"
  442. - "image/heif"
  443. - "image/heic"
  444. - "image/webp"
  445. - "image/bmp"
  446. - "image/tiff"
  447. # - "image/svg+xml" # Be sure to have ImageMagick installed to thumbnail SVG files
  448. - "audio/mpeg"
  449. - "audio/ogg"
  450. - "audio/wav"
  451. - "audio/flac"
  452. # - "video/mp4" # Be sure to have ffmpeg installed to thumbnail video files
  453. # Animated thumbnails can be CPU intensive to generate. To disable the generation of animated
  454. # thumbnails, set this to false. If disabled, regular thumbnails will be returned.
  455. matrix_media_repo_thumbnails_allow_animated: true
  456. # Default to animated thumbnails, if available
  457. matrix_media_repo_thumbnails_default_animated: false
  458. # The maximum file size to thumbnail when a capable animated thumbnail is requested. If the image
  459. # is larger than this, the thumbnail will be generated as a static image.
  460. matrix_media_repo_thumbnails_max_animate_size_bytes: 10485760 # 10MB default, 0 to disable
  461. # On a scale of 0 (start of animation) to 1 (end of animation), where should the thumbnailer try
  462. # and thumbnail animated content? Defaults to 0.5 (middle of animation).
  463. matrix_media_repo_thumbnails_still_frame: 0.5
  464. # How many days after a thumbnail is generated before it expires and is deleted. The thumbnail
  465. # can be regenerated safely - this just helps free up some space in your datastores. Set to
  466. # zero or negative to disable. Defaults to disabled.
  467. matrix_media_repo_thumbnails_expire_after_days: 0
  468. # Controls for the rate limit functionality
  469. # Set this to false if rate limiting is handled at a higher level or you don't want it enabled.
  470. matrix_media_repo_rate_limit_enabled: true
  471. # The number of requests per second before an IP will be rate limited. Must be a whole number.
  472. matrix_media_repo_rate_limit_requests_per_second: 1
  473. # The number of requests an IP can send at once before the rate limit is actually considered.
  474. matrix_media_repo_rate_limit_burst: 10
  475. # Identicons are generated avatars for a given username. Some clients use these to give users a
  476. # default avatar after signing up. Identicons are not part of the official matrix spec, therefore
  477. # this feature is completely optional.
  478. matrix_media_repo_identicons_enabled: true
  479. # The quarantine media settings.
  480. # If true, when a thumbnail of quarantined media is requested an image will be returned. If no
  481. # image is given in the thumbnailPath below then a generated image will be provided. This does
  482. # not affect regular downloads of files.
  483. matrix_media_repo_quarantine_replace_thumbnails: true
  484. # If true, when media which has been quarantined is requested an image will be returned. If
  485. # no image is given in the thumbnailPath below then a generated image will be provided. This
  486. # will replace media which is not an image (ie: quarantining a PDF will replace the PDF with
  487. # an image).
  488. matrix_media_repo_quarantine_replace_downloads: false
  489. # If provided, the given image will be returned as a thumbnail for media that is quarantined.
  490. matrix_media_repo_quarantine_thumbnail_path: ""
  491. # If true, administrators of the configured homeservers may quarantine media for their server
  492. # only. Global administrators can quarantine any media (local or remote) regardless of this
  493. # flag.
  494. matrix_media_repo_quarantine_allow_local_admins: true
  495. # The various timeouts that the media repo will use.
  496. # The maximum amount of time the media repo should spend trying to fetch a resource that is
  497. # being previewed.
  498. matrix_media_repo_timeouts_url_preview_timeout_seconds: 10
  499. # The maximum amount of time the media repo will spend making remote requests to other repos
  500. # or homeservers. This is primarily used to download media.
  501. matrix_media_repo_timeouts_federation_timeout_seconds: 120
  502. # The maximum amount of time the media repo will spend talking to your configured homeservers.
  503. # This is usually used to verify a user's identity.
  504. matrix_media_repo_timeouts_client_server_timeout_seconds: 30
  505. # Prometheus metrics configuration
  506. # For an example Grafana dashboard, import the following JSON:
  507. # https://github.com/turt2live/matrix-media-repo/blob/master/docs/grafana.json
  508. # If true, the bindAddress and port below will serve GET /metrics for Prometheus to scrape.
  509. matrix_media_repo_metrics_enabled: false
  510. # The address to listen on. Typically "127.0.0.1" or "0.0.0.0" for all interfaces.
  511. matrix_media_repo_metrics_bind_address: "0.0.0.0"
  512. # The port to listen on. Cannot be the same as the general web server port.
  513. matrix_media_repo_metrics_port: 9000
  514. # Plugins are optional pieces of the media repo used to extend the functionality offered.
  515. # Currently there are only antispam plugins, but in future there should be more options.
  516. # Plugins are not supported on per-domain paths and are instead repo-wide. For more
  517. # information on writing plugins, please visit #matrix-media-repo:t2bot.io on Matrix.
  518. matrix_media_repo_plugins:
  519. plugins: []
  520. # An example OCR plugin to block images with certain text. Note that the Docker image
  521. # for the media repo automatically ships this at /plugins/plugin_antispam_ocr
  522. # - exec: /plugins/plugin_antispam_ocr
  523. # config:
  524. # # The URL to your OCR server (https://github.com/otiai10/ocrserver)
  525. # ocrServer: "http://localhost:8080"
  526. # # The keywords to scan for. The image must contain at least one of the keywords
  527. # # from each list to qualify for spam.
  528. # keywordGroups:
  529. # - - elon
  530. # - musk
  531. # - elonmusk
  532. # - - bitcoin
  533. # # The minimum (and maximum) sizes of images to process.
  534. # minSizeBytes: 20000
  535. # maxSizeBytes: 200000
  536. # # The types of files to process
  537. # types: ["image/png", "image/jpeg", "image/jpg"]
  538. # # The user ID regex to check against
  539. # userIds: "@telegram_.*"
  540. # # How much of the image's height, starting from the top, to consider before
  541. # # discarding the rest. Set to 1.0 to consider the whole image.
  542. # percentageOfHeight: 0.35
  543. # Options for controlling various MSCs/unstable features of the media repo
  544. # Sections of this config might disappear or be added over time. By default all
  545. # features are disabled in here and must be explicitly enabled to be used.
  546. # featureSupport:
  547. # No unstable features are currently supported.
  548. # Support for redis as a cache mechanism
  549. #
  550. # Note: Enabling Redis support will mean that the existing cache mechanism will do nothing.
  551. # It can be safely disabled once Redis support is enabled.
  552. #
  553. # See docs/redis.md for more information on how this works and how to set it up.
  554. # Whether or not use Redis instead of in-process caching.
  555. matrix_media_repo_redis_enabled: false
  556. # The database number to use. Leave at zero if using a dedicated Redis instance.
  557. matrix_media_repo_redis_database_number: 0
  558. # The Redis shards that should be used by the media repo in the ring. The names of the
  559. # shards are for your reference and have no bearing on the connection, but must be unique.
  560. matrix_media_repo_redis_shards:
  561. - name: "server1"
  562. addr: ":7000"
  563. - name: "server2"
  564. addr: ":7001"
  565. - name: "server3"
  566. addr: ":7002"
  567. # Optional sentry (https://sentry.io/) configuration for the media repo
  568. # Whether or not to set up error reporting. Defaults to off.
  569. matrix_media_repo_sentry_enabled: false
  570. # Get this value from the setup instructions in Sentry
  571. matrix_media_repo_sentry_dsn: "https://examplePublicKey@ingest.sentry.io/0"
  572. # Optional environment flag. Defaults to an empty string.
  573. matrix_media_repo_sentry_environment: ""
  574. # Whether or not to turn on sentry's built in debugging. This will increase log output.
  575. matrix_media_repo_sentry_debug: false
  576. # Configuration for the internal tasks engine in the media repo. Note that this only applies
  577. # to the media repo process with machine ID zero (the default in single-instance mode).
  578. #
  579. # Tasks include things like data imports/exports.
  580. # The number of workers to have available for tasks. Defaults to 5.
  581. matrix_media_repo_tasks_num_workers: 5
  582. # Options for collecting PGO-compatible CPU profiles and submitting them to a hosted pgo-fleet
  583. # server. See https://github.com/t2bot/pgo-fleet for collection/more detail.
  584. #
  585. # If you process more than 1Hz of requests or have more than a dozen media repos deployed, please
  586. # get in contact with `@travis:t2l.io` to submit profiles directly to MMR. Submitted profiles are
  587. # used to improve the build speed for everyone.
  588. # Whether collection is enabled. Defaults to false.
  589. matrix_media_repo_pgo_enabled: false
  590. # The pgo-fleet submit URL.
  591. matrix_media_repo_pgo_submit_url: "https://pgo-mmr.t2host.io/v1/submit"
  592. # The pgo-fleet submit key.
  593. matrix_media_repo_pgo_submit_key: "INSERT_VALUE_HERE"