Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
19 changes: 17 additions & 2 deletions lib/SyTest/Homeserver/Synapse.pm
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ sub start

my $listeners = [ $self->generate_listeners ];
my $bind_host = $self->{bind_host};
my $unsecure_port = $self->{ports}{synapse_unsecure};

my $macaroon_secret_key = "secret_$port";
my $registration_shared_secret = "reg_secret";
Expand All @@ -172,7 +171,7 @@ sub start
my $config_path = $self->{paths}{config} = $self->write_yaml_file( "config.yaml" => {
server_name => $self->server_name,
log_config => $log_config_file,
public_baseurl => "http://${bind_host}:$unsecure_port",
public_baseurl => $self->public_baseurl,

# We configure synapse to use a TLS cert which is signed by our dummy CA...
tls_certificate_path => $self->{paths}{cert_file},
Expand Down Expand Up @@ -594,6 +593,16 @@ sub unsecure_port
return $self->{ports}{synapse_unsecure};
}

sub public_baseurl
{
my $self = shift;
# run-tests.pl defines whether TLS should be used or not.
our $WANT_TLS;
return $WANT_TLS ?
"https://$self->{bind_host}:" . $self->secure_port() :
"http://$self->{bind_host}:" . $self->unsecure_port();
}

package SyTest::Homeserver::Synapse::Direct;
use base qw( SyTest::Homeserver::Synapse );

Expand Down Expand Up @@ -1108,6 +1117,12 @@ sub unsecure_port
die "haproxy does not have an unsecure port mode\n";
}

sub public_baseurl
{
my $self = shift;
return "https://$self->{bind_host}:" . $self->secure_port();
}

sub start
{
my $self = shift;
Expand Down
1 change: 0 additions & 1 deletion tests/05homeserver.pl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
private_key => "sytest_recaptcha_private_key",
}, cas_config => {
server_url => $test_server_info->client_location . "/cas",
service_url => $location,
},
);

Expand Down