mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-20 05:13:11 -06:00
Only start HTTP APIs if needed
This commit is contained in:
parent
862e9bf87c
commit
8d93710f94
|
|
@ -82,7 +82,9 @@ func SetupAppServiceAPIComponent(
|
|||
Cfg: base.Cfg,
|
||||
}
|
||||
|
||||
appserviceQueryAPI.SetupHTTP(http.DefaultServeMux)
|
||||
if base.EnableHTTPAPIs {
|
||||
appserviceQueryAPI.SetupHTTP(http.DefaultServeMux)
|
||||
}
|
||||
|
||||
consumer := consumers.NewOutputRoomEventConsumer(
|
||||
base.Cfg, base.KafkaConsumer, accountsDB, appserviceDB,
|
||||
|
|
|
|||
|
|
@ -53,12 +53,12 @@ import (
|
|||
// should only be used during start up.
|
||||
// Must be closed when shutting down.
|
||||
type BaseDendrite struct {
|
||||
componentName string
|
||||
enableHTTPAPIs bool
|
||||
tracerCloser io.Closer
|
||||
componentName string
|
||||
tracerCloser io.Closer
|
||||
|
||||
// APIMux should be used to register new public matrix api endpoints
|
||||
APIMux *mux.Router
|
||||
EnableHTTPAPIs bool
|
||||
httpClient *http.Client
|
||||
Cfg *config.Dendrite
|
||||
ImmutableCache caching.ImmutableCache
|
||||
|
|
@ -97,7 +97,7 @@ func NewBaseDendrite(cfg *config.Dendrite, componentName string, enableHTTPAPIs
|
|||
|
||||
return &BaseDendrite{
|
||||
componentName: componentName,
|
||||
enableHTTPAPIs: enableHTTPAPIs,
|
||||
EnableHTTPAPIs: enableHTTPAPIs,
|
||||
tracerCloser: closer,
|
||||
Cfg: cfg,
|
||||
ImmutableCache: cache,
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@ func SetupEDUServerComponent(
|
|||
OutputTypingEventTopic: string(base.Cfg.Kafka.Topics.OutputTypingEvent),
|
||||
}
|
||||
|
||||
inputAPI.SetupHTTP(http.DefaultServeMux)
|
||||
if base.EnableHTTPAPIs {
|
||||
inputAPI.SetupHTTP(http.DefaultServeMux)
|
||||
}
|
||||
|
||||
return inputAPI
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,10 @@ func SetupFederationSenderComponent(
|
|||
federationSenderDB, base.Cfg, roomserverProducer, federation, keyRing,
|
||||
statistics,
|
||||
)
|
||||
queryAPI.SetupHTTP(http.DefaultServeMux)
|
||||
|
||||
if base.EnableHTTPAPIs {
|
||||
queryAPI.SetupHTTP(http.DefaultServeMux)
|
||||
}
|
||||
|
||||
return queryAPI
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,9 @@ func SetupRoomServerComponent(
|
|||
KeyRing: keyRing,
|
||||
}
|
||||
|
||||
internalAPI.SetupHTTP(http.DefaultServeMux)
|
||||
if base.EnableHTTPAPIs {
|
||||
internalAPI.SetupHTTP(http.DefaultServeMux)
|
||||
}
|
||||
|
||||
return &internalAPI
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue