Hacks to get join room working

This commit is contained in:
Mark Haines 2017-05-22 18:14:06 +01:00
parent e9bf826255
commit a9a7472974
2 changed files with 10 additions and 6 deletions

View file

@ -49,6 +49,9 @@ func main() {
// TODO: make the validity period configurable.
ValidityPeriod: 24 * time.Hour,
}
cfg.TLSFingerPrints = []gomatrixserverlib.TLSFingerprint{
{[]byte("o\xe2\xd1\x05A7g\xd6=\x10\xdfq\x9e4\xb1:/\x9co>\x01g\x1d\xb8\xbebFf]\xf0\x89N")},
}
var err error
cfg.KeyID, cfg.PrivateKey, err = common.ReadKey(serverKey)

View file

@ -24,7 +24,7 @@ import (
)
const (
pathPrefixV2Keys = "/_matrix/keys/v2"
pathPrefixV2Keys = "/_matrix/key/v2"
)
// Setup registers HTTP handlers with the given ServeMux.
@ -32,11 +32,12 @@ func Setup(servMux *http.ServeMux, cfg config.FederationAPI) {
apiMux := mux.NewRouter()
v2keysmux := apiMux.PathPrefix(pathPrefixV2Keys).Subrouter()
v2keysmux.Handle("/server/",
makeAPI("localkeys", func(req *http.Request) util.JSONResponse {
return readers.LocalKeys(req, cfg)
}),
)
localKeys := makeAPI("localkeys", func(req *http.Request) util.JSONResponse {
return readers.LocalKeys(req, cfg)
})
v2keysmux.Handle("/server/{keyID}", localKeys)
v2keysmux.Handle("/server/", localKeys)
servMux.Handle("/metrics", prometheus.Handler())
servMux.Handle("/api/", http.StripPrefix("/api", apiMux))