New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed Traefik routing when using Synapse workers #3102
Fixed Traefik routing when using Synapse workers #3102
Conversation
@@ -82,7 +82,7 @@ traefik.http.routers.matrix-synapse-public-client-api.tls.certResolver={{ matrix | |||
|
|||
|
|||
|
|||
{% if matrix_synapse_container_labels_internal_client_api_enabled %} | |||
{% if matrix_synapse_container_labels_internal_client_api_enabled and not matrix_synapse_reverse_proxy_companion_enabled %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check was added here instead of roles/custom/matrix-synapse/defaults/main.yml
since matrix_synapse_container_labels_internal_client_api_enabled
is configured in group_vars/matrix_servers
depending on the proxy setup being used.
There's no need for disabling labels for The companion is only enabled (at least automatically) when workers are enabled:
When workers are enabled, matrix-docker-ansible-deploy/roles/custom/matrix-synapse/defaults/main.yml Lines 181 to 191 in 17859ec
Some of these routes (e.g. I can see a situation where someone keeps workers disabled, but force-enables the companion explicitly (for whatever reason). In such a case, both components would end up registering the same labels. It shouldn't hurt though, because whichever services ends up receiving these routes, can handle them correctly. This is because:
So.. the current configuraton should be fine. However, I had forgotten to make use of |
Traefik seems to have routing priority conflicts when using the reverse proxy companion (and likely MMR as well, though I did not have an issue on my server). With the default priority rules being used, I have seen requests being routed directly to the Synapse container instead of the reverse proxy companion container.
I went with disabling registration of Synapse routes instead of adjusting priority values if the reverse proxy companion is enabled. Tested the changes for correct behavior of the reverse proxy companion and MMR routing, but I don't use any of the bridges/bots, so those roles have not been tested.