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

Route GET /groups queries to workers #798

Merged
merged 2 commits into from
Feb 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions lib/SyTest/Homeserver/Synapse.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,7 @@ sub start

$self->{paths}{pem_file} = $self->write_file( "combined.pem", $cert . $key );
$self->{paths}{path_map_file} = $self->write_file( "path_map_file", $self->generate_haproxy_map );
$self->{paths}{get_path_map_file} = $self->write_file( "get_path_map_file", $self->generate_haproxy_get_map );

$self->{haproxy_config} = $self->write_file( "haproxy.conf", $self->generate_haproxy_config );

Expand Down Expand Up @@ -1123,6 +1124,9 @@ defaults
frontend http-in
bind ${bind_host}:$ports->{haproxy} ssl crt $self->{paths}{pem_file}

acl has_get_map path -m reg -M -f $self->{paths}{get_path_map_file}
use_backend %[path,map_reg($self->{paths}{get_path_map_file},synapse)] if has_get_map METH_GET

use_backend %[path,map_reg($self->{paths}{path_map_file},synapse)]

backend synapse
Expand Down Expand Up @@ -1178,6 +1182,7 @@ sub generate_haproxy_map
^/_matrix/federation/v1/event_auth/ federation_reader
^/_matrix/federation/v1/exchange_third_party_invite/ federation_reader
^/_matrix/federation/v1/send/ federation_reader
^/_matrix/federation/v1/get_groups_publicised federation_reader
^/_matrix/key/v2/query federation_reader

^/_matrix/client/(api/v1|r0|unstable)/publicRooms$ client_reader
Expand All @@ -1193,6 +1198,8 @@ sub generate_haproxy_map
^/_matrix/client/(api/v1|r0|unstable)/voip/turnServer$ client_reader
^/_matrix/client/(r0|unstable)/register$ client_reader
^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/messages$ client_reader
^/_matrix/client/(api/v1|r0|unstable)/get_groups_publicised$ client_reader
^/_matrix/client/(api/v1|r0|unstable)/joined_groups$ client_reader

^/_matrix/client/(api/v1|r0|unstable)/keys/upload frontend_proxy

Expand All @@ -1206,6 +1213,16 @@ sub generate_haproxy_map
EOCONFIG
}

sub generate_haproxy_get_map
{
return <<'EOCONFIG';
^/_matrix/federation/v1/groups/ federation_reader

^/_matrix/client/(api/v1|r0|unstable)/groups/ client_reader

EOCONFIG
}

sub secure_port
{
my $self = shift;
Expand Down