Skip to content
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

user_directory_search redirect not working anymore #2954

Closed
janonym1 opened this issue Oct 19, 2023 · 16 comments
Closed

user_directory_search redirect not working anymore #2954

janonym1 opened this issue Oct 19, 2023 · 16 comments

Comments

@janonym1
Copy link

janonym1 commented Oct 19, 2023

Describe the bug
Hi!
We have matrix_nginx_proxy_proxy_matrix_user_directory_search_enabled: true set because we have to run our own search service (since we have a complicated LDAP environment), which runs as a service in the background and accepts search requests at port 8088. The search backend service runs fine and I can call the search API over curl as always.

However, it seems that the routing/redirecting of the API with /_matrix/client/r0/user_directory/search is not working anymore. I am not sure when exactly this happened but it must have been in the last few months tops as it worked with the same config before that.

To Reproduce
My related config in the vars.yml file looks like this:

#Controls whether proxying for the User Directory Search API (`/_matrix/client/r0/user_directory/search`) should be done (on the matrix domain).
# This can be used to forward the API endpoint to another service, augmenting the functionality of Synapse's own User Directory Search.
matrix_nginx_proxy_proxy_matrix_user_directory_search_enabled: true
matrix_nginx_proxy_proxy_matrix_user_directory_search_addr_sans_container: "127.0.0.1:8088"
matrix_nginx_proxy_proxy_matrix_user_directory_search_addr_with_container: "1.2.3.4:8088"
matrix_synapse_reverse_proxy_companion_container_client_api_host_bind_port: "1.2.3.4:8008"
# Controls whether the matrix-synapse-reverse-proxy-companion container exposes its HTTP Client-Server API port (tcp/8008 in the container).
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8008"), or empty string to not expose.
matrix_synapse_reverse_proxy_companion_container_client_api_host_bind_port: "1.2.3.4:8008"

Note: we needed client_api_host_bind_port for our search workflow

Previously this worked fine but with the latest updates, this redirection to our search service broke somehow. I assume it has to do with the ongoing migration over to traefik and away from nginx but I am not sure, where exactly I should try define the new redirection.
We are using traefik matrix_playbook_reverse_proxy_type: playbook-managed-traefik but there are still some services running using the nginx proxy (e.g. oidc, basic auth, metrics..)

Looking at the server, we have the matrix-nginx-proxy.service, matrix-traefik.service as well as our worker nodes running through matrix_synapse_workers_enabled: true. I assume with time, most (if not all) services and proxies will be completely migrated to traefik and I am not sure, if the matrix_nginx_proxy_proxy_matrix_user_directory_search_addr_sans_container is still working. I assumed so, since the matrix-nginx-proxy also still exists.

Do I have to write some rules for traefik or does this sill get handled by the (for now still existing) nginx-proxy?

Expected behavior
The search flow /_matrix/client/r0/user_directory/search is redirected to our search backend

Matrix Server:

  • OS: Ubuntu 20.04.6 LTS Server
  • amd64
  • synapse v1.92.3
@janonym1
Copy link
Author

I can see that the override for the user_directory correctly ist correctly set inside the /matrix/nginx-proxy/conf.d/matrix-domain.conf file:

location ^~ /_matrix/client/r0/user_directory/search {
                        resolver 127.0.0.11 valid=5s;
                        set $backend "1.2.3.4:8088";
                        proxy_pass http://$backend;

                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

the search backend client is handling both r0 or v3 (/_matrix/client/r0/user_directory/search or /_matrix/client/v3/user_directory/search)

@janonym1
Copy link
Author

janonym1 commented Oct 19, 2023

Slavi suggested changing the location to location ~ /_matrix/client/[0-9a-z]+/user_directory/search to make sure the r0 as well as the v3 (and future versions) work as well. Unfortunately that didnt help in my case

@janonym1
Copy link
Author

I dug a little deeper with DEBUG log level and testing by making a search query; when prompting a search with element - add person and type "test")

I can see it makes its way through matrix-traefik:

