mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 03:13:11 -06:00
Allow fallback if bind not specified
Allows fallback to listen block if bind block not specified
This commit is contained in:
parent
9e95d599bc
commit
619ece0c5c
|
|
@ -35,5 +35,9 @@ func main() {
|
||||||
base, accountDB, deviceDB, federation, alias, query, cache,
|
base, accountDB, deviceDB, federation, alias, query, cache,
|
||||||
)
|
)
|
||||||
|
|
||||||
base.SetupAndServeHTTP(string(base.Cfg.Bind.FederationSender))
|
if base.Cfg.Bind.AppServiceAPI != "" {
|
||||||
|
base.SetupAndServeHTTP(string(base.Cfg.Bind.AppServiceAPI))
|
||||||
|
} else {
|
||||||
|
base.SetupAndServeHTTP(string(base.Cfg.Listen.AppServiceAPI))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,5 +44,9 @@ func main() {
|
||||||
alias, input, query, typingInputAPI, asQuery, transactions.New(),
|
alias, input, query, typingInputAPI, asQuery, transactions.New(),
|
||||||
)
|
)
|
||||||
|
|
||||||
base.SetupAndServeHTTP(string(base.Cfg.Bind.ClientAPI))
|
if base.Cfg.Bind.ClientAPI != "" {
|
||||||
|
base.SetupAndServeHTTP(string(base.Cfg.Bind.ClientAPI))
|
||||||
|
} else {
|
||||||
|
base.SetupAndServeHTTP(string(base.Cfg.Listen.ClientAPI))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,5 +39,9 @@ func main() {
|
||||||
alias, input, query, asQuery,
|
alias, input, query, asQuery,
|
||||||
)
|
)
|
||||||
|
|
||||||
base.SetupAndServeHTTP(string(base.Cfg.Bind.FederationAPI))
|
if base.Cfg.Bind.FederationAPI != "" {
|
||||||
|
base.SetupAndServeHTTP(string(base.Cfg.Bind.FederationAPI))
|
||||||
|
} else {
|
||||||
|
base.SetupAndServeHTTP(string(base.Cfg.Listen.FederationAPI))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,5 +32,9 @@ func main() {
|
||||||
base, federation, query,
|
base, federation, query,
|
||||||
)
|
)
|
||||||
|
|
||||||
base.SetupAndServeHTTP(string(base.Cfg.Bind.FederationSender))
|
if base.Cfg.Bind.FederationSender != "" {
|
||||||
|
base.SetupAndServeHTTP(string(base.Cfg.Bind.FederationSender))
|
||||||
|
} else {
|
||||||
|
base.SetupAndServeHTTP(string(base.Cfg.Listen.FederationSender))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,5 +28,9 @@ func main() {
|
||||||
|
|
||||||
mediaapi.SetupMediaAPIComponent(base, deviceDB)
|
mediaapi.SetupMediaAPIComponent(base, deviceDB)
|
||||||
|
|
||||||
base.SetupAndServeHTTP(string(base.Cfg.Bind.MediaAPI))
|
if base.Cfg.Bind.MediaAPI != "" {
|
||||||
|
base.SetupAndServeHTTP(string(base.Cfg.Bind.MediaAPI))
|
||||||
|
} else {
|
||||||
|
base.SetupAndServeHTTP(string(base.Cfg.Listen.MediaAPI))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,5 +28,9 @@ func main() {
|
||||||
|
|
||||||
publicroomsapi.SetupPublicRoomsAPIComponent(base, deviceDB)
|
publicroomsapi.SetupPublicRoomsAPIComponent(base, deviceDB)
|
||||||
|
|
||||||
base.SetupAndServeHTTP(string(base.Cfg.Bind.PublicRoomsAPI))
|
if base.Cfg.Bind.PublicRoomsAPI != "" {
|
||||||
|
base.SetupAndServeHTTP(string(base.Cfg.Bind.PublicRoomsAPI))
|
||||||
|
} else {
|
||||||
|
base.SetupAndServeHTTP(string(base.Cfg.Listen.PublicRoomsAPI))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,5 +28,9 @@ func main() {
|
||||||
|
|
||||||
roomserver.SetupRoomServerComponent(base)
|
roomserver.SetupRoomServerComponent(base)
|
||||||
|
|
||||||
base.SetupAndServeHTTP(string(base.Cfg.Bind.RoomServer))
|
if base.Cfg.Bind.RoomServer != "" {
|
||||||
|
base.SetupAndServeHTTP(string(base.Cfg.Bind.RoomServer))
|
||||||
|
} else {
|
||||||
|
base.SetupAndServeHTTP(string(base.Cfg.Listen.RoomServer))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,5 +31,9 @@ func main() {
|
||||||
|
|
||||||
syncapi.SetupSyncAPIComponent(base, deviceDB, accountDB, query)
|
syncapi.SetupSyncAPIComponent(base, deviceDB, accountDB, query)
|
||||||
|
|
||||||
base.SetupAndServeHTTP(string(base.Cfg.Bind.SyncAPI))
|
if base.Cfg.Bind.SyncAPI != "" {
|
||||||
|
base.SetupAndServeHTTP(string(base.Cfg.Bind.SyncAPI))
|
||||||
|
} else {
|
||||||
|
base.SetupAndServeHTTP(string(base.Cfg.Listen.SyncAPI))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,5 +32,9 @@ func main() {
|
||||||
|
|
||||||
typingserver.SetupTypingServerComponent(base, cache.NewTypingCache())
|
typingserver.SetupTypingServerComponent(base, cache.NewTypingCache())
|
||||||
|
|
||||||
base.SetupAndServeHTTP(string(base.Cfg.Bind.TypingServer))
|
if base.Cfg.Bind.TypingServer != "" {
|
||||||
|
base.SetupAndServeHTTP(string(base.Cfg.Bind.TypingServer))
|
||||||
|
} else {
|
||||||
|
base.SetupAndServeHTTP(string(base.Cfg.Listen.TypingServer))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -194,6 +194,21 @@ type Dendrite struct {
|
||||||
Password string `yaml:"turn_password"`
|
Password string `yaml:"turn_password"`
|
||||||
} `yaml:"turn"`
|
} `yaml:"turn"`
|
||||||
|
|
||||||
|
// The internal addresses the components will listen on.
|
||||||
|
// These should not be exposed externally as they expose metrics and debugging APIs.
|
||||||
|
// Falls back to addresses listed in Listen if not specified
|
||||||
|
Bind struct {
|
||||||
|
MediaAPI Address `yaml:"media_api"`
|
||||||
|
ClientAPI Address `yaml:"client_api"`
|
||||||
|
FederationAPI Address `yaml:"federation_api"`
|
||||||
|
AppServiceAPI Address `yaml:"appservice_api"`
|
||||||
|
SyncAPI Address `yaml:"sync_api"`
|
||||||
|
RoomServer Address `yaml:"room_server"`
|
||||||
|
FederationSender Address `yaml:"federation_sender"`
|
||||||
|
PublicRoomsAPI Address `yaml:"public_rooms_api"`
|
||||||
|
TypingServer Address `yaml:"typing_server"`
|
||||||
|
} `yaml:"bind"`
|
||||||
|
|
||||||
// The addresses for talking to other microservices.
|
// The addresses for talking to other microservices.
|
||||||
Listen struct {
|
Listen struct {
|
||||||
MediaAPI Address `yaml:"media_api"`
|
MediaAPI Address `yaml:"media_api"`
|
||||||
|
|
@ -207,20 +222,6 @@ type Dendrite struct {
|
||||||
TypingServer Address `yaml:"typing_server"`
|
TypingServer Address `yaml:"typing_server"`
|
||||||
} `yaml:"listen"`
|
} `yaml:"listen"`
|
||||||
|
|
||||||
// The internal addresses the components will listen on.
|
|
||||||
// These should not be exposed externally as they expose metrics and debugging APIs.
|
|
||||||
Bind struct {
|
|
||||||
MediaAPI Address `yaml:"media_api"`
|
|
||||||
ClientAPI Address `yaml:"client_api"`
|
|
||||||
FederationAPI Address `yaml:"federation_api"`
|
|
||||||
AppServiceAPI Address `yaml:"appservice_api"`
|
|
||||||
SyncAPI Address `yaml:"sync_api"`
|
|
||||||
RoomServer Address `yaml:"room_server"`
|
|
||||||
FederationSender Address `yaml:"federation_sender"`
|
|
||||||
PublicRoomsAPI Address `yaml:"public_rooms_api"`
|
|
||||||
TypingServer Address `yaml:"typing_server"`
|
|
||||||
} `yaml:"bind"`
|
|
||||||
|
|
||||||
// The config for tracing the dendrite servers.
|
// The config for tracing the dendrite servers.
|
||||||
Tracing struct {
|
Tracing struct {
|
||||||
// The config for the jaeger opentracing reporter.
|
// The config for the jaeger opentracing reporter.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue