From 6b2f461d520753636f555671a0cf1594c5000e4e Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Thu, 9 Jan 2020 13:36:39 +0000 Subject: [PATCH 1/3] make cmd directory path absolute in build.sh (#830) --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 9a8050f3..cb109111 100755 --- a/build.sh +++ b/build.sh @@ -1,3 +1,3 @@ #!/bin/sh -GOBIN=$PWD/`dirname $0`/bin go install -v ./cmd/... +GOBIN=$PWD/`dirname $0`/bin go install -v $PWD/`dirname $0`/cmd/... From f7faf74528e1508f43d8d3705c6982b822bb3e9b Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Thu, 9 Jan 2020 16:40:30 +0000 Subject: [PATCH 2/3] Resync testfile with current sytest pass/fail (#832) * Resync testfile with current sytest pass/fail * Add displayname test --- testfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/testfile b/testfile index 8a4e9de1..a869aeff 100644 --- a/testfile +++ b/testfile @@ -197,3 +197,9 @@ Regular users cannot create room aliases within the AS namespace Deleting a non-existent alias should return a 404 Users can't delete other's aliases Outbound federation can query room alias directory +After deactivating account, can't log in with an email +Remote room alias queries can handle Unicode +Newly joined room is included in an incremental sync after invite +Outbound federation can query v1 /send_join +Inbound /v1/make_join rejects remote attempts to join local users to rooms +Inbound federation rejects invites which are not signed by the sender From 714959126beca3a85bac0bd0e8be2e20e8cf8c84 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 9 Jan 2020 17:03:36 +0000 Subject: [PATCH 3/3] Fall back to postgres when database connection string parsing fails (#842) * Fall back to postgres when parsing the database connection string for a URI schema fails * Fix behaviour so that it really tries postgres when URL parsing fails and it complains about unknown schema if it succeeds --- common/keydb/keydb.go | 4 +++- federationsender/storage/storage.go | 6 ++++-- mediaapi/storage/storage.go | 4 +++- publicroomsapi/storage/storage.go | 4 +++- roomserver/storage/storage.go | 4 +++- syncapi/storage/storage.go | 4 +++- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/common/keydb/keydb.go b/common/keydb/keydb.go index b9fa884e..04692e98 100644 --- a/common/keydb/keydb.go +++ b/common/keydb/keydb.go @@ -33,7 +33,9 @@ type Database interface { func NewDatabase(dataSourceName string) (Database, error) { uri, err := url.Parse(dataSourceName) if err != nil { - return nil, err + // if the scheme doesn't match, fall back to postgres in case the config has + // postgres key=value connection strings + return postgres.NewDatabase(dataSourceName) } switch uri.Scheme { case "postgres": diff --git a/federationsender/storage/storage.go b/federationsender/storage/storage.go index 8cffdbf1..9f2805cf 100644 --- a/federationsender/storage/storage.go +++ b/federationsender/storage/storage.go @@ -34,12 +34,14 @@ type Database interface { func NewDatabase(dataSourceName string) (Database, error) { uri, err := url.Parse(dataSourceName) if err != nil { - return nil, err + // if the scheme doesn't match, fall back to postgres in case the config has + // postgres key=value connection strings + return postgres.NewDatabase(dataSourceName) } switch uri.Scheme { case "postgres": return postgres.NewDatabase(dataSourceName) default: - return nil, errors.New("unknown schema") + return errors.New("unknown schema") } } diff --git a/mediaapi/storage/storage.go b/mediaapi/storage/storage.go index 0f39c1d0..ca9f69f8 100644 --- a/mediaapi/storage/storage.go +++ b/mediaapi/storage/storage.go @@ -36,7 +36,9 @@ type Database interface { func Open(dataSourceName string) (Database, error) { uri, err := url.Parse(dataSourceName) if err != nil { - return nil, err + // if the scheme doesn't match, fall back to postgres in case the config has + // postgres key=value connection strings + return postgres.Open(dataSourceName) } switch uri.Scheme { case "postgres": diff --git a/publicroomsapi/storage/storage.go b/publicroomsapi/storage/storage.go index a6a39d52..d611686b 100644 --- a/publicroomsapi/storage/storage.go +++ b/publicroomsapi/storage/storage.go @@ -39,7 +39,9 @@ type Database interface { func NewPublicRoomsServerDatabase(dataSourceName string) (Database, error) { uri, err := url.Parse(dataSourceName) if err != nil { - return nil, err + // if the scheme doesn't match, fall back to postgres in case the config has + // postgres key=value connection strings + return postgres.NewPublicRoomsServerDatabase(dataSourceName) } switch uri.Scheme { case "postgres": diff --git a/roomserver/storage/storage.go b/roomserver/storage/storage.go index 325d96e9..62e8b64c 100644 --- a/roomserver/storage/storage.go +++ b/roomserver/storage/storage.go @@ -61,7 +61,9 @@ type Database interface { func Open(dataSourceName string) (Database, error) { uri, err := url.Parse(dataSourceName) if err != nil { - return nil, err + // if the scheme doesn't match, fall back to postgres in case the config has + // postgres key=value connection strings + return postgres.Open(dataSourceName) } switch uri.Scheme { case "postgres": diff --git a/syncapi/storage/storage.go b/syncapi/storage/storage.go index eedb42f0..4d896531 100644 --- a/syncapi/storage/storage.go +++ b/syncapi/storage/storage.go @@ -52,7 +52,9 @@ type Database interface { func NewSyncServerDatasource(dataSourceName string) (Database, error) { uri, err := url.Parse(dataSourceName) if err != nil { - return nil, err + // if the scheme doesn't match, fall back to postgres in case the config has + // postgres key=value connection strings + return postgres.NewSyncServerDatasource(dataSourceName) } switch uri.Scheme { case "postgres":