Oct 24 16:31:10 hostname123 matrix-traefik[32376]: 1.2.3.4 - - [24/Oct/2023:14:31:10 +0000] "OPTIONS /_matrix/client/v3/user_directory/search HTTP/2.0" 204 0 "-" "-" 307 "matrix-nginx-proxy-matrix-client@docker" "http://172.25.0.4:8080" 3ms
Oct 24 16:31:10 hostname123 matrix-traefik[32376]: 1.2.3.4 - - [24/Oct/2023:14:31:10 +0000] "POST /_matrix/client/v3/user_directory/search HTTP/2.0" 200 50 "-" "-" 308 "matrix-nginx-proxy-matrix-client@docker" "http://172.25.0.4:8080" 8ms

as well as matrix-nginx-proxy:

Oct 24 16:31:10 hostname123 matrix-nginx-proxy[32258]: 172.25.0.5 - - [24/Oct/2023:14:31:10 +0000] "OPTIONS /_matrix/client/v3/user_directory/search HTTP/1.1" 204 0 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0" "1.2.3.4"
Oct 24 16:31:10 hostname123 matrix-nginx-proxy[32258]: 172.25.0.5 - - [24/Oct/2023:14:31:10 +0000] "POST /_matrix/client/v3/user_directory/search HTTP/1.1" 200 61 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0" "1.2.3.4" 

I can also see the search query made in matrix-synapse-worker-user-dir-0:

Oct 24 16:31:10 hostname123 matrix-synapse-worker-user-dir-0[29910]: 2023-10-24 14:31:10,162 - synapse.access.http.18661 - 420 - DEBUG - OPTIONS-37 - 1.2.3.4 - 18661 - Received request: OPTIONS /_matrix/client/v3/user_directory/search
Oct 24 16:31:10 hostname123 matrix-synapse-worker-user-dir-0[29910]: 2023-10-24 14:31:10,162 - synapse.access.http.18661 - 465 - DEBUG - OPTIONS-37 - 1.2.3.4 - 18661 - {None} Processed request: 0.000sec/-0.000sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 0B 204 "OPTIONS /_matrix/client/v3/user_directory/search HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0" [0 dbevts]
Oct 24 16:31:10 hostname123 matrix-synapse-worker-user-dir-0[29910]: 2023-10-24 14:31:10,170 - synapse.access.http.18661 - 420 - DEBUG - POST-38 - 1.2.3.4 - 18661 - Received request: POST /_matrix/client/v3/user_directory/search
Oct 24 16:31:10 hostname123 matrix-synapse-worker-user-dir-0[29910]: 2023-10-24 14:31:10,171 - synapse.storage.SQL - 453 - DEBUG - POST-38 - [SQL] {search_user_dir-5f} WITH matching_users AS ( SELECT user_id, vector FROM user_directory_search WHERE vector @@ to_tsquery('simple', ?) LIMIT 10000 ) SELECT d.user_id AS user_id, display_name, avatar_url FROM matching_users as t INNER JOIN user_directory AS d USING (user_id) LEFT JOIN users AS u ON t.user_id = u.name WHERE user_id != ? AND (u.locked IS NULL OR u.locked = FALSE) ORDER BY (CASE WHEN d.user_id IS NOT NULL THEN 4.0 ELSE 1.0 END) * (CASE WHEN display_name IS NOT NULL THEN 1.2 ELSE 1.0 END) * (CASE WHEN avatar_url IS NOT NULL THEN 1.2 ELSE 1.0 END) * ( 3 * ts_rank_cd( '{0.1, 0.1, 0.9, 1.0}', vector, to_tsquery('simple', ?), 8 ) + ts_rank_cd( '{0.1, 0.1, 0.9, 1.0}', vector, to_tsquery('simple', ?), 8 ) ) * (CASE WHEN user_id LIKE ? THEN 2.0 ELSE 1.0 END) DESC, display_name IS NULL, avatar_url IS NULL LIMIT ?
Oct 24 16:31:10 hostname123 matrix-synapse-worker-user-dir-0[29910]: 2023-10-24 14:31:10,176 - synapse.access.http.18661 - 465 - INFO - POST-38 - 1.2.3.4 - 18661 - {@username:matrix-domain.com} Processed request: 0.005sec/0.000sec (0.002sec, 0.000sec) (0.000sec/0.004sec/1) 30B 200 "POST /_matrix/client/v3/user_directory/search HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0" [0 dbevts] 

I can also see it in the matrix-synapse-worker-user-dir-0

Oct 24 16:57:00 hostname123 matrix-synapse-worker-user-dir-0[29910]: 2023-10-24 14:57:00,388 - synapse.access.http.18661 - 420 - DEBUG - OPTIONS-144 - 1.2.3.4 - 18661 - Received request: OPTIONS /_matrix/client/v3/user_directory/search
Oct 24 16:57:00 hostname123 matrix-synapse-worker-user-dir-0[29910]: 2023-10-24 14:57:00,388 - synapse.access.http.18661 - 465 - DEBUG - OPTIONS-144 - 1.2.3.4 - 18661 - {None} Processed request: 0.000sec/-0.000sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 0B 204 "OPTIONS /_matrix/client/v3/user_directory/search HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0" [0 dbevts]
Oct 24 16:57:00 hostname123 matrix-synapse-worker-user-dir-0[29910]: 2023-10-24 14:57:00,395 - synapse.access.http.18661 - 420 - DEBUG - POST-145 - 1.2.3.4 - 18661 - Received request: POST /_matrix/client/v3/user_directory/search
Oct 24 16:57:00 hostname123 matrix-synapse-worker-user-dir-0[29910]: 2023-10-24 14:57:00,396 - synapse.storage.txn - 742 - DEBUG - POST-145 - [TXN START] {search_user_dir-119}
Oct 24 16:57:00 hostname123 matrix-synapse-worker-user-dir-0[29910]: 2023-10-24 14:57:00,396 - synapse.storage.SQL - 453 - DEBUG - POST-145 - [SQL] {search_user_dir-119} WITH matching_users AS ( SELECT user_id, vector FROM user_directory_search WHERE vector @@ to_tsquery('simple', ?) LIMIT 10000 ) SELECT d.user_id AS user_id, display_name, avatar_url FROM matching_users as t INNER JOIN user_directory AS d USING (user_id) LEFT JOIN users AS u ON t.user_id = u.name WHERE user_id != ? AND (u.locked IS NULL OR u.locked = FALSE) ORDER BY (CASE WHEN d.user_id IS NOT NULL THEN 4.0 ELSE 1.0 END) * (CASE WHEN display_name IS NOT NULL THEN 1.2 ELSE 1.0 END) * (CASE WHEN avatar_url IS NOT NULL THEN 1.2 ELSE 1.0 END) * ( 3 * ts_rank_cd( '{0.1, 0.1, 0.9, 1.0}', vector, to_tsquery('simple', ?), 8 ) + ts_rank_cd( '{0.1, 0.1, 0.9, 1.0}', vector, to_tsquery('simple', ?), 8 ) ) * (CASE WHEN user_id LIKE ? THEN 2.0 ELSE 1.0 END) DESC, display_name IS NULL, avatar_url IS NULL LIMIT ?
Oct 24 16:57:00 hostname123 matrix-synapse-worker-user-dir-0[29910]: 2023-10-24 14:57:00,396 - synapse.storage.SQL - 458 - DEBUG - POST-145 - [SQL values] {search_user_dir-119} ("('test':* | 'test')", '@username:matrix-domain.com', "'test'", "'test':*", '%:matrix-domain.com', 11)
Oct 24 16:57:00 hostname123 matrix-synapse-worker-user-dir-0[29910]: 2023-10-24 14:57:00,414 - synapse.storage.SQL - 479 - DEBUG - POST-145 - [SQL time] {search_user_dir-119} 0.018586 sec
Oct 24 16:57:00 hostname123 matrix-synapse-worker-user-dir-0[29910]: 2023-10-24 14:57:00,416 - synapse.storage.txn - 846 - DEBUG - POST-145 - [TXN END] {search_user_dir-119} 0.020333 sec
Oct 24 16:57:00 hostname123 matrix-synapse-worker-user-dir-0[29910]: 2023-10-24 14:57:00,417 - synapse.access.http.18661 - 465 - INFO - POST-145 - 1.2.3.4 - 18661 - {@username:matrix-domain.com} Processed request: 0.021sec/0.000sec (0.002sec, 0.000sec) (0.000sec/0.020sec/1) 640B 200 "POST /_matrix/client/v3/user_directory/search HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0" [0 dbevts] 

It seems to me, that it falls back to the default search (which never worked properly with a more complicated search anyway) and and ignores the directory_search redirect to our search backend completely.

@jolly-jump
Copy link
Contributor

Hi. I can see this as well, probably from a different angle, or you can say: different problem:

I am using ma1sd service provider, and it seems the new Matrix Spec https://spec.matrix.org/latest/client-server-api/#user-directory
is not implemented (yet); https://github.com/ma1uta/ma1sd/blob/master/src/main/java/io/kamax/mxisd/http/undertow/handler/directory/v1/UserDirectorySearchHandler.java

Since r0 and v3 seem to be identical, I used a workaround to rewrite v3 -> r0.

location ~ /_matrix/client/[0-9a-z]+/user_directory/search {
                        resolver 127.0.0.11 valid=5s;
                        set $backend "matrix-ma1sd:8090";
                        rewrite ^(.*?)/v3/(.*?)$  $1/r0/$2 break;
                        proxy_pass http://$backend;

                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

This makes my service provider ma1sd work again.

@jolly-jump
Copy link
Contributor

Hi,
the fix is nice, but it breaks my configuration. Do you want me to open up a new issue?
Re-reading I see that @janonym1 is using "maiden", which is probably stand-alone for now and not managed with this ansible framework.

My setup is "older":

  • ma1sd as authenticator -> LDAP
  • ma1sd as identity server

Since the newer clients all use "v3" and ma1sd does not understand it, my last post was a workaround to make it work again.

Now that you catch [0-9a-z]+ both versions with your "location", my "location" workaround seizes to work.

What would be the thing to do?

  • try maiden?
  • try another workaround? how?
  • try synapse_ldap3 ? Is there a way to search for users using synapse_ldap3?

here my config up until now:

matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks:
  - |
    location ~ /_matrix/client/v3/user_directory/search {
               resolver 127.0.0.11 valid=5s;
               set $backend "matrix-ma1sd:8090";
               rewrite ^(.*?)/v3/(.*?)$  $1/r0/$2 break;
               proxy_pass http://$backend;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
  - |
matrix_nginx_proxy_worker_processes: 6
matrix_nginx_proxy_worker_connections: 4096
matrix_nginx_proxy_proxy_matrix_user_directory_search_enabled: "{{ matrix_ma1sd_enabled }}"

@janonym1
Copy link
Author

janonym1 commented Nov 6, 2023

I am using ma1sd (for identity and login stuff) as well as maiden (just for a nicer search) but I cant seem to get the redirection working.

Now it seems that the redirect variable matrix_nginx_proxy_proxy_matrix_user_directory_search_addr_sans_container does not get written correctly into my effective matrix-domain.conf nginx conf, it always defaults to the ma1sd one: set $backend "matrix-ma1sd:8090"; Maybe the variable gets overwritten somewhere by its default value, if ma1sd is enabled?

edit/update: I tried hardcoding my maiden/search-IP, so my effective matrix/nginx-proxy/conf.d/matrix-domain.conf looks like this

        location ^~ /_matrix/client/[0-9a-z]+/user_directory/search {
                        resolver 127.0.0.11 valid=5s;
                        set $backend "1.2.3.4:8088";
                        proxy_pass http://$backend;

                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

However, the search still does not redirect it to maiden, since the search just defaults to the faulty ma1sd/synapse search. Maybe I am looking in the wrong place?

@janonym1
Copy link
Author

janonym1 commented Nov 6, 2023

@jolly-jump: I think you just need to delete the rewrite part and write the regex for the location ~ /_matrix/client/[0-9a-z]+/user_directory/search. At least on my system, it always redirects to the default user directory search, which is matrix-ma1sd:8090 and should work for you.

you probably dont need the extra matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks and can just use the default values if matrix_ma1sd_enabled is true

@jolly-jump
Copy link
Contributor

jolly-jump commented Nov 6, 2023 via email

@janonym1
Copy link
Author

janonym1 commented Nov 6, 2023

You could be right, its possible that my synapse-homserver or synapseSQL itself does the search (instead of redirecting to ma1sd). I get search results even without my backend working, so I need to check if the redirect even reaches ma1sd and is involved or the synapse-default search (or some default) takes over

@janonym1
Copy link
Author

janonym1 commented Nov 6, 2023

Okay, I am not now sure, how and why my redirect ever worked in the first place :D

I played around with your workaround and suggestions, so my effective config looks like:

        location ^~ /_matrix/client/v3/user_directory/search {
                        resolver 127.0.0.11 valid=5s;
                        set $backend "1.2.3.4:8088";
                        rewrite ^(.*?)/v3/(.*?)$  $1/r0/$2 break;
                        proxy_pass http://$backend;

                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

Note: (r0|v3) instead of v3 (or any regex for that matter) didnt work but v3 did

and now my backend maiden search (or ma1sd for that regard with: set $backend "matrix-ma1sd:8090"; works perfectly fine again!

I assume, something with the v3 synapse directory search and its API handling changed over last months since my simple redirect worked fine by then (Back then, I just went with matrix_nginx_proxy_proxy_matrix_user_directory_search_addr_sans_container: "1.2.3.4:8088")

@janonym1
Copy link
Author

janonym1 commented Nov 6, 2023

Maybe we should enable just v3 by default since it seems enforced nowadays anyways and add a condition for the rewrite rule, when ma1sd is enabled? something like roles/custom/matrix-nginx-proxy/templates/nginx/conf.d/matrix-domain.conf.j2:

 location ^~ /_matrix/client/v3/user_directory/search {
            {% if matrix_ma1sd_enabled %}
            #use r0 instead of new v3 API version so ma1sd can still work with it
            rewrite ^(.*?)/v3/(.*?)$  $1/r0/$2 break;
[...]

@jolly-jump
Copy link
Contributor

jolly-jump commented Nov 7, 2023

Note: (r0|v3) instead of v3 (or any regex for that matter) didnt work but v3 did

Yes, that is what I stumbled upon as well... and now that you mention it again:

The reason is the modifier ^~ in the nginx location: https://nginx.org/en/docs/http/ngx_http_core_module.html#location
regular expression will not be checked. REplacing the ^~ with an ~ works then also with regular expressions.
So @spantaleev : the commit ebe7e3b probably made the user_directory search not work at all anymore, even with the old clients that use "r0" and ma1sd which would handle "r0, since now neither "r0" nor "v3" will match.

your last comment "use v3 by default" and add a rewrite rule for ma1sd makes sense to me, although this might be the tip of an iceberg. @spantaleev found at least another location where "r0" is used and I am not able to say, if this is enough.

just a hint, seemingly unrelated:
Since my update (Jan23 -> Nov 23) I have to use matrix_synapse_password_config_enabled: true which was false before. Otherwise I get a response: "no login flows configured for this client".
The reason could be that ma1sd as the identity provider now does not respond correctly to synapse anymore and setting above variable makes the client believe I can log in locally, which nobody does. Yet, the login using ma1sd works perfectly.

spantaleev added a commit that referenced this issue Nov 8, 2023
…x/client/r0)

Hopefully fixes: #2954

Untested.

Patch inspired by: #2954 (comment)
@spantaleev
Copy link
Owner

In ad23055, I've made some changes inspired by this comment by jolly-jump. Hopefully this fixes the issues. Feel free to experiment further and submit a proper (tested) PR though.

@jolly-jump
Copy link
Contributor

Thanks for the quick reaction.
Added another PR which is tested. #2985

@jolly-jump
Copy link
Contributor

Ok. I dug a little deeper for my sanity.
https://spec.matrix.org/v1.8/changelog/#client-server-api-7
This is the mentioning where in Nov. 21 the new Spec declared that all r0 were to be replaced with v3, "as a starting point".
and @turt2live warned the repo maintainers of ma1sd here: ma1uta/ma1sd#102 that Matrix 1.1 spec is coming, especially matrix-org/sydent#424 to use "v3" endpoints.

I guess, ma1sd is coming to its end, if there is no own updating it to the recent matrix spec.
maiden, on the other hand, claims to handle more recent versions of the API, at least the v3 regexp. But the development seems to has slowed down and I am not sure, if maiden can handle my LDAP-users.

@spantaleev
Copy link
Owner

Thanks for the historical recap!

Interestingly, I've never heard of maiden.

ma1sd is dead. It can be forked and it shouldn't be too hard to add the v3 URL endpoints (and point them to the same code paths that handle r0 now), or to rename r0 to v3. Of course, someone needs to have interest in maintaining this fork. The playbook would gladly switch (once again) to something that works.

spantaleev pushed a commit that referenced this issue Nov 9, 2023
* Update matrix-domain.conf.j2

exchanged "^~" with "~" as a pattern matching in the location part.
I am very sure, that it only works using "~". I am not quite sure though, if this is the right way to do it, because "~" is probably more expensive than "^~"

the rewrite has to be behind the definition of the $backend. Otherwise nginx will fail to work. This is probably because "break" goes directly to the proxy_pass which uses $backend.

* Update matrix-domain.conf.j2

also change the order of "set $backend" and "rewrite" here in the 3pid registration section

* Update matrix-domain.conf.j2 - repeat v3_to_r0 rewrite in else-statement

as you said: repeat it for the else-case, where the ma1sd might be running on sans_container.

* Update matrix-domain.conf.j2 - corrected wrong variable

atrix_nginx_proxy_proxy_matrix_3pid_registration_v3_to_r0_redirect_enabled
is the right variable to check (twice) in the corresponding branch.

* matrix-domain.conf.j2 - fix-2954: change all whitespaces to tabs as you do it

---------

Co-authored-by: Tobias Küchel <t.kuechel@humboldt-ka.de>
cvwright pushed a commit to cvwright/matrix-docker-ansible-deploy that referenced this issue Jan 11, 2024
cvwright pushed a commit to cvwright/matrix-docker-ansible-deploy that referenced this issue Jan 11, 2024
cvwright pushed a commit to cvwright/matrix-docker-ansible-deploy that referenced this issue Jan 11, 2024
…pantaleev#2985)

* Update matrix-domain.conf.j2

exchanged "^~" with "~" as a pattern matching in the location part.
I am very sure, that it only works using "~". I am not quite sure though, if this is the right way to do it, because "~" is probably more expensive than "^~"

the rewrite has to be behind the definition of the $backend. Otherwise nginx will fail to work. This is probably because "break" goes directly to the proxy_pass which uses $backend.

* Update matrix-domain.conf.j2

also change the order of "set $backend" and "rewrite" here in the 3pid registration section

* Update matrix-domain.conf.j2 - repeat v3_to_r0 rewrite in else-statement

as you said: repeat it for the else-case, where the ma1sd might be running on sans_container.

* Update matrix-domain.conf.j2 - corrected wrong variable

atrix_nginx_proxy_proxy_matrix_3pid_registration_v3_to_r0_redirect_enabled
is the right variable to check (twice) in the corresponding branch.

* matrix-domain.conf.j2 - fix-2954: change all whitespaces to tabs as you do it

---------

Co-authored-by: Tobias Küchel <t.kuechel@humboldt-ka.de>
KarolosLykos pushed a commit to KarolosLykos/matrix-docker-ansible-deploy that referenced this issue Mar 5, 2024
KarolosLykos pushed a commit to KarolosLykos/matrix-docker-ansible-deploy that referenced this issue Mar 5, 2024
KarolosLykos pushed a commit to KarolosLykos/matrix-docker-ansible-deploy that referenced this issue Mar 5, 2024
…pantaleev#2985)

* Update matrix-domain.conf.j2

exchanged "^~" with "~" as a pattern matching in the location part.
I am very sure, that it only works using "~". I am not quite sure though, if this is the right way to do it, because "~" is probably more expensive than "^~"

the rewrite has to be behind the definition of the $backend. Otherwise nginx will fail to work. This is probably because "break" goes directly to the proxy_pass which uses $backend.

* Update matrix-domain.conf.j2

also change the order of "set $backend" and "rewrite" here in the 3pid registration section

* Update matrix-domain.conf.j2 - repeat v3_to_r0 rewrite in else-statement

as you said: repeat it for the else-case, where the ma1sd might be running on sans_container.

* Update matrix-domain.conf.j2 - corrected wrong variable

atrix_nginx_proxy_proxy_matrix_3pid_registration_v3_to_r0_redirect_enabled
is the right variable to check (twice) in the corresponding branch.

* matrix-domain.conf.j2 - fix-2954: change all whitespaces to tabs as you do it

---------

Co-authored-by: Tobias Küchel <t.kuechel@humboldt-ka.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants