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

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