Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

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