-
-
Notifications
You must be signed in to change notification settings - Fork 662
Update monolith -api behaviour #1484
Conversation
|
Why do we do this though? |
|
So there are "external" and "internal" listeners. The external listeners are where In monolith mode, we were previously defaulting to both listeners being the same, so In polylith mode, whether a component starts both external+internal listeners or just the internal listener depends on whether it has public-facing APIs (like the client API, sync API, federation API, media API) or not. This PR changes things around so that the internal listener now listens on |
internal/setup/base.go
Outdated
| const HTTPClientTimeout = time.Second * 30 | ||
|
|
||
| const NoInternalListener = "" | ||
| const NoExternalListener = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's going on here? You need some actual values here else NoInternalListener is the same as NoExternalListener - https://play.golang.org/p/bIAL8JumJtK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're just designed to be human-readable rather than leaving "" littered about the place, e.g.
dendrite/cmd/dendrite-monolith-server/main.go
Lines 164 to 168 in 759bab6
| base.SetupAndServeHTTP( | |
| setup.NoInternalListener, // internal API | |
| httpsAddr, // external API | |
| certFile, keyFile, // TLS settings | |
| ) |
dendrite/cmd/dendrite-room-server/main.go
Lines 35 to 39 in 759bab6
| base.SetupAndServeHTTP( | |
| base.Cfg.RoomServer.InternalAPI.Listen, | |
| setup.NoExternalListener, | |
| nil, nil, | |
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe setup.NoListener instead?
This makes some changes to the monolith
-apibehaviour:localhost:18008by default when-apiis enabled-api-bind-addressfor overriding the aboveThis probably requires a patch to Sytest to set
-api-bind-addressto something non-conflicting when we use-api.