From a0bcffa68e8f07c36ee9504458ee0f62ab716021 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Fri, 19 May 2017 17:22:47 +0100 Subject: [PATCH] Add ACCOUNT_DATABASE env var --- .../dendrite/cmd/dendrite-client-api-server/main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/github.com/matrix-org/dendrite/cmd/dendrite-client-api-server/main.go b/src/github.com/matrix-org/dendrite/cmd/dendrite-client-api-server/main.go index 4c73a06a9..f2dbcfabb 100644 --- a/src/github.com/matrix-org/dendrite/cmd/dendrite-client-api-server/main.go +++ b/src/github.com/matrix-org/dendrite/cmd/dendrite-client-api-server/main.go @@ -19,6 +19,7 @@ import ( "os" "strings" + "github.com/matrix-org/dendrite/clientapi/auth/storage" "github.com/matrix-org/dendrite/clientapi/config" "github.com/matrix-org/dendrite/clientapi/producers" "github.com/matrix-org/dendrite/clientapi/routing" @@ -37,6 +38,7 @@ var ( clientAPIOutputTopic = os.Getenv("CLIENTAPI_OUTPUT_TOPIC") serverName = gomatrixserverlib.ServerName(os.Getenv("SERVER_NAME")) serverKey = os.Getenv("SERVER_KEY") + accountDataSource = os.Getenv("ACCOUNT_DATABASE") ) func main() { @@ -79,7 +81,11 @@ func main() { } queryAPI := api.NewRoomserverQueryAPIHTTP(cfg.RoomserverURL, nil) + accountDB, err := storage.NewAccountDatabase("", serverName) + if err != nil { + log.Panicf("Failed to setup account database(%s): %s", accountDataSource, err.Error()) + } - routing.Setup(http.DefaultServeMux, http.DefaultClient, cfg, roomserverProducer, queryAPI, nil) + routing.Setup(http.DefaultServeMux, http.DefaultClient, cfg, roomserverProducer, queryAPI, accountDB) log.Fatal(http.ListenAndServe(bindAddr, nil)) }