From b41dd8ab8befa809869388bd35b8dfdbebceb375 Mon Sep 17 00:00:00 2001 From: reivilibre Date: Wed, 4 Jun 2025 10:35:02 +0000 Subject: [PATCH] deploy: 379356c0ea2f5d0a0d65d900efdf157417fa6947 --- develop/404.html | 2 +- develop/CAPTCHA_SETUP.html | 2 +- develop/admin_api/account_validity.html | 2 +- develop/admin_api/event_reports.html | 2 +- develop/admin_api/experimental_features.html | 2 +- develop/admin_api/media_admin_api.html | 2 +- develop/admin_api/purge_history_api.html | 2 +- develop/admin_api/register_api.html | 2 +- develop/admin_api/room_membership.html | 2 +- develop/admin_api/rooms.html | 2 +- develop/admin_api/server_notices.html | 2 +- develop/admin_api/statistics.html | 2 +- develop/admin_api/user_admin_api.html | 2 +- develop/admin_api/version_api.html | 2 +- develop/application_services.html | 2 +- develop/auth_chain_difference_algorithm.html | 2 +- develop/code_style.html | 2 +- develop/consent_tracking.html | 2 +- develop/delegate.html | 2 +- develop/deprecation_policy.html | 2 +- develop/development/cas.html | 2 +- develop/development/contributing_guide.html | 2 +- develop/development/database_schema.html | 2 +- develop/development/demo.html | 2 +- develop/development/dependencies.html | 2 +- .../development/experimental_features.html | 2 +- develop/development/git.html | 2 +- .../internal_documentation/index.html | 2 +- develop/development/releases.html | 2 +- develop/development/reviews.html | 2 +- develop/development/room-dag-concepts.html | 2 +- develop/development/saml.html | 2 +- .../synapse_architecture/cancellation.html | 2 +- .../synapse_architecture/faster_joins.html | 2 +- .../synapse_architecture/streams.html | 2 +- develop/federate.html | 2 +- develop/index.html | 2 +- develop/jwt.html | 2 +- develop/log_contexts.html | 2 +- develop/manhole.html | 2 +- develop/media_repository.html | 2 +- develop/message_retention_policies.html | 2 +- develop/metrics-howto.html | 2 +- develop/modules/account_data_callbacks.html | 2 +- .../modules/account_validity_callbacks.html | 2 +- ...xtra_fields_to_client_events_unsigned.html | 6 +- ...ackground_update_controller_callbacks.html | 2 +- develop/modules/index.html | 2 +- .../modules/media_repository_callbacks.html | 243 ++++++++++++++++++ .../password_auth_provider_callbacks.html | 2 +- develop/modules/porting_legacy_module.html | 6 +- .../modules/presence_router_callbacks.html | 2 +- develop/modules/spam_checker_callbacks.html | 2 +- .../modules/third_party_rules_callbacks.html | 2 +- develop/modules/writing_a_module.html | 2 +- develop/openid.html | 2 +- develop/opentracing.html | 2 +- ...ing_synapse_on_single_board_computers.html | 2 +- develop/password_auth_providers.html | 2 +- develop/postgres.html | 2 +- develop/print.html | 41 ++- develop/replication.html | 2 +- develop/reverse_proxy.html | 2 +- develop/room_and_user_statistics.html | 2 +- develop/searchindex.js | 2 +- develop/searchindex.json | 2 +- develop/server_notices.html | 2 +- develop/setup/forward_proxy.html | 2 +- develop/setup/installation.html | 2 +- develop/setup/turn/coturn.html | 2 +- develop/setup/turn/eturnal.html | 2 +- develop/sso_mapping_providers.html | 2 +- develop/structured_logging.html | 2 +- develop/synctl_workers.html | 2 +- develop/systemd-with-workers/index.html | 2 +- develop/tcp_replication.html | 2 +- develop/templates.html | 2 +- develop/turn-howto.html | 2 +- develop/upgrade.html | 2 +- .../admin_api/background_updates.html | 2 +- .../administration/admin_api/federation.html | 2 +- .../usage/administration/admin_api/index.html | 2 +- .../admin_api/registration_tokens.html | 2 +- develop/usage/administration/admin_faq.html | 2 +- develop/usage/administration/backups.html | 2 +- .../database_maintenance_tools.html | 2 +- develop/usage/administration/index.html | 2 +- ...reporting_homeserver_usage_statistics.html | 2 +- .../administration/monthly_active_users.html | 2 +- develop/usage/administration/request_log.html | 2 +- .../usage/administration/state_groups.html | 2 +- ...anding_synapse_through_grafana_graphs.html | 2 +- .../administration/useful_sql_for_admins.html | 2 +- .../configuration/config_documentation.html | 2 +- .../homeserver_sample_config.html | 2 +- develop/usage/configuration/index.html | 2 +- .../configuration/logging_sample_config.html | 2 +- .../user_authentication/index.html | 2 +- .../user_authentication/refresh_tokens.html | 2 +- .../single_sign_on/cas.html | 2 +- .../single_sign_on/index.html | 2 +- .../single_sign_on/saml.html | 2 +- develop/user_directory.html | 2 +- develop/welcome_and_overview.html | 2 +- develop/workers.html | 2 +- 105 files changed, 390 insertions(+), 108 deletions(-) create mode 100644 develop/modules/media_repository_callbacks.html diff --git a/develop/404.html b/develop/404.html index e2406bcedd..93dbb5518e 100644 --- a/develop/404.html +++ b/develop/404.html @@ -78,7 +78,7 @@ diff --git a/develop/CAPTCHA_SETUP.html b/develop/CAPTCHA_SETUP.html index a36375e14f..c25196685c 100644 --- a/develop/CAPTCHA_SETUP.html +++ b/develop/CAPTCHA_SETUP.html @@ -77,7 +77,7 @@ diff --git a/develop/admin_api/account_validity.html b/develop/admin_api/account_validity.html index 3d2dc800f7..9399d91f90 100644 --- a/develop/admin_api/account_validity.html +++ b/develop/admin_api/account_validity.html @@ -77,7 +77,7 @@ diff --git a/develop/admin_api/event_reports.html b/develop/admin_api/event_reports.html index 5e3834b3e6..6d06f2b594 100644 --- a/develop/admin_api/event_reports.html +++ b/develop/admin_api/event_reports.html @@ -77,7 +77,7 @@ diff --git a/develop/admin_api/experimental_features.html b/develop/admin_api/experimental_features.html index 64041216dd..92692b885e 100644 --- a/develop/admin_api/experimental_features.html +++ b/develop/admin_api/experimental_features.html @@ -77,7 +77,7 @@ diff --git a/develop/admin_api/media_admin_api.html b/develop/admin_api/media_admin_api.html index 09d60715d3..8afb7c0855 100644 --- a/develop/admin_api/media_admin_api.html +++ b/develop/admin_api/media_admin_api.html @@ -77,7 +77,7 @@ diff --git a/develop/admin_api/purge_history_api.html b/develop/admin_api/purge_history_api.html index 2d03d0b0a0..5bea969b76 100644 --- a/develop/admin_api/purge_history_api.html +++ b/develop/admin_api/purge_history_api.html @@ -77,7 +77,7 @@ diff --git a/develop/admin_api/register_api.html b/develop/admin_api/register_api.html index 820f086bc2..6f5a1e960a 100644 --- a/develop/admin_api/register_api.html +++ b/develop/admin_api/register_api.html @@ -77,7 +77,7 @@ diff --git a/develop/admin_api/room_membership.html b/develop/admin_api/room_membership.html index dce6532eca..5537991ed5 100644 --- a/develop/admin_api/room_membership.html +++ b/develop/admin_api/room_membership.html @@ -77,7 +77,7 @@ diff --git a/develop/admin_api/rooms.html b/develop/admin_api/rooms.html index c933eaaff9..8aa3a957e5 100644 --- a/develop/admin_api/rooms.html +++ b/develop/admin_api/rooms.html @@ -77,7 +77,7 @@ diff --git a/develop/admin_api/server_notices.html b/develop/admin_api/server_notices.html index 2d6dc8fbe7..9410d96a1c 100644 --- a/develop/admin_api/server_notices.html +++ b/develop/admin_api/server_notices.html @@ -77,7 +77,7 @@ diff --git a/develop/admin_api/statistics.html b/develop/admin_api/statistics.html index 0a2c1b5488..332b90761e 100644 --- a/develop/admin_api/statistics.html +++ b/develop/admin_api/statistics.html @@ -77,7 +77,7 @@ diff --git a/develop/admin_api/user_admin_api.html b/develop/admin_api/user_admin_api.html index 2952e16ff4..fe3870bf66 100644 --- a/develop/admin_api/user_admin_api.html +++ b/develop/admin_api/user_admin_api.html @@ -77,7 +77,7 @@ diff --git a/develop/admin_api/version_api.html b/develop/admin_api/version_api.html index 50f136b359..59b391cd52 100644 --- a/develop/admin_api/version_api.html +++ b/develop/admin_api/version_api.html @@ -77,7 +77,7 @@ diff --git a/develop/application_services.html b/develop/application_services.html index a6b8733783..4738ad6c12 100644 --- a/develop/application_services.html +++ b/develop/application_services.html @@ -77,7 +77,7 @@ diff --git a/develop/auth_chain_difference_algorithm.html b/develop/auth_chain_difference_algorithm.html index cfc88743c7..cd0fa585bf 100644 --- a/develop/auth_chain_difference_algorithm.html +++ b/develop/auth_chain_difference_algorithm.html @@ -77,7 +77,7 @@ diff --git a/develop/code_style.html b/develop/code_style.html index 299bf6b5fe..2d21e05e0d 100644 --- a/develop/code_style.html +++ b/develop/code_style.html @@ -77,7 +77,7 @@ diff --git a/develop/consent_tracking.html b/develop/consent_tracking.html index 21cfaa3f3a..dcd3767bb6 100644 --- a/develop/consent_tracking.html +++ b/develop/consent_tracking.html @@ -77,7 +77,7 @@ diff --git a/develop/delegate.html b/develop/delegate.html index 40069efb7b..9fc9f226b8 100644 --- a/develop/delegate.html +++ b/develop/delegate.html @@ -77,7 +77,7 @@ diff --git a/develop/deprecation_policy.html b/develop/deprecation_policy.html index a6c2eb5355..fe7d24483e 100644 --- a/develop/deprecation_policy.html +++ b/develop/deprecation_policy.html @@ -77,7 +77,7 @@ diff --git a/develop/development/cas.html b/develop/development/cas.html index e89f7e42ab..9a3c6966c9 100644 --- a/develop/development/cas.html +++ b/develop/development/cas.html @@ -77,7 +77,7 @@ diff --git a/develop/development/contributing_guide.html b/develop/development/contributing_guide.html index 3dbcf1e56c..55fca06dc5 100644 --- a/develop/development/contributing_guide.html +++ b/develop/development/contributing_guide.html @@ -77,7 +77,7 @@ diff --git a/develop/development/database_schema.html b/develop/development/database_schema.html index 6119196892..b14e6a2369 100644 --- a/develop/development/database_schema.html +++ b/develop/development/database_schema.html @@ -77,7 +77,7 @@ diff --git a/develop/development/demo.html b/develop/development/demo.html index 975b137e6c..67d72a80cc 100644 --- a/develop/development/demo.html +++ b/develop/development/demo.html @@ -77,7 +77,7 @@ diff --git a/develop/development/dependencies.html b/develop/development/dependencies.html index 5d8517c474..f07cb8236f 100644 --- a/develop/development/dependencies.html +++ b/develop/development/dependencies.html @@ -77,7 +77,7 @@ diff --git a/develop/development/experimental_features.html b/develop/development/experimental_features.html index 99b8a7c187..28394756bb 100644 --- a/develop/development/experimental_features.html +++ b/develop/development/experimental_features.html @@ -77,7 +77,7 @@ diff --git a/develop/development/git.html b/develop/development/git.html index 5660d89c64..3a319a9ea3 100644 --- a/develop/development/git.html +++ b/develop/development/git.html @@ -77,7 +77,7 @@ diff --git a/develop/development/internal_documentation/index.html b/develop/development/internal_documentation/index.html index 1521fb077d..e2773ca711 100644 --- a/develop/development/internal_documentation/index.html +++ b/develop/development/internal_documentation/index.html @@ -77,7 +77,7 @@ diff --git a/develop/development/releases.html b/develop/development/releases.html index 0d9b476521..929d5aee46 100644 --- a/develop/development/releases.html +++ b/develop/development/releases.html @@ -77,7 +77,7 @@ diff --git a/develop/development/reviews.html b/develop/development/reviews.html index 1513a93507..1b93b15492 100644 --- a/develop/development/reviews.html +++ b/develop/development/reviews.html @@ -77,7 +77,7 @@ diff --git a/develop/development/room-dag-concepts.html b/develop/development/room-dag-concepts.html index 90cc03baa2..ba23769356 100644 --- a/develop/development/room-dag-concepts.html +++ b/develop/development/room-dag-concepts.html @@ -77,7 +77,7 @@ diff --git a/develop/development/saml.html b/develop/development/saml.html index 154700bc3e..93dcdc85bc 100644 --- a/develop/development/saml.html +++ b/develop/development/saml.html @@ -77,7 +77,7 @@ diff --git a/develop/development/synapse_architecture/cancellation.html b/develop/development/synapse_architecture/cancellation.html index fffdfcf3ad..75cf6e8047 100644 --- a/develop/development/synapse_architecture/cancellation.html +++ b/develop/development/synapse_architecture/cancellation.html @@ -77,7 +77,7 @@ diff --git a/develop/development/synapse_architecture/faster_joins.html b/develop/development/synapse_architecture/faster_joins.html index 2441e0c659..c38260cb6a 100644 --- a/develop/development/synapse_architecture/faster_joins.html +++ b/develop/development/synapse_architecture/faster_joins.html @@ -77,7 +77,7 @@ diff --git a/develop/development/synapse_architecture/streams.html b/develop/development/synapse_architecture/streams.html index a15b455e84..da4f00fe17 100644 --- a/develop/development/synapse_architecture/streams.html +++ b/develop/development/synapse_architecture/streams.html @@ -77,7 +77,7 @@ diff --git a/develop/federate.html b/develop/federate.html index c56fb58d02..9855f8e77e 100644 --- a/develop/federate.html +++ b/develop/federate.html @@ -77,7 +77,7 @@ diff --git a/develop/index.html b/develop/index.html index e078f9dc6c..d26135e0b9 100644 --- a/develop/index.html +++ b/develop/index.html @@ -77,7 +77,7 @@ diff --git a/develop/jwt.html b/develop/jwt.html index d93c0dd447..aba667f1d0 100644 --- a/develop/jwt.html +++ b/develop/jwt.html @@ -77,7 +77,7 @@ diff --git a/develop/log_contexts.html b/develop/log_contexts.html index ff2ea7a888..d032223126 100644 --- a/develop/log_contexts.html +++ b/develop/log_contexts.html @@ -77,7 +77,7 @@ diff --git a/develop/manhole.html b/develop/manhole.html index 48a01678c3..64151efde5 100644 --- a/develop/manhole.html +++ b/develop/manhole.html @@ -77,7 +77,7 @@ diff --git a/develop/media_repository.html b/develop/media_repository.html index 36f5dcdad6..767e720b6b 100644 --- a/develop/media_repository.html +++ b/develop/media_repository.html @@ -77,7 +77,7 @@ diff --git a/develop/message_retention_policies.html b/develop/message_retention_policies.html index 5e735886cd..43784038f9 100644 --- a/develop/message_retention_policies.html +++ b/develop/message_retention_policies.html @@ -77,7 +77,7 @@ diff --git a/develop/metrics-howto.html b/develop/metrics-howto.html index 1252b3c779..a7bc6769b6 100644 --- a/develop/metrics-howto.html +++ b/develop/metrics-howto.html @@ -77,7 +77,7 @@ diff --git a/develop/modules/account_data_callbacks.html b/develop/modules/account_data_callbacks.html index 4554e4e84b..daac4d35da 100644 --- a/develop/modules/account_data_callbacks.html +++ b/develop/modules/account_data_callbacks.html @@ -77,7 +77,7 @@ diff --git a/develop/modules/account_validity_callbacks.html b/develop/modules/account_validity_callbacks.html index fb13de6be2..a88d789c69 100644 --- a/develop/modules/account_validity_callbacks.html +++ b/develop/modules/account_validity_callbacks.html @@ -77,7 +77,7 @@ diff --git a/develop/modules/add_extra_fields_to_client_events_unsigned.html b/develop/modules/add_extra_fields_to_client_events_unsigned.html index b51f85c742..4bff2b1a9f 100644 --- a/develop/modules/add_extra_fields_to_client_events_unsigned.html +++ b/develop/modules/add_extra_fields_to_client_events_unsigned.html @@ -77,7 +77,7 @@ @@ -188,7 +188,7 @@ section, the last-registered callback wins.

-
@@ -200,7 +200,7 @@ section, the last-registered callback wins.

- diff --git a/develop/modules/background_update_controller_callbacks.html b/develop/modules/background_update_controller_callbacks.html index d10253dc0b..e321bc52d2 100644 --- a/develop/modules/background_update_controller_callbacks.html +++ b/develop/modules/background_update_controller_callbacks.html @@ -77,7 +77,7 @@ diff --git a/develop/modules/index.html b/develop/modules/index.html index 84e259097a..fe79642232 100644 --- a/develop/modules/index.html +++ b/develop/modules/index.html @@ -77,7 +77,7 @@ diff --git a/develop/modules/media_repository_callbacks.html b/develop/modules/media_repository_callbacks.html new file mode 100644 index 0000000000..e5279e7806 --- /dev/null +++ b/develop/modules/media_repository_callbacks.html @@ -0,0 +1,243 @@ + + + + + + Media repository - Synapse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+
+ +
+ +
+ +

Media repository callbacks

+

Media repository callbacks allow module developers to customise the behaviour of the +media repository on a per user basis. Media repository callbacks can be registered +using the module API's register_media_repository_callbacks method.

+

The available media repository callbacks are:

+

get_media_config_for_user

+

First introduced in Synapse v1.132.0

+
async def get_media_config_for_user(user_id: str) -> Optional[JsonDict]
+
+

Called when processing a request from a client for the +media config endpoint.

+

The arguments passed to this callback are:

+
    +
  • user_id: The Matrix user ID of the user (e.g. @alice:example.com) making the request.
  • +
+

If the callback returns a dictionary then it will be used as the body of the response to the +client.

+

If multiple modules implement this callback, they will be considered in order. If a +callback returns None, Synapse falls through to the next one. The value of the first +callback that does not return None will be used. If this happens, Synapse will not call +any of the subsequent implementations of this callback.

+

If no module returns a non-None value then the default media config will be returned.

+

is_user_allowed_to_upload_media_of_size

+

First introduced in Synapse v1.132.0

+
async def is_user_allowed_to_upload_media_of_size(user_id: str, size: int) -> bool
+
+

Called before media is accepted for upload from a user, in case the module needs to +enforce a different limit for the particular user.

+

The arguments passed to this callback are:

+
    +
  • user_id: The Matrix user ID of the user (e.g. @alice:example.com) making the request.
  • +
  • size: The size in bytes of media that is being requested to upload.
  • +
+

If the module returns False, the current request will be denied with the error code +M_TOO_LARGE and the HTTP status code 413.

+

If multiple modules implement this callback, they will be considered in order. If a callback +returns True, Synapse falls through to the next one. The value of the first callback that +returns False will be used. If this happens, Synapse will not call any of the subsequent +implementations of this callback.

+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + + + + diff --git a/develop/modules/password_auth_provider_callbacks.html b/develop/modules/password_auth_provider_callbacks.html index b69affbf70..a779e9fa3f 100644 --- a/develop/modules/password_auth_provider_callbacks.html +++ b/develop/modules/password_auth_provider_callbacks.html @@ -77,7 +77,7 @@ diff --git a/develop/modules/porting_legacy_module.html b/develop/modules/porting_legacy_module.html index 1e643cc8fd..1d41d3c088 100644 --- a/develop/modules/porting_legacy_module.html +++ b/develop/modules/porting_legacy_module.html @@ -77,7 +77,7 @@ @@ -181,7 +181,7 @@ for more info).