From 3263c5dddd0ea7f1f374cb24298a823bfcf08215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Wed, 24 Feb 2021 19:31:48 +0100 Subject: [PATCH] [__matrix_synapse] add outbound-federation-worker parameter --- type/__matrix_synapse/man.rst | 4 ++++ type/__matrix_synapse/manifest | 10 +++++++++- type/__matrix_synapse/parameter/optional_multiple | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/type/__matrix_synapse/man.rst b/type/__matrix_synapse/man.rst index a951d24..4eb23bb 100644 --- a/type/__matrix_synapse/man.rst +++ b/type/__matrix_synapse/man.rst @@ -169,6 +169,10 @@ background-tasks-worker The worker that is used to run background tasks (e.g. cleaning up expired data). If not provided this defaults to the main process. +outbound-federation-worker + Worker to be used for sending federation requests. Can be specified multiple + times. Disables sending outbound federation requests from the master process. + registration-shared-secret If set, allows registration of standard or admin accounts by anyone who has the shared secret, even if registration is otherwise disabled. diff --git a/type/__matrix_synapse/manifest b/type/__matrix_synapse/manifest index 055fc81..4650a17 100755 --- a/type/__matrix_synapse/manifest +++ b/type/__matrix_synapse/manifest @@ -266,11 +266,19 @@ fi # Worker-mode configuration. export MAIN_LISTENER_PORT=8008 export ENABLE_MEDIA_REPO='true' -export SEND_FEDERATION_FROM_MAIN_PROCESS='true' +if [ -f "$__object/parameter/outbound-federation-worker" ]; then + FEDERATION_SENDER_INSTANCES=$(cat "$__object/parameter/outbound-federation-worker") + export FEDERATION_SENDER_INSTANCES +fi MAIN_LISTENER_RESOURCES="[federation,client]" if [ "$EXPOSE_METRICS" = "true" ]; then MAIN_LISTENER_RESOURCES="$(echo "$MAIN_LISTENER_RESOURCES" | tr -d ']'),metrics]" fi +if [ -n "$FEDERATION_SENDER_INSTANCES" ]; then + export SEND_FEDERATION_FROM_MAIN_PROCESS='false' +else + export SEND_FEDERATION_FROM_MAIN_PROCESS='true' +fi export MAIN_LISTENER_RESOURCES ENABLE_REPLICATION= diff --git a/type/__matrix_synapse/parameter/optional_multiple b/type/__matrix_synapse/parameter/optional_multiple index 8aa5c29..8871dd6 100644 --- a/type/__matrix_synapse/parameter/optional_multiple +++ b/type/__matrix_synapse/parameter/optional_multiple @@ -4,3 +4,4 @@ auto-join-room app-service-config-file extra-setting bind-address +outbound-federation-worker