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

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