mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 05:42:46 +00:00
patch dendrite microservices with bind config (#795)
This PR adds a block in the dendrite config for the services to bind to. The microservices should bind to the addresses in the bind block, and will be contacted at the address in the listen block. This fixes an issue with the microservices and kubernetes services.
This commit is contained in:
parent
3e2bb8bf2f
commit
7d77538ca4
12 changed files with 52 additions and 10 deletions
|
@ -157,7 +157,16 @@ func (b *BaseDendrite) CreateFederationClient() *gomatrixserverlib.FederationCli
|
|||
|
||||
// SetupAndServeHTTP sets up the HTTP server to serve endpoints registered on
|
||||
// ApiMux under /api/ and adds a prometheus handler under /metrics.
|
||||
func (b *BaseDendrite) SetupAndServeHTTP(addr string) {
|
||||
func (b *BaseDendrite) SetupAndServeHTTP(bindaddr string, listenaddr string) {
|
||||
// If a separate bind address is defined, listen on that. Otherwise use
|
||||
// the listen address
|
||||
var addr string
|
||||
if bindaddr != "" {
|
||||
addr = bindaddr
|
||||
} else {
|
||||
addr = listenaddr
|
||||
}
|
||||
|
||||
common.SetupHTTPAPI(http.DefaultServeMux, common.WrapHandlerInCORS(b.APIMux))
|
||||
logrus.Infof("Starting %s server on %s", b.componentName, addr)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue