Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 

673 строки
37 KiB

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