From 422eb76aad51936d2fdb7ced7b77ca1a7d05a53b Mon Sep 17 00:00:00 2001 From: villepeh <100730729+villepeh@users.noreply.github.com> Date: Mon, 12 Dec 2022 15:27:18 +0200 Subject: [PATCH 01/10] Include `x_forwarded` entry in the config example --- docs/systemd-with-workers/workers/event_persister.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/systemd-with-workers/workers/event_persister.yaml b/docs/systemd-with-workers/workers/event_persister.yaml index 9bc6997bad99..c11d5897b18e 100644 --- a/docs/systemd-with-workers/workers/event_persister.yaml +++ b/docs/systemd-with-workers/workers/event_persister.yaml @@ -17,6 +17,7 @@ worker_listeners: # #- type: http # port: 8035 + # x_forwarded: true # resources: # - names: [client] From 7cdffe803822111dc709546c7648bcdef82bb0d0 Mon Sep 17 00:00:00 2001 From: villepeh <100730729+villepeh@users.noreply.github.com> Date: Mon, 12 Dec 2022 15:29:37 +0200 Subject: [PATCH 02/10] Include `x_forwarded` entry in the example config. --- docs/systemd-with-workers/workers/media_worker.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/systemd-with-workers/workers/media_worker.yaml b/docs/systemd-with-workers/workers/media_worker.yaml index eb34d1249231..8ad046f11a5b 100644 --- a/docs/systemd-with-workers/workers/media_worker.yaml +++ b/docs/systemd-with-workers/workers/media_worker.yaml @@ -8,6 +8,7 @@ worker_replication_http_port: 9093 worker_listeners: - type: http port: 8085 + x_forwarded: true resources: - names: [media] From 05959fc028b106963c14d1240a8f4cf80ab49ff1 Mon Sep 17 00:00:00 2001 From: villepeh <100730729+villepeh@users.noreply.github.com> Date: Mon, 12 Dec 2022 15:31:24 +0200 Subject: [PATCH 03/10] Include `x_forwarded` entry in the example config ...and remove `worker_main_http_uri` --- docs/systemd-with-workers/workers/generic_worker.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/systemd-with-workers/workers/generic_worker.yaml b/docs/systemd-with-workers/workers/generic_worker.yaml index 6e7b60886e72..a858f99ed1d9 100644 --- a/docs/systemd-with-workers/workers/generic_worker.yaml +++ b/docs/systemd-with-workers/workers/generic_worker.yaml @@ -5,11 +5,10 @@ worker_name: generic_worker1 worker_replication_host: 127.0.0.1 worker_replication_http_port: 9093 -worker_main_http_uri: http://localhost:8008/ - worker_listeners: - type: http port: 8083 + x_forwarded: true resources: - names: [client, federation] From 1a2fea95b74e2882ccc5512bcf532bf63ce74b1b Mon Sep 17 00:00:00 2001 From: villepeh <100730729+villepeh@users.noreply.github.com> Date: Mon, 12 Dec 2022 15:41:54 +0200 Subject: [PATCH 04/10] Include `x_forwarded`, rm `worker_main_http_uri`.. ...and add a hint about pid files. --- .../workers-bash-scripts/create-multiple-generic-workers.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/workers-bash-scripts/create-multiple-generic-workers.md b/contrib/workers-bash-scripts/create-multiple-generic-workers.md index c9be707b3c6e..6fbe788fc29d 100644 --- a/contrib/workers-bash-scripts/create-multiple-generic-workers.md +++ b/contrib/workers-bash-scripts/create-multiple-generic-workers.md @@ -15,19 +15,19 @@ worker_name: generic_worker$i worker_replication_host: 127.0.0.1 worker_replication_http_port: 9093 -worker_main_http_uri: http://localhost:8008/ - worker_listeners: - type: http port: 808$i + x_forwarded: true resources: - names: [client, federation] worker_log_config: /etc/matrix-synapse/generic-worker-log.yaml +#worker_pid_file: DATADIR/generic_worker$i.pid EOF done ``` This would create five generic workers with a unique `worker_name` field in each file and listening on ports 8081-8085. -Customise the script to your needs. +`worker_pid_file` is required if you `worker_daemonize` is `true`. Uncomment and modify the line if needed. From 26d062f23b2b97a68dcd117c114825927a45ed56 Mon Sep 17 00:00:00 2001 From: villepeh <100730729+villepeh@users.noreply.github.com> Date: Mon, 12 Dec 2022 15:43:25 +0200 Subject: [PATCH 05/10] Update create-multiple-generic-workers.md --- contrib/workers-bash-scripts/create-multiple-generic-workers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/workers-bash-scripts/create-multiple-generic-workers.md b/contrib/workers-bash-scripts/create-multiple-generic-workers.md index 6fbe788fc29d..5a8243ce8151 100644 --- a/contrib/workers-bash-scripts/create-multiple-generic-workers.md +++ b/contrib/workers-bash-scripts/create-multiple-generic-workers.md @@ -30,4 +30,4 @@ done This would create five generic workers with a unique `worker_name` field in each file and listening on ports 8081-8085. -`worker_pid_file` is required if you `worker_daemonize` is `true`. Uncomment and modify the line if needed. +Customise the script to your needs. Note that `worker_pid_file` is required if you `worker_daemonize` is `true`. Uncomment and/or modify the line if needed. From 8c3e5c6e20493793c62e7ecf1fd8d0470274a502 Mon Sep 17 00:00:00 2001 From: villepeh <100730729+villepeh@users.noreply.github.com> Date: Mon, 12 Dec 2022 15:55:30 +0200 Subject: [PATCH 06/10] Include `x_forwarded`, add hints about pidfiles... ....and general cleanup --- .../create-multiple-stream-writers.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/contrib/workers-bash-scripts/create-multiple-stream-writers.md b/contrib/workers-bash-scripts/create-multiple-stream-writers.md index 0d2ca780a6a3..8dce5bd97607 100644 --- a/contrib/workers-bash-scripts/create-multiple-stream-writers.md +++ b/contrib/workers-bash-scripts/create-multiple-stream-writers.md @@ -8,7 +8,9 @@ It also prints out the example lines for Synapse main configuration file. Remember to route necessary endpoints directly to a worker associated with it. -If you run the script as-is, it will create workers with the replication listener starting from port 8034 and another, regular http listener starting from 8044. If you don't need all of the stream writers listed in the script, just remove them from the ```STREAM_WRITERS``` array. +If you run the script as-is, it will create workers with the replication listener starting from port 8034 and another, regular http listener starting from 8044. If you don't need all of the stream writers listed in the script, just remove them from the ```STREAM_WRITERS``` array. + +Hint: Note that `worker_pid_file` is required if you `worker_daemonize` is `true`. Uncomment and/or modify the line if needed. ```sh #!/bin/bash @@ -46,9 +48,11 @@ worker_listeners: - type: http port: $(expr $HTTP_START_PORT + $i) + x_forwarded: true resources: - names: [client] +#worker_pid_file: DATADIR/${STREAM_WRITERS[$i]}.pid worker_log_config: /etc/matrix-synapse/stream-writer-log.yaml EOF HOMESERVER_YAML_INSTANCE_MAP+=$" ${STREAM_WRITERS[$i]}_stream_writer: @@ -91,7 +95,9 @@ Simply run the script to create YAML files in the current folder and print out t ```console $ ./create_stream_writers.sh - +``` +You should receive an output similar to the following: +```console # Add these lines to your homeserver.yaml. # Don't forget to configure your reverse proxy and # necessary endpoints to their respective worker. From d9db17bf35949be0604ec6cd1c14d44637ba6905 Mon Sep 17 00:00:00 2001 From: villepeh <100730729+villepeh@users.noreply.github.com> Date: Mon, 12 Dec 2022 16:01:58 +0200 Subject: [PATCH 07/10] typo fix --- contrib/workers-bash-scripts/create-multiple-stream-writers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/workers-bash-scripts/create-multiple-stream-writers.md b/contrib/workers-bash-scripts/create-multiple-stream-writers.md index 8dce5bd97607..efa5dea3050a 100644 --- a/contrib/workers-bash-scripts/create-multiple-stream-writers.md +++ b/contrib/workers-bash-scripts/create-multiple-stream-writers.md @@ -10,7 +10,7 @@ Remember to route necessary endpoints directly to a worker associated with it. If you run the script as-is, it will create workers with the replication listener starting from port 8034 and another, regular http listener starting from 8044. If you don't need all of the stream writers listed in the script, just remove them from the ```STREAM_WRITERS``` array. -Hint: Note that `worker_pid_file` is required if you `worker_daemonize` is `true`. Uncomment and/or modify the line if needed. +Hint: Note that `worker_pid_file` is required if `worker_daemonize` is `true`. Uncomment and/or modify the line if needed. ```sh #!/bin/bash From 8c7968bd558ff6a82b4bf3fe27960ebf766ac3bf Mon Sep 17 00:00:00 2001 From: villepeh <100730729+villepeh@users.noreply.github.com> Date: Mon, 12 Dec 2022 16:02:28 +0200 Subject: [PATCH 08/10] typo fix --- contrib/workers-bash-scripts/create-multiple-generic-workers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/workers-bash-scripts/create-multiple-generic-workers.md b/contrib/workers-bash-scripts/create-multiple-generic-workers.md index 5a8243ce8151..63d0038a7d8a 100644 --- a/contrib/workers-bash-scripts/create-multiple-generic-workers.md +++ b/contrib/workers-bash-scripts/create-multiple-generic-workers.md @@ -30,4 +30,4 @@ done This would create five generic workers with a unique `worker_name` field in each file and listening on ports 8081-8085. -Customise the script to your needs. Note that `worker_pid_file` is required if you `worker_daemonize` is `true`. Uncomment and/or modify the line if needed. +Customise the script to your needs. Note that `worker_pid_file` is required if `worker_daemonize` is `true`. Uncomment and/or modify the line if needed. From 16a6e624e6ca76adc8eb8137484bbcfd5d8092d3 Mon Sep 17 00:00:00 2001 From: villepeh <100730729+villepeh@users.noreply.github.com> Date: Mon, 12 Dec 2022 16:06:15 +0200 Subject: [PATCH 09/10] Create 14665.doc --- changelog.d/14665.doc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/14665.doc diff --git a/changelog.d/14665.doc b/changelog.d/14665.doc new file mode 100644 index 000000000000..86d6288121da --- /dev/null +++ b/changelog.d/14665.doc @@ -0,0 +1 @@ +Include `x_forwarded` entry in the HTTP listener example configs and remove the remaining `worker_main_http_uri` entries. From e85d08801f2b86aa48a84ca420f089b3d665fd35 Mon Sep 17 00:00:00 2001 From: villepeh <100730729+villepeh@users.noreply.github.com> Date: Mon, 12 Dec 2022 16:18:19 +0200 Subject: [PATCH 10/10] Rename 14665.doc to 14667.doc --- changelog.d/{14665.doc => 14667.doc} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog.d/{14665.doc => 14667.doc} (100%) diff --git a/changelog.d/14665.doc b/changelog.d/14667.doc similarity index 100% rename from changelog.d/14665.doc rename to changelog.d/14667.doc