Merge branch 'master' into neilalexander/sqlite-roomserver

This commit is contained in:
Neil Alexander 2020-01-09 17:05:44 +00:00
commit 7a71a59dc7
8 changed files with 26 additions and 8 deletions

View file

@ -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/...

View file

@ -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":

View file

@ -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")
}
}

View file

@ -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":

View file

@ -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":

View file

@ -62,7 +62,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":

View file

@ -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":

View file

@ -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