From 6725c7f3f06b400cdb157da58de5b717d722483b Mon Sep 17 00:00:00 2001 From: Sasi Olin Date: Jun 13 2022 07:18:01 +0000 Subject: Fix the schema of workers --- diff --git a/pillar/role/matrix.sls b/pillar/role/matrix.sls index b3a3781..43ddc50 100644 --- a/pillar/role/matrix.sls +++ b/pillar/role/matrix.sls @@ -17,7 +17,7 @@ profile: - ^/_matrix/client/(api/v1|r0|v3)/initialSync$ - ^/_matrix/client/(api/v1|r0|v3)/rooms/[^/]+/initialSync$ workers: - - sync1: 8501 + sync1: 8501 - rest: - ^/_matrix/federation/v1/event/ - ^/_matrix/federation/v1/state/ @@ -45,8 +45,8 @@ profile: - ^/_matrix/federation/v1/send/ - ^/_matrix/federation/v1/groups/ workers: - - federation_requests1: 8511 - - federation_requests2: 8512 + federation_requests1: 8511 + federation_requests2: 8512 upstream_balancing: ip_hash; - rest: - ^/_matrix/client/(api/v1|r0|v3|unstable)/createRoom$ @@ -71,8 +71,8 @@ profile: - ^/_matrix/client/(api/v1|r0|v3|unstable)/joined_rooms$ - ^/_matrix/client/(api/v1|r0|v3|unstable)/search$ workers: - - client1: 8521 - - client2: 8522 + client1: 8521 + client2: 8522 - rest: - ^/_matrix/client/(api/v1|r0|v3|unstable)/login$ - ^/_matrix/client/(r0|v3|unstable)/register$ @@ -86,7 +86,7 @@ profile: - ^/_synapse/client/saml2/authn_response$ - ^/_matrix/client/(api/v1|r0|v3|unstable)/login/cas/ticket$ workers: - - login: 8531 # There can be only one login worker + login: 8531 # There can be only one login worker - rest: - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/redact - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/send @@ -95,45 +95,39 @@ profile: - ^/_matrix/client/(api/v1|r0|v3|unstable)/join/ - ^/_matrix/client/(api/v1|r0|v3|unstable)/profile/ workers: - - event1: 8541 - - event2: 8542 + event1: 8541 + event2: 8542 pusher: - - pusher: - - workers: - - pusher1: 8551 - - pusher2: 8552 + - workers: + pusher1: 8551 + pusher2: 8552 appservice: - - appservice: - - workers: - - appservice: 8561 + - workers: + appservice: 8561 federation_sender: - - federation_sender: - - workers: - - federation_sender1: 8571 - - federation_sender2: 8572 + - workers: + federation_sender1: 8571 + federation_sender2: 8572 media_repository: - - media_repository: - - rest: - - ^/_matrix/media/ - workers: - - media1: 8581 - - media2: 8582 - resources: - - media + - rest: + - ^/_matrix/media/ + workers: + media1: 8581 + media2: 8582 + resources: + - media user_dir: - - user_dir: - - rest: - - ^/_matrix/client/(api/v1|r0|v3|unstable)/user_directory/search$ - workers: - - user_dir: 8591 + - rest: + - ^/_matrix/client/(api/v1|r0|v3|unstable)/user_directory/search$ + workers: + user_dir: 8591 frontend_proxy: - - frontend_proxy: - - rest: - - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/upload - workers: - - frontend_proxy: 8601 - config: - - worker_main_http_uri: http://127.0.0.1:8008 + - rest: + - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/upload + workers: + frontend_proxy: 8601 + config: + - worker_main_http_uri: http://127.0.0.1:8008 appservices: diff --git a/salt/profile/matrix/config.sls b/salt/profile/matrix/config.sls index e94aeba..8f8ddb4 100644 --- a/salt/profile/matrix/config.sls +++ b/salt/profile/matrix/config.sls @@ -67,7 +67,7 @@ workers_nginx_file: {% for app, types in workers.items() %} {% for type in types %} -{% for worker, port in type.get('workers') %} +{% for worker, port in type.get('workers').items() %} /etc/matrix-synapse/workers/{{worker}}.yaml: file.managed: - source: salt://profile/matrix/files/worker.yaml diff --git a/salt/profile/matrix/files/workers.nginx b/salt/profile/matrix/files/workers.nginx index 9b8c5ed..e8a7044 100644 --- a/salt/profile/matrix/files/workers.nginx +++ b/salt/profile/matrix/files/workers.nginx @@ -5,7 +5,7 @@ upstream {{ app }}_{{ loop.index }} { {{ type.get('upstream_balancing') }} - {%- for worker, port in type.get('workers') %} + {%- for worker, port in type.get('workers').items() %} server 127.0.0.1:{{ port }}; # {{ worker }} {%- endfor %} } diff --git a/salt/profile/matrix/init.sls b/salt/profile/matrix/init.sls index bf93f11..faf7496 100644 --- a/salt/profile/matrix/init.sls +++ b/salt/profile/matrix/init.sls @@ -14,7 +14,7 @@ synapse_restart: {% for app, types in workers.items() %} {% for type in types %} -{% for worker, port in type.get('workers') %} +{% for worker, port in type.get('workers').items() %} {{worker}}_service: service.running: