Matrix Docker Ansible eploy
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

701 wiersze
34 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.2.13"
  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 database configuration for the media repository
  85. # Do NOT put your homeserver's existing database credentials here. Create a new database and
  86. # user instead. Using the same server is fine, just not the same username and database.
  87. matrix_media_repo_database_username: "matrix_media_repo"
  88. matrix_media_repo_database_password: "your_password"
  89. matrix_media_repo_database_hostname: "{{ devture_postgres_identifier }}"
  90. matrix_media_repo_database_port: 5432
  91. matrix_media_repo_database_name: "matrix_media_repo"
  92. matrix_media_repo_database_sslmode: disable
  93. # Currently only "postgres" is supported.
  94. 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 }}"
  95. # The database pooling options
  96. # The maximum number of connects to hold open. More of these allow for more concurrent
  97. # processes to happen.
  98. matrix_media_repo_database_max_connections: 25
  99. # The maximum number of connects to leave idle. More of these reduces the time it takes
  100. # to serve requests in low-traffic scenarios.
  101. matrix_media_repo_database_max_idle_connections: 5
  102. # The configuration for the homeservers this media repository is known to control. Servers
  103. # not listed here will not be able to upload media.
  104. matrix_media_repo_homeservers:
  105. homeservers:
  106. # This should match the server_name of your homeserver, and the Host header
  107. # provided to the media repo.
  108. - name: "{{ matrix_server_fqn_matrix }}"
  109. # The base URL to where the homeserver can actually be reached
  110. csApi: "http://{{ matrix_nginx_proxy_proxy_matrix_client_api_addr_with_container }}"
  111. # The number of consecutive failures in calling this homeserver before the
  112. # media repository will start backing off. This defaults to 10 if not given.
  113. backoffAt: 10
  114. # The kind of admin API the homeserver supports. If set to "matrix",
  115. # the media repo will use the Synapse-defined endpoints under the
  116. # unstable client-server API. When this is "synapse", the new /_synapse
  117. # endpoints will be used instead. Unknown values are treated as the
  118. # default, "matrix".
  119. adminApiKind: "{{ 'synapse' if matrix_homeserver_implementation == 'synapse' else 'matrix' }}"
  120. # Options for controlling how access tokens work with the media repo. It is recommended that if
  121. # you are going to use these options that the `/logout` and `/logout/all` client-server endpoints
  122. # be proxied through this process. They will also be called on the homeserver, and the response
  123. # sent straight through the client - they are simply used to invalidate the cache faster for
  124. # a particular user. Without these, the access tokens might still work for a short period of time
  125. # after the user has already invalidated them.
  126. #
  127. # This will also cache errors from the homeserver.
  128. #
  129. # Note that when this config block is used outside of a per-domain config, all hosts will be
  130. # subject to the same cache. This also means that application services on limited homeservers
  131. # could be authorized on the wrong domain.
  132. #
  133. # ***************************************************************************
  134. # * IT IS HIGHLY RECOMMENDED TO USE PER-DOMAIN CONFIGS WITH THIS FEATURE. *
  135. # ***************************************************************************
  136. matrix_media_repo_access_tokens:
  137. accessTokens:
  138. # The maximum time a cached access token will be considered valid. Set to zero (the default)
  139. # to disable the cache and constantly hit the homeserver. This is recommended to be set to
  140. # 43200 (12 hours) on servers with the logout endpoints proxied through the media repo, and
  141. # zero for servers who do not proxy the endpoints through.
  142. maxCacheTimeSeconds: 43200
  143. # Whether or not to use the `appservices` config option below. If disabled (the default),
  144. # the regular access token cache will be used for each user, potentially leading to high
  145. # memory usage.
  146. useLocalAppserviceConfig: false
  147. # The application services (and their namespaces) registered on the homeserver. Only used
  148. # if `useLocalAppserviceConfig` is enabled (recommended).
  149. #
  150. # Usually the appservice will provide you with these config details - they'll just need
  151. # translating from the appservice registration to here. Note that this does not require
  152. # all options from the registration, and only requires the bare minimum required to run
  153. # the media repo.
  154. # appservices:
  155. # - id: Name_of_appservice_for_your_reference
  156. # asToken: Secret_token_for_appservices_to_use
  157. # senderUserId: "@_example_bridge:yourdomain.com"
  158. # userNamespaces:
  159. # - regex: "@_example_bridge_.+:yourdomain.com"
  160. # # A note about regexes: it is best to suffix *all* namespaces with the homeserver
  161. # # domain users are valid for, as otherwise the appservice can use any user with
  162. # # any domain name it feels like, even if that domain is not configured with the
  163. # # media repo. This will lead to inaccurate reporting in the case of the media
  164. # # repo, and potentially leading to media being considered "remote".
  165. # These users have full access to the administrative functions of the media repository.
  166. # See docs/admin.md for information on what these people can do. They must belong to one of the
  167. # configured homeservers above.
  168. matrix_media_repo_admins:
  169. admins: []
  170. # admins:
  171. # - "@your_username:example.org"
  172. # Shared secret auth is useful for applications building on top of the media repository, such
  173. # as a management interface. The `token` provided here is treated as a repository administrator
  174. # when shared secret auth is enabled: if the `token` is used in place of an access token, the'
  175. # request will be authorized. This is not limited to any particular domain, giving applications
  176. # the ability to use it on any configured hostname.
  177. # Set this to true to enable shared secret auth.
  178. matrix_media_repo_shared_secret_auth_enabled: false
  179. # Use a secure value here to prevent unauthorized access to the media repository.
  180. matrix_media_repo_shared_secret_auth_token: "PutSomeRandomSecureValueHere"
  181. # Datastores are places where media should be persisted. This isn't dedicated for just uploads:
  182. # thumbnails and other misc data is also stored in these places. The media repo, when looking
  183. # for a datastore to use, will always use the smallest datastore first.
  184. matrix_media_repo_datastores:
  185. datastores:
  186. - type: file
  187. enabled: true # Enable this to set up data storage.
  188. # Datastores can be split into many areas when handling uploads. Media is still de-duplicated
  189. # across all datastores (local content which duplicates remote content will re-use the remote
  190. # content's location). This option is useful if your datastore is becoming very large, or if
  191. # you want faster storage for a particular kind of media.
  192. #
  193. # The kinds available are:
  194. # thumbnails - Used to store thumbnails of media (local and remote).
  195. # remote_media - Original copies of remote media (servers not configured by this repo).
  196. # local_media - Original uploads for local media.
  197. # archives - Archives of content (GDPR and similar requests).
  198. forKinds: ["thumbnails", "remote_media", "local_media", "archives"]
  199. opts:
  200. path: /data/media
  201. - type: s3
  202. enabled: false # Enable this to set up s3 uploads
  203. forKinds: ["thumbnails", "remote_media", "local_media", "archives"]
  204. opts:
  205. # The s3 uploader needs a temporary location to buffer files to reduce memory usage on
  206. # small file uploads. If the file size is unknown, the file is written to this location
  207. # before being uploaded to s3 (then the file is deleted). If you aren't concerned about
  208. # memory usage, set this to an empty string.
  209. tempPath: "/tmp/mediarepo_s3_upload"
  210. endpoint: sfo2.digitaloceanspaces.com
  211. accessKeyId: ""
  212. accessSecret: ""
  213. ssl: true
  214. bucketName: "your-media-bucket"
  215. # An optional region for where this S3 endpoint is located. Typically not needed, though
  216. # some providers will need this (like Scaleway). Uncomment to use.
  217. # region: "sfo2"
  218. # An optional storage class for tuning how the media is stored at s3.
  219. # See https://aws.amazon.com/s3/storage-classes/ for details; uncomment to use.
  220. # storageClass: STANDARD
  221. # The media repo does support an IPFS datastore, but only if the IPFS feature is enabled. If
  222. # the feature is not enabled, this will not work. Note that IPFS support is experimental at
  223. # the moment and not recommended for general use.
  224. #
  225. # NOTE: Everything you upload to IPFS will be publicly accessible, even when the media repo
  226. # puts authentication on the download endpoints. Only use this option for cases where you
  227. # expect your media to be publicly accessible.
  228. - type: ipfs
  229. enabled: false # Enable this to use IPFS support
  230. forKinds: ["local_media"]
  231. # The IPFS datastore currently has no options. It will use the daemon or HTTP API configured
  232. # in the IPFS section of your main config.
  233. opts: {}
  234. # Options for controlling archives. Archives are exports of a particular user's content for
  235. # the purpose of GDPR or moving media to a different server.
  236. # Whether archiving is enabled or not. Default enabled.
  237. matrix_media_repo_archiving_enabled: true
  238. # If true, users can request a copy of their own data. By default, only repository administrators
  239. # can request a copy.
  240. # This includes the ability for homeserver admins to request a copy of their own server's
  241. # data, as known to the repo.
  242. matrix_media_repo_archiving_self_service: false
  243. # The number of bytes to target per archive before breaking up the files. This is independent
  244. # of any file upload limits and will require a similar amount of memory when performing an export.
  245. # The file size is also a target, not a guarantee - it is possible to have files that are smaller
  246. # or larger than the target. This is recommended to be approximately double the size of your
  247. # file upload limit, provided there is enough memory available for the demand of exporting.
  248. matrix_media_repo_archiving_target_bytes_per_part: 209715200 # 200mb default
  249. # The file upload settings for the media repository
  250. matrix_media_repo_uploads:
  251. uploads:
  252. # The maximum individual file size a user can upload.
  253. maxBytes: 104857600 # 100MB default, 0 to disable
  254. # The minimum number of bytes to let people upload. This is recommended to be non-zero to
  255. # ensure that the "cost" of running the media repo is worthwhile - small file uploads tend
  256. # to waste more CPU and database resources than small files, thus a default of 100 bytes
  257. # is applied here as an approximate break-even point.
  258. minBytes: 100 # 100 bytes by default
  259. # The number of bytes to claim as the maximum size for uploads for the limits API. If this
  260. # is not provided then the maxBytes setting will be used instead. This is useful to provide
  261. # if the media repo's settings and the reverse proxy do not match for maximum request size.
  262. # This is purely for informational reasons and does not actually limit any functionality.
  263. # Set this to -1 to indicate that there is no limit. Zero will force the use of maxBytes.
  264. reportedMaxBytes: 0
  265. # Options for limiting how much content a user can upload. Quotas are applied to content
  266. # associated with a user regardless of de-duplication. Quotas which affect remote servers
  267. # or users will not take effect. When a user exceeds their quota they will be unable to
  268. # upload any more media.
  269. quotas:
  270. # Whether or not quotas are enabled/enforced. Note that even when disabled the media repo
  271. # will track how much media a user has uploaded. This is disabled by default.
  272. enabled: false
  273. # The quota rules that affect users. The first rule to match the uploader will take effect.
  274. # An implied rule which matches all users and has no quota is always last in this list,
  275. # meaning that if no rules are supplied then users will be able to upload anything. Similarly,
  276. # if no rules match a user then the implied rule will match, allowing the user to have no
  277. # quota. The quota will let the user upload to 1 media past their quota, meaning that from
  278. # a statistics perspective the user might exceed their quota however only by a small amount.
  279. users:
  280. - glob: "@*:*" # Affect all users. Use asterisks (*) to match any character.
  281. maxBytes: 53687063712 # 50GB default, 0 to disable
  282. # Settings related to downloading files from the media repository
  283. # The maximum number of bytes to download from other servers
  284. matrix_media_repo_downloads_max_bytes: 104857600 # 100MB default, 0 to disable
  285. # The number of workers to use when downloading remote media. Raise this number if remote
  286. # media is downloading slowly or timing out.
  287. #
  288. # Maximum memory usage = numWorkers multiplied by the maximum download size
  289. # Average memory usage is dependent on how many concurrent downloads your users are doing.
  290. matrix_media_repo_downloads_num_workers: 10
  291. # How long, in minutes, to cache errors related to downloading remote media. Once this time
  292. # has passed, the media is able to be re-requested.
  293. matrix_media_repo_downloads_failure_cache_minutes: 5
  294. # The cache control settings for downloads. This can help speed up downloads for users by
  295. # keeping popular media in the cache. This cache is also used for thumbnails.
  296. matrix_media_repo_downloads_cache_enabled: true
  297. # The maximum size of cache to have. Higher numbers are better.
  298. matrix_media_repo_downloads_cache_max_size_bytes: 1048576000 # 1GB default
  299. # The maximum file size to cache. This should normally be the same size as your maximum
  300. # upload size.
  301. matrix_media_repo_downloads_cache_max_file_size_bytes: 104857600 # 100MB default
  302. # The number of minutes to track how many downloads a file gets
  303. matrix_media_repo_downloads_cache_tracked_minutes: 30
  304. # The number of downloads a file must receive in the window above (trackedMinutes) in
  305. # order to be cached.
  306. matrix_media_repo_downloads_cache_min_downloads: 5
  307. # The minimum amount of time an item should remain in the cache. This prevents the cache
  308. # from cycling out the file if it needs more room during this time. Note that the media
  309. # repo regularly cleans out media which is past this point from the cache, so this number
  310. # may need increasing depending on your use case. If the maxSizeBytes is reached for the
  311. # media repo, and some cached items are still under this timer, new items will not be able
  312. # to enter the cache. When this happens, consider raising maxSizeBytes or lowering this
  313. # timer.
  314. matrix_media_repo_downloads_cache_min_cache_time_seconds: 300
  315. # The minimum amount of time an item should remain outside the cache once it is removed.
  316. matrix_media_repo_downloads_cache_min_evicted_time_seconds: 60
  317. # How many days after a piece of remote content is downloaded before it expires. It can be
  318. # re-downloaded on demand, this just helps free up space in your datastore. Set to zero or
  319. # negative to disable. Defaults to disabled.
  320. matrix_media_repo_downloads_expire_after_days: 0
  321. # URL Preview settings
  322. matrix_media_repo_url_previews:
  323. urlPreviews:
  324. enabled: true # If enabled, the preview_url routes will be accessible
  325. maxPageSizeBytes: 10485760 # 10MB default, 0 to disable
  326. # If true, the media repository will try to provide previews for URLs with invalid or unsafe
  327. # certificates. If false (the default), the media repo will fail requests to said URLs.
  328. previewUnsafeCertificates: false
  329. # Note: URL previews are limited to a given number of words, which are then limited to a number
  330. # of characters, taking off the last word if it needs to. This also applies for the title.
  331. numWords: 50 # The number of words to include in a preview (maximum)
  332. maxLength: 200 # The maximum number of characters for a description
  333. numTitleWords: 30 # The maximum number of words to include in a preview's title
  334. maxTitleLength: 150 # The maximum number of characters for a title
  335. # The mime types to preview when OpenGraph previews cannot be rendered. OpenGraph previews are
  336. # calculated on anything matching "text/*". To have a thumbnail in the preview the URL must be
  337. # an image and the image's type must be allowed by the thumbnailer.
  338. filePreviewTypes:
  339. - "image/*"
  340. # The number of workers to use when generating url previews. Raise this number if url
  341. # previews are slow or timing out.
  342. #
  343. # Maximum memory usage = numWorkers multiplied by the maximum page size
  344. # Average memory usage is dependent on how many concurrent urls your users are previewing.
  345. numWorkers: 10
  346. # Either allowedNetworks or disallowedNetworks must be provided. If both are provided, they
  347. # will be merged. URL previews will be disabled if neither is supplied. Each entry must be
  348. # a CIDR range.
  349. disallowedNetworks:
  350. - "127.0.0.1/8"
  351. - "10.0.0.0/8"
  352. - "172.16.0.0/12"
  353. - "192.168.0.0/16"
  354. - "100.64.0.0/10"
  355. - "169.254.0.0/16"
  356. - '::1/128'
  357. - 'fe80::/64'
  358. - 'fc00::/7'
  359. allowedNetworks:
  360. # "Everything". The blacklist will help limit this.
  361. # This is the default value for this field.
  362. - "0.0.0.0/0"
  363. # How many days after a preview is generated before it expires and is deleted. The preview
  364. # can be regenerated safely - this just helps free up some space in your database. Set to
  365. # zero or negative to disable. Defaults to disabled.
  366. expireAfterDays: 0
  367. # The default Accept-Language header to supply when generating URL previews when one isn't
  368. # supplied by the client.
  369. # Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language
  370. defaultLanguage: "en-US,en"
  371. # When true, oEmbed previews will be enabled. Typically these kinds of previews are used for
  372. # sites that do not support OpenGraph or page scraping, such as Twitter. For information on
  373. # specifying providers for oEmbed, including your own, see the following documentation:
  374. # https://docs.t2bot.io/matrix-media-repo/url-previews/oembed.html
  375. # Defaults to disabled.
  376. oEmbed: false
  377. # The thumbnail configuration for the media repository.
  378. matrix_media_repo_thumbnails:
  379. thumbnails:
  380. # The maximum number of bytes an image can be before the thumbnailer refuses.
  381. maxSourceBytes: 10485760 # 10MB default, 0 to disable
  382. # The maximum number of pixels an image can have before the thumbnailer refuses. Note that
  383. # this only applies to image types: file types like audio and video are affected solely by
  384. # the maxSourceBytes.
  385. maxPixels: 32000000 # 32M default
  386. # The number of workers to use when generating thumbnails. Raise this number if thumbnails
  387. # are slow to generate or timing out.
  388. #
  389. # Maximum memory usage = numWorkers multiplied by the maximum image source size
  390. # Average memory usage is dependent on how many thumbnails are being generated by your users
  391. numWorkers: 100
  392. # All thumbnails are generated into one of the sizes listed here. The first size is used as
  393. # the default for when no width or height is requested. The media repository will return
  394. # either an exact match or the next largest size of thumbnail.
  395. sizes:
  396. - width: 32
  397. height: 32
  398. - width: 96
  399. height: 96
  400. - width: 320
  401. height: 240
  402. - width: 640
  403. height: 480
  404. - width: 768 # This size is primarily used for audio thumbnailing.
  405. height: 240
  406. - width: 800
  407. height: 600
  408. # To allow for thumbnails to be any size, not just in the sizes specified above, set this to
  409. # true (default false). When enabled, whatever size requested by the client will be generated
  410. # up to a maximum of the largest possible dimensions in the `sizes` list. For best results,
  411. # specify only one size in the `sizes` list when this option is enabled.
  412. dynamicSizing: false
  413. # The content types to thumbnail when requested. Types that are not supported by the media repo
  414. # will not be thumbnailed (adding application/json here won't work). Clients may still not request
  415. # thumbnails for these types - this won't make clients automatically thumbnail these file types.
  416. types:
  417. - "image/jpeg"
  418. - "image/jpg"
  419. - "image/png"
  420. - "image/apng"
  421. - "image/gif"
  422. - "image/heif"
  423. - "image/webp"
  424. # - "image/svg+xml" # Be sure to have ImageMagick installed to thumbnail SVG files
  425. - "audio/mpeg"
  426. - "audio/ogg"
  427. - "audio/wav"
  428. - "audio/flac"
  429. # - "video/mp4" # Be sure to have ffmpeg installed to thumbnail video files
  430. # Animated thumbnails can be CPU intensive to generate. To disable the generation of animated
  431. # thumbnails, set this to false. If disabled, regular thumbnails will be returned.
  432. allowAnimated: true
  433. # Default to animated thumbnails, if available
  434. defaultAnimated: false
  435. # The maximum file size to thumbnail when a capable animated thumbnail is requested. If the image
  436. # is larger than this, the thumbnail will be generated as a static image.
  437. maxAnimateSizeBytes: 10485760 # 10MB default, 0 to disable
  438. # On a scale of 0 (start of animation) to 1 (end of animation), where should the thumbnailer try
  439. # and thumbnail animated content? Defaults to 0.5 (middle of animation).
  440. stillFrame: 0.5
  441. # How many days after a thumbnail is generated before it expires and is deleted. The thumbnail
  442. # can be regenerated safely - this just helps free up some space in your datastores. Set to
  443. # zero or negative to disable. Defaults to disabled.
  444. expireAfterDays: 0
  445. # Controls for the rate limit functionality
  446. # Set this to false if rate limiting is handled at a higher level or you don't want it enabled.
  447. matrix_media_repo_rate_limit_enabled: true
  448. # The number of requests per second before an IP will be rate limited. Must be a whole number.
  449. matrix_media_repo_rate_limit_requests_per_second: 1
  450. # The number of requests an IP can send at once before the rate limit is actually considered.
  451. matrix_media_repo_rate_limit_burst: 10
  452. # Identicons are generated avatars for a given username. Some clients use these to give users a
  453. # default avatar after signing up. Identicons are not part of the official matrix spec, therefore
  454. # this feature is completely optional.
  455. matrix_media_repo_identicons_enabled: true
  456. # The quarantine media settings.
  457. # If true, when a thumbnail of quarantined media is requested an image will be returned. If no
  458. # image is given in the thumbnailPath below then a generated image will be provided. This does
  459. # not affect regular downloads of files.
  460. matrix_media_repo_quarantine_replace_thumbnails: true
  461. # If true, when media which has been quarantined is requested an image will be returned. If
  462. # no image is given in the thumbnailPath below then a generated image will be provided. This
  463. # will replace media which is not an image (ie: quarantining a PDF will replace the PDF with
  464. # an image).
  465. matrix_media_repo_quarantine_replace_downloads: false
  466. # If provided, the given image will be returned as a thumbnail for media that is quarantined.
  467. matrix_media_repo_quarantine_thumbnail_path: ""
  468. # If true, administrators of the configured homeservers may quarantine media for their server
  469. # only. Global administrators can quarantine any media (local or remote) regardless of this
  470. # flag.
  471. matrix_media_repo_quarantine_allow_local_admins: true
  472. # The various timeouts that the media repo will use.
  473. # The maximum amount of time the media repo should spend trying to fetch a resource that is
  474. # being previewed.
  475. matrix_media_repo_timeouts_url_preview_timeout_seconds: 10
  476. # The maximum amount of time the media repo will spend making remote requests to other repos
  477. # or homeservers. This is primarily used to download media.
  478. matrix_media_repo_timeouts_federation_timeout_seconds: 120
  479. # The maximum amount of time the media repo will spend talking to your configured homeservers.
  480. # This is usually used to verify a user's identity.
  481. matrix_media_repo_timeouts_client_server_timeout_seconds: 30
  482. # Prometheus metrics configuration
  483. # For an example Grafana dashboard, import the following JSON:
  484. # https://github.com/turt2live/matrix-media-repo/blob/master/docs/grafana.json
  485. # If true, the bindAddress and port below will serve GET /metrics for Prometheus to scrape.
  486. matrix_media_repo_metrics_enabled: false
  487. # The address to listen on. Typically "127.0.0.1" or "0.0.0.0" for all interfaces.
  488. matrix_media_repo_metrics_bind_address: "0.0.0.0"
  489. # The port to listen on. Cannot be the same as the general web server port.
  490. matrix_media_repo_metrics_port: 9000
  491. # Plugins are optional pieces of the media repo used to extend the functionality offered.
  492. # Currently there are only antispam plugins, but in future there should be more options.
  493. # Plugins are not supported on per-domain paths and are instead repo-wide. For more
  494. # information on writing plugins, please visit #matrix-media-repo:t2bot.io on Matrix.
  495. matrix_media_repo_plugins:
  496. plugins: []
  497. # An example OCR plugin to block images with certain text. Note that the Docker image
  498. # for the media repo automatically ships this at /plugins/plugin_antispam_ocr
  499. # - exec: /plugins/plugin_antispam_ocr
  500. # config:
  501. # # The URL to your OCR server (https://github.com/otiai10/ocrserver)
  502. # ocrServer: "http://localhost:8080"
  503. # # The keywords to scan for. The image must contain at least one of the keywords
  504. # # from each list to qualify for spam.
  505. # keywordGroups:
  506. # - - elon
  507. # - musk
  508. # - elonmusk
  509. # - - bitcoin
  510. # # The minimum (and maximum) sizes of images to process.
  511. # minSizeBytes: 20000
  512. # maxSizeBytes: 200000
  513. # # The types of files to process
  514. # types: ["image/png", "image/jpeg", "image/jpg"]
  515. # # The user ID regex to check against
  516. # userIds: "@telegram_.*"
  517. # # How much of the image's height, starting from the top, to consider before
  518. # # discarding the rest. Set to 1.0 to consider the whole image.
  519. # percentageOfHeight: 0.35
  520. # Options for controlling various MSCs/unstable features of the media repo
  521. # Sections of this config might disappear or be added over time. By default all
  522. # features are disabled in here and must be explicitly enabled to be used.
  523. matrix_media_repo_feature_support:
  524. featureSupport:
  525. # MSC2248 - Blurhash
  526. MSC2448:
  527. # Whether or not this MSC is enabled for use in the media repo
  528. enabled: false
  529. # Maximum dimensions for converting a blurhash to an image. When no width and
  530. # height options are supplied, the default will be half these values.
  531. maxWidth: 1024
  532. maxHeight: 1024
  533. # Thumbnail size in pixels to use to generate the blurhash string
  534. thumbWidth: 64
  535. thumbHeight: 64
  536. # The X and Y components to use. Higher numbers blur less, lower numbers blur more.
  537. xComponents: 4
  538. yComponents: 3
  539. # The amount of contrast to apply when converting a blurhash to an image. Lower values
  540. # make the effect more subtle, larger values make it stronger.
  541. punch: 1
  542. # IPFS Support
  543. # This is currently experimental and might not work at all.
  544. IPFS:
  545. # Whether or not IPFS support is enabled for use in the media repo.
  546. enabled: false
  547. # Options for the built in IPFS daemon
  548. builtInDaemon:
  549. # Enable this to spawn an in-process IPFS node to use instead of a localhost
  550. # HTTP agent. If this is disabled, the media repo will assume you have an HTTP
  551. # IPFS agent running and accessible. Defaults to using a daemon (true).
  552. enabled: true
  553. # If the Daemon is enabled, set this to the location where the IPFS files should
  554. # be stored. If you're using Docker, this should be something like "/data/ipfs"
  555. # so it can be mapped to a volume.
  556. repoPath: "./ipfs"
  557. # Support for redis as a cache mechanism
  558. #
  559. # Note: Enabling Redis support will mean that the existing cache mechanism will do nothing.
  560. # It can be safely disabled once Redis support is enabled.
  561. #
  562. # See docs/redis.md for more information on how this works and how to set it up.
  563. redis:
  564. # Whether or not use Redis instead of in-process caching.
  565. enabled: false
  566. # The Redis shards that should be used by the media repo in the ring. The names of the
  567. # shards are for your reference and have no bearing on the connection, but must be unique.
  568. shards:
  569. - name: "server1"
  570. addr: ":7000"
  571. - name: "server2"
  572. addr: ":7001"
  573. - name: "server3"
  574. addr: ":7002"
  575. # Optional sentry (https://sentry.io/) configuration for the media repo
  576. # Whether or not to set up error reporting. Defaults to off.
  577. matrix_media_repo_sentry_enabled: false
  578. # Get this value from the setup instructions in Sentry
  579. matrix_media_repo_sentry_dsn: "https://examplePublicKey@ingest.sentry.io/0"
  580. # Optional environment flag. Defaults to an empty string.
  581. matrix_media_repo_sentry_environment: ""
  582. # Whether or not to turn on sentry's built in debugging. This will increase log output.
  583. matrix_media_repo_sentry_debug: false