mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-12 17:33:09 -06:00
Merge 72154fd474 into b184a48897
This commit is contained in:
commit
4d01fa237a
|
|
@ -76,8 +76,7 @@ func main() {
|
||||||
log.Panicf("startup: failed to create sync server database with data source %s : %s", cfg.DataSource, err)
|
log.Panicf("startup: failed to create sync server database with data source %s : %s", cfg.DataSource, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: DO NOT USE THIS DATA SOURCE (it's the sync one, not devices!)
|
deviceDB, err := devices.NewDatabase(cfg.AccountDataSource, cfg.ServerName)
|
||||||
deviceDB, err := devices.NewDatabase(cfg.DataSource, cfg.ServerName)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panicf("startup: failed to create device database with data source %s : %s", cfg.DataSource, err)
|
log.Panicf("startup: failed to create device database with data source %s : %s", cfg.DataSource, err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,10 @@ var (
|
||||||
testDatabaseName = defaulting(os.Getenv("DATABASE_NAME"), "syncserver_test")
|
testDatabaseName = defaulting(os.Getenv("DATABASE_NAME"), "syncserver_test")
|
||||||
// The postgres connection config for connecting to the test database.
|
// The postgres connection config for connecting to the test database.
|
||||||
testDatabase = defaulting(os.Getenv("DATABASE"), fmt.Sprintf("dbname=%s sslmode=disable binary_parameters=yes", testDatabaseName))
|
testDatabase = defaulting(os.Getenv("DATABASE"), fmt.Sprintf("dbname=%s sslmode=disable binary_parameters=yes", testDatabaseName))
|
||||||
|
// The name of the test account database to create.
|
||||||
|
testAccountDatabaseName = defaulting(os.Getenv("ACCOUNT_DATABASE_NAME"), "account_test")
|
||||||
|
// The postgres connection config for connecting to the test account database.
|
||||||
|
testAccountDatabase = defaulting(os.Getenv("ACCOUNT_DATABASE"), fmt.Sprintf("dbname=%s sslmode=disable binary_parameters=yes", testDatabaseName))
|
||||||
)
|
)
|
||||||
|
|
||||||
const inputTopic = "syncserverInput"
|
const inputTopic = "syncserverInput"
|
||||||
|
|
@ -83,6 +87,7 @@ func getLastRequestError() error {
|
||||||
var syncServerConfigFileContents = (`consumer_uris: ["` + kafkaURI + `"]
|
var syncServerConfigFileContents = (`consumer_uris: ["` + kafkaURI + `"]
|
||||||
roomserver_topic: "` + inputTopic + `"
|
roomserver_topic: "` + inputTopic + `"
|
||||||
database: "` + testDatabase + `"
|
database: "` + testDatabase + `"
|
||||||
|
account_database: "` + testAccountDatabase + `"
|
||||||
server_name: "localhost"
|
server_name: "localhost"
|
||||||
`)
|
`)
|
||||||
|
|
||||||
|
|
@ -231,6 +236,9 @@ func startSyncServer() (*exec.Cmd, chan error) {
|
||||||
if err := createDatabase(testDatabaseName); err != nil {
|
if err := createDatabase(testDatabaseName); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
if err := createDatabase(testAccountDatabaseName); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
if err := createTestUser(testDatabase, "alice", "@alice:localhost"); err != nil {
|
if err := createTestUser(testDatabase, "alice", "@alice:localhost"); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@ type Sync struct {
|
||||||
KafkaConsumerURIs []string `yaml:"consumer_uris"`
|
KafkaConsumerURIs []string `yaml:"consumer_uris"`
|
||||||
// The postgres connection config for connecting to the database e.g a postgres:// URI
|
// The postgres connection config for connecting to the database e.g a postgres:// URI
|
||||||
DataSource string `yaml:"database"`
|
DataSource string `yaml:"database"`
|
||||||
|
// The postgres connection config for connecting to the account database e.g a postgres:// URI
|
||||||
|
AccountDataSource string `yaml:"account_database"`
|
||||||
// The server_name of the running process e.g "localhost"
|
// The server_name of the running process e.g "localhost"
|
||||||
ServerName gomatrixserverlib.ServerName `yaml:"server_name"`
|
ServerName gomatrixserverlib.ServerName `yaml:"server_name"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue