mirror of
https://github.com/element-hq/synapse
synced 2024-08-19 09:10:52 +00:00
deploy: 372136d3a8
This commit is contained in:
parent
8b686ad971
commit
940f7fdf8f
6 changed files with 58 additions and 70 deletions
|
@ -9741,7 +9741,7 @@ worker_replication_secret: ""
|
||||||
redis:
|
redis:
|
||||||
enabled: true
|
enabled: true
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<p>See the sample config for the full documentation of each option.</p>
|
<p>See the <a href="usage/configuration/config_documentation.html">configuration manual</a> for the full documentation of each option.</p>
|
||||||
<p>Under <strong>no circumstances</strong> should the replication listener be exposed to the
|
<p>Under <strong>no circumstances</strong> should the replication listener be exposed to the
|
||||||
public internet; replication traffic is:</p>
|
public internet; replication traffic is:</p>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -9749,15 +9749,17 @@ public internet; replication traffic is:</p>
|
||||||
<li>unauthenticated, unless <code>worker_replication_secret</code> is configured</li>
|
<li>unauthenticated, unless <code>worker_replication_secret</code> is configured</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3 id="worker-configuration"><a class="header" href="#worker-configuration">Worker configuration</a></h3>
|
<h3 id="worker-configuration"><a class="header" href="#worker-configuration">Worker configuration</a></h3>
|
||||||
<p>In the config file for each worker, you must specify the type of worker
|
<p>In the config file for each worker, you must specify:</p>
|
||||||
application (<code>worker_app</code>), and you should specify a unique name for the worker
|
<ul>
|
||||||
(<code>worker_name</code>). The currently available worker applications are listed below.
|
<li>The type of worker (<code>worker_app</code>). The currently available worker applications are listed below.</li>
|
||||||
You must also specify the HTTP replication endpoint that it should talk to on
|
<li>A unique name for the worker (<code>worker_name</code>).</li>
|
||||||
the main synapse process. <code>worker_replication_host</code> should specify the host of
|
<li>The HTTP replication endpoint that it should talk to on the main synapse process
|
||||||
the main synapse and <code>worker_replication_http_port</code> should point to the HTTP
|
(<code>worker_replication_host</code> and <code>worker_replication_http_port</code>)</li>
|
||||||
replication port. If the worker will handle HTTP requests then the
|
<li>If handling HTTP requests, a <code>worker_listeners</code> option with an <code>http</code>
|
||||||
<code>worker_listeners</code> option should be set with a <code>http</code> listener, in the same way
|
listener, in the same way as the <code>listeners</code> option in the shared config.</li>
|
||||||
as the <code>listeners</code> option in the shared config.</p>
|
<li>If handling the <code>^/_matrix/client/v3/keys/upload</code> endpoint, the HTTP URI for
|
||||||
|
the main process (<code>worker_main_http_uri</code>).</li>
|
||||||
|
</ul>
|
||||||
<p>For example:</p>
|
<p>For example:</p>
|
||||||
<pre><code class="language-yaml">worker_app: synapse.app.generic_worker
|
<pre><code class="language-yaml">worker_app: synapse.app.generic_worker
|
||||||
worker_name: generic_worker1
|
worker_name: generic_worker1
|
||||||
|
@ -9766,6 +9768,8 @@ worker_name: generic_worker1
|
||||||
worker_replication_host: 127.0.0.1
|
worker_replication_host: 127.0.0.1
|
||||||
worker_replication_http_port: 9093
|
worker_replication_http_port: 9093
|
||||||
|
|
||||||
|
worker_main_http_uri: http://localhost:8008/
|
||||||
|
|
||||||
worker_listeners:
|
worker_listeners:
|
||||||
- type: http
|
- type: http
|
||||||
port: 8083
|
port: 8083
|
||||||
|
@ -9841,10 +9845,12 @@ information.</p>
|
||||||
^/_matrix/client/(api/v1|r0|v3|unstable)/search$
|
^/_matrix/client/(api/v1|r0|v3|unstable)/search$
|
||||||
|
|
||||||
# Encryption requests
|
# Encryption requests
|
||||||
|
# Note that ^/_matrix/client/(r0|v3|unstable)/keys/upload/ requires `worker_main_http_uri`
|
||||||
^/_matrix/client/(r0|v3|unstable)/keys/query$
|
^/_matrix/client/(r0|v3|unstable)/keys/query$
|
||||||
^/_matrix/client/(r0|v3|unstable)/keys/changes$
|
^/_matrix/client/(r0|v3|unstable)/keys/changes$
|
||||||
^/_matrix/client/(r0|v3|unstable)/keys/claim$
|
^/_matrix/client/(r0|v3|unstable)/keys/claim$
|
||||||
^/_matrix/client/(r0|v3|unstable)/room_keys/
|
^/_matrix/client/(r0|v3|unstable)/room_keys/
|
||||||
|
^/_matrix/client/(r0|v3|unstable)/keys/upload/
|
||||||
|
|
||||||
# Registration/login requests
|
# Registration/login requests
|
||||||
^/_matrix/client/(api/v1|r0|v3|unstable)/login$
|
^/_matrix/client/(api/v1|r0|v3|unstable)/login$
|
||||||
|
@ -10138,31 +10144,16 @@ endpoint as long as either this worker or the main process are configured to
|
||||||
handle it, and are online.</p>
|
handle it, and are online.</p>
|
||||||
<p>If <code>update_user_directory</code> is set to <code>false</code>, and this worker is not running,
|
<p>If <code>update_user_directory</code> is set to <code>false</code>, and this worker is not running,
|
||||||
the above endpoint may give outdated results.</p>
|
the above endpoint may give outdated results.</p>
|
||||||
<h3 id="synapseappfrontend_proxy"><a class="header" href="#synapseappfrontend_proxy"><code>synapse.app.frontend_proxy</code></a></h3>
|
|
||||||
<p>Proxies some frequently-requested client endpoints to add caching and remove
|
|
||||||
load from the main synapse. It can handle REST endpoints matching the following
|
|
||||||
regular expressions:</p>
|
|
||||||
<pre><code>^/_matrix/client/(r0|v3|unstable)/keys/upload
|
|
||||||
</code></pre>
|
|
||||||
<p>If <code>use_presence</code> is False in the homeserver config, it can also handle REST
|
|
||||||
endpoints matching the following regular expressions:</p>
|
|
||||||
<pre><code>^/_matrix/client/(api/v1|r0|v3|unstable)/presence/[^/]+/status
|
|
||||||
</code></pre>
|
|
||||||
<p>This "stub" presence handler will pass through <code>GET</code> request but make the
|
|
||||||
<code>PUT</code> effectively a no-op.</p>
|
|
||||||
<p>It will proxy any requests it cannot handle to the main synapse instance. It
|
|
||||||
must therefore be configured with the location of the main instance, via
|
|
||||||
the <code>worker_main_http_uri</code> setting in the <code>frontend_proxy</code> worker configuration
|
|
||||||
file. For example:</p>
|
|
||||||
<pre><code class="language-yaml">worker_main_http_uri: http://127.0.0.1:8008
|
|
||||||
</code></pre>
|
|
||||||
<h3 id="historical-apps"><a class="header" href="#historical-apps">Historical apps</a></h3>
|
<h3 id="historical-apps"><a class="header" href="#historical-apps">Historical apps</a></h3>
|
||||||
<p><em>Note:</em> Historically there used to be more apps, however they have been
|
<p>The following used to be separate worker application types, but are now
|
||||||
amalgamated into a single <code>synapse.app.generic_worker</code> app. The remaining apps
|
equivalent to <code>synapse.app.generic_worker</code>:</p>
|
||||||
are ones that do specific processing unrelated to requests, e.g. the <code>pusher</code>
|
<ul>
|
||||||
that handles sending out push notifications for new events. The intention is for
|
<li><code>synapse.app.client_reader</code></li>
|
||||||
all these to be folded into the <code>generic_worker</code> app and to use config to define
|
<li><code>synapse.app.event_creator</code></li>
|
||||||
which processes handle the various proccessing such as push notifications.</p>
|
<li><code>synapse.app.federation_reader</code></li>
|
||||||
|
<li><code>synapse.app.frontend_proxy</code></li>
|
||||||
|
<li><code>synapse.app.synchrotron</code></li>
|
||||||
|
</ul>
|
||||||
<h2 id="migration-from-old-config"><a class="header" href="#migration-from-old-config">Migration from old config</a></h2>
|
<h2 id="migration-from-old-config"><a class="header" href="#migration-from-old-config">Migration from old config</a></h2>
|
||||||
<p>There are two main independent changes that have been made: introducing Redis
|
<p>There are two main independent changes that have been made: introducing Redis
|
||||||
support and merging apps into <code>synapse.app.generic_worker</code>. Both these changes
|
support and merging apps into <code>synapse.app.generic_worker</code>. Both these changes
|
||||||
|
@ -10251,6 +10242,8 @@ worker_name: generic_worker1
|
||||||
worker_replication_host: 127.0.0.1
|
worker_replication_host: 127.0.0.1
|
||||||
worker_replication_http_port: 9093
|
worker_replication_http_port: 9093
|
||||||
|
|
||||||
|
worker_main_http_uri: http://localhost:8008/
|
||||||
|
|
||||||
worker_listeners:
|
worker_listeners:
|
||||||
- type: http
|
- type: http
|
||||||
port: 8083
|
port: 8083
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -167,6 +167,8 @@ worker_name: generic_worker1
|
||||||
worker_replication_host: 127.0.0.1
|
worker_replication_host: 127.0.0.1
|
||||||
worker_replication_http_port: 9093
|
worker_replication_http_port: 9093
|
||||||
|
|
||||||
|
worker_main_http_uri: http://localhost:8008/
|
||||||
|
|
||||||
worker_listeners:
|
worker_listeners:
|
||||||
- type: http
|
- type: http
|
||||||
port: 8083
|
port: 8083
|
||||||
|
|
|
@ -5,6 +5,8 @@ worker_name: generic_worker1
|
||||||
worker_replication_host: 127.0.0.1
|
worker_replication_host: 127.0.0.1
|
||||||
worker_replication_http_port: 9093
|
worker_replication_http_port: 9093
|
||||||
|
|
||||||
|
worker_main_http_uri: http://localhost:8008/
|
||||||
|
|
||||||
worker_listeners:
|
worker_listeners:
|
||||||
- type: http
|
- type: http
|
||||||
port: 8083
|
port: 8083
|
||||||
|
|
|
@ -235,7 +235,7 @@ worker_replication_secret: ""
|
||||||
redis:
|
redis:
|
||||||
enabled: true
|
enabled: true
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<p>See the sample config for the full documentation of each option.</p>
|
<p>See the <a href="usage/configuration/config_documentation.html">configuration manual</a> for the full documentation of each option.</p>
|
||||||
<p>Under <strong>no circumstances</strong> should the replication listener be exposed to the
|
<p>Under <strong>no circumstances</strong> should the replication listener be exposed to the
|
||||||
public internet; replication traffic is:</p>
|
public internet; replication traffic is:</p>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -243,15 +243,17 @@ public internet; replication traffic is:</p>
|
||||||
<li>unauthenticated, unless <code>worker_replication_secret</code> is configured</li>
|
<li>unauthenticated, unless <code>worker_replication_secret</code> is configured</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3 id="worker-configuration"><a class="header" href="#worker-configuration">Worker configuration</a></h3>
|
<h3 id="worker-configuration"><a class="header" href="#worker-configuration">Worker configuration</a></h3>
|
||||||
<p>In the config file for each worker, you must specify the type of worker
|
<p>In the config file for each worker, you must specify:</p>
|
||||||
application (<code>worker_app</code>), and you should specify a unique name for the worker
|
<ul>
|
||||||
(<code>worker_name</code>). The currently available worker applications are listed below.
|
<li>The type of worker (<code>worker_app</code>). The currently available worker applications are listed below.</li>
|
||||||
You must also specify the HTTP replication endpoint that it should talk to on
|
<li>A unique name for the worker (<code>worker_name</code>).</li>
|
||||||
the main synapse process. <code>worker_replication_host</code> should specify the host of
|
<li>The HTTP replication endpoint that it should talk to on the main synapse process
|
||||||
the main synapse and <code>worker_replication_http_port</code> should point to the HTTP
|
(<code>worker_replication_host</code> and <code>worker_replication_http_port</code>)</li>
|
||||||
replication port. If the worker will handle HTTP requests then the
|
<li>If handling HTTP requests, a <code>worker_listeners</code> option with an <code>http</code>
|
||||||
<code>worker_listeners</code> option should be set with a <code>http</code> listener, in the same way
|
listener, in the same way as the <code>listeners</code> option in the shared config.</li>
|
||||||
as the <code>listeners</code> option in the shared config.</p>
|
<li>If handling the <code>^/_matrix/client/v3/keys/upload</code> endpoint, the HTTP URI for
|
||||||
|
the main process (<code>worker_main_http_uri</code>).</li>
|
||||||
|
</ul>
|
||||||
<p>For example:</p>
|
<p>For example:</p>
|
||||||
<pre><code class="language-yaml">worker_app: synapse.app.generic_worker
|
<pre><code class="language-yaml">worker_app: synapse.app.generic_worker
|
||||||
worker_name: generic_worker1
|
worker_name: generic_worker1
|
||||||
|
@ -260,6 +262,8 @@ worker_name: generic_worker1
|
||||||
worker_replication_host: 127.0.0.1
|
worker_replication_host: 127.0.0.1
|
||||||
worker_replication_http_port: 9093
|
worker_replication_http_port: 9093
|
||||||
|
|
||||||
|
worker_main_http_uri: http://localhost:8008/
|
||||||
|
|
||||||
worker_listeners:
|
worker_listeners:
|
||||||
- type: http
|
- type: http
|
||||||
port: 8083
|
port: 8083
|
||||||
|
@ -335,10 +339,12 @@ information.</p>
|
||||||
^/_matrix/client/(api/v1|r0|v3|unstable)/search$
|
^/_matrix/client/(api/v1|r0|v3|unstable)/search$
|
||||||
|
|
||||||
# Encryption requests
|
# Encryption requests
|
||||||
|
# Note that ^/_matrix/client/(r0|v3|unstable)/keys/upload/ requires `worker_main_http_uri`
|
||||||
^/_matrix/client/(r0|v3|unstable)/keys/query$
|
^/_matrix/client/(r0|v3|unstable)/keys/query$
|
||||||
^/_matrix/client/(r0|v3|unstable)/keys/changes$
|
^/_matrix/client/(r0|v3|unstable)/keys/changes$
|
||||||
^/_matrix/client/(r0|v3|unstable)/keys/claim$
|
^/_matrix/client/(r0|v3|unstable)/keys/claim$
|
||||||
^/_matrix/client/(r0|v3|unstable)/room_keys/
|
^/_matrix/client/(r0|v3|unstable)/room_keys/
|
||||||
|
^/_matrix/client/(r0|v3|unstable)/keys/upload/
|
||||||
|
|
||||||
# Registration/login requests
|
# Registration/login requests
|
||||||
^/_matrix/client/(api/v1|r0|v3|unstable)/login$
|
^/_matrix/client/(api/v1|r0|v3|unstable)/login$
|
||||||
|
@ -632,31 +638,16 @@ endpoint as long as either this worker or the main process are configured to
|
||||||
handle it, and are online.</p>
|
handle it, and are online.</p>
|
||||||
<p>If <code>update_user_directory</code> is set to <code>false</code>, and this worker is not running,
|
<p>If <code>update_user_directory</code> is set to <code>false</code>, and this worker is not running,
|
||||||
the above endpoint may give outdated results.</p>
|
the above endpoint may give outdated results.</p>
|
||||||
<h3 id="synapseappfrontend_proxy"><a class="header" href="#synapseappfrontend_proxy"><code>synapse.app.frontend_proxy</code></a></h3>
|
|
||||||
<p>Proxies some frequently-requested client endpoints to add caching and remove
|
|
||||||
load from the main synapse. It can handle REST endpoints matching the following
|
|
||||||
regular expressions:</p>
|
|
||||||
<pre><code>^/_matrix/client/(r0|v3|unstable)/keys/upload
|
|
||||||
</code></pre>
|
|
||||||
<p>If <code>use_presence</code> is False in the homeserver config, it can also handle REST
|
|
||||||
endpoints matching the following regular expressions:</p>
|
|
||||||
<pre><code>^/_matrix/client/(api/v1|r0|v3|unstable)/presence/[^/]+/status
|
|
||||||
</code></pre>
|
|
||||||
<p>This "stub" presence handler will pass through <code>GET</code> request but make the
|
|
||||||
<code>PUT</code> effectively a no-op.</p>
|
|
||||||
<p>It will proxy any requests it cannot handle to the main synapse instance. It
|
|
||||||
must therefore be configured with the location of the main instance, via
|
|
||||||
the <code>worker_main_http_uri</code> setting in the <code>frontend_proxy</code> worker configuration
|
|
||||||
file. For example:</p>
|
|
||||||
<pre><code class="language-yaml">worker_main_http_uri: http://127.0.0.1:8008
|
|
||||||
</code></pre>
|
|
||||||
<h3 id="historical-apps"><a class="header" href="#historical-apps">Historical apps</a></h3>
|
<h3 id="historical-apps"><a class="header" href="#historical-apps">Historical apps</a></h3>
|
||||||
<p><em>Note:</em> Historically there used to be more apps, however they have been
|
<p>The following used to be separate worker application types, but are now
|
||||||
amalgamated into a single <code>synapse.app.generic_worker</code> app. The remaining apps
|
equivalent to <code>synapse.app.generic_worker</code>:</p>
|
||||||
are ones that do specific processing unrelated to requests, e.g. the <code>pusher</code>
|
<ul>
|
||||||
that handles sending out push notifications for new events. The intention is for
|
<li><code>synapse.app.client_reader</code></li>
|
||||||
all these to be folded into the <code>generic_worker</code> app and to use config to define
|
<li><code>synapse.app.event_creator</code></li>
|
||||||
which processes handle the various proccessing such as push notifications.</p>
|
<li><code>synapse.app.federation_reader</code></li>
|
||||||
|
<li><code>synapse.app.frontend_proxy</code></li>
|
||||||
|
<li><code>synapse.app.synchrotron</code></li>
|
||||||
|
</ul>
|
||||||
<h2 id="migration-from-old-config"><a class="header" href="#migration-from-old-config">Migration from old config</a></h2>
|
<h2 id="migration-from-old-config"><a class="header" href="#migration-from-old-config">Migration from old config</a></h2>
|
||||||
<p>There are two main independent changes that have been made: introducing Redis
|
<p>There are two main independent changes that have been made: introducing Redis
|
||||||
support and merging apps into <code>synapse.app.generic_worker</code>. Both these changes
|
support and merging apps into <code>synapse.app.generic_worker</code>. Both these changes
|
||||||
|
|
Loading…
Reference in a new issue