diff --git a/docs/usage/configuration/config_documentation.md b/docs/usage/configuration/config_documentation.md index c014de794d..401c1ff7db 100644 --- a/docs/usage/configuration/config_documentation.md +++ b/docs/usage/configuration/config_documentation.md @@ -2058,6 +2058,23 @@ Example configuration: max_upload_size: 60M ``` --- +### `media_upload_limits` + +*(array)* A list of media upload limits defining how much data a given user can upload in a given time period. + +An empty list means no limits are applied. + +Defaults to `[]`. + +Example configuration: +```yaml +media_upload_limits: +- time_period: 1h + max_size: 100M +- time_period: 1w + max_size: 500M +``` +--- ### `max_image_pixels` *(byte size)* Maximum number of pixels that will be thumbnailed. Defaults to `"32M"`. diff --git a/schema/synapse-config.schema.yaml b/schema/synapse-config.schema.yaml index 5ebe80f51c..84f8a66473 100644 --- a/schema/synapse-config.schema.yaml +++ b/schema/synapse-config.schema.yaml @@ -2300,6 +2300,30 @@ properties: default: 50M examples: - 60M + media_upload_limits: + type: array + description: >- + A list of media upload limits defining how much data a given user can + upload in a given time period. + + + An empty list means no limits are applied. + default: [] + items: + time_period: + type: "#/$defs/duration" + description: >- + The time period over which the limit applies. Required. + max_size: + type: "#/$defs/bytes" + description: >- + Amount of data that can be uploaded in the time period by the user. + Required. + examples: + - - time_period: 1h + max_size: 100M + - time_period: 1w + max_size: 500M max_image_pixels: $ref: "#/$defs/bytes" description: Maximum number of pixels that will be thumbnailed.