diff --git a/dendrite-config.yaml b/dendrite-config.yaml index 74bb0711b..d1b27c28c 100644 --- a/dendrite-config.yaml +++ b/dendrite-config.yaml @@ -88,8 +88,9 @@ global: # Configuration for the Appservice API. app_service_api: - listen: localhost:7777 - bind: localhost:7777 + internal_api: + listen: http://localhost:7777 + connect: http://localhost:7777 database: connection_string: file:appservice.db max_open_conns: 100 @@ -101,8 +102,11 @@ app_service_api: # Configuration for the Client API. client_api: - listen: localhost:7771 - bind: localhost:7771 + internal_api: + listen: http://localhost:7771 + connect: http://localhost:7771 + external_api: + listen: http://[::]:8071 # Prevents new users from being able to register on this homeserver, except when # using the registration shared secret below. @@ -131,8 +135,9 @@ client_api: # Configuration for the Current State Server. current_state_server: - listen: localhost:7782 - bind: localhost:7782 + internal_api: + listen: http://localhost:7782 + connect: http://localhost:7782 database: connection_string: file:currentstate.db max_open_conns: 100 @@ -141,13 +146,17 @@ current_state_server: # Configuration for the EDU server. edu_server: - listen: localhost:7778 - bind: localhost:7778 + internal_api: + listen: http://localhost:7778 + connect: http://localhost:7778 # Configuration for the Federation API. federation_api: - listen: localhost:7772 - bind: localhost:7772 + internal_api: + listen: http://localhost:7772 + connect: http://localhost:7772 + external_api: + listen: http://[::]:8072 # List of paths to X.509 certificates to be used by the external federation listeners. # These certificates will be used to calculate the TLS fingerprints and other servers @@ -157,8 +166,9 @@ federation_api: # Configuration for the Federation Sender. federation_sender: - listen: localhost:7775 - bind: localhost:7775 + internal_api: + listen: http://localhost:7775 + connect: http://localhost:7775 database: connection_string: file:federationsender.db max_open_conns: 100 @@ -182,8 +192,9 @@ federation_sender: # Configuration for the Key Server (for end-to-end encryption). key_server: - listen: localhost:7779 - bind: localhost:7779 + internal_api: + listen: http://localhost:7779 + connect: http://localhost:7779 database: connection_string: file:keyserver.db max_open_conns: 100 @@ -192,8 +203,11 @@ key_server: # Configuration for the Media API. media_api: - listen: localhost:7774 - bind: localhost:7774 + internal_api: + listen: http://localhost:7774 + connect: http://localhost:7774 + external_api: + listen: http://[::]:8074 database: connection_string: file:mediaapi.db max_open_conns: 100 @@ -227,8 +241,9 @@ media_api: # Configuration for the Room Server. room_server: - listen: localhost:7770 - bind: localhost:7770 + internal_api: + listen: http://localhost:7770 + connect: http://localhost:7770 database: connection_string: file:roomserver.db max_open_conns: 100 @@ -237,8 +252,9 @@ room_server: # Configuration for the Server Key API (for server signing keys). server_key_api: - listen: localhost:7780 - bind: localhost:7780 + internal_api: + listen: http://localhost:7780 + connect: http://localhost:7780 database: connection_string: file:serverkeyapi.db max_open_conns: 100 @@ -258,8 +274,9 @@ server_key_api: # Configuration for the Sync API. sync_api: - listen: localhost:7773 - bind: localhost:7773 + internal_api: + listen: http://localhost:7773 + connect: http://localhost:7773 database: connection_string: file:syncapi.db max_open_conns: 100 @@ -268,8 +285,9 @@ sync_api: # Configuration for the User API. user_api: - listen: localhost:7781 - bind: localhost:7781 + internal_api: + listen: http://localhost:7781 + connect: http://localhost:7781 account_database: connection_string: file:userapi_accounts.db max_open_conns: 100 @@ -301,4 +319,4 @@ logging: - type: file level: info params: - path: /var/log/dendrite \ No newline at end of file + path: /var/log/dendrite diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 050debffd..39b3ee47f 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -43,7 +43,8 @@ global: - matrix.org - vector.im kafka: - addresses: [] + addresses: + - localhost:2181 topic_prefix: Dendrite use_naffka: true naffka_database: @@ -57,8 +58,9 @@ global: username: metrics password: metrics app_service_api: - listen: localhost:7777 - bind: localhost:7777 + internal_api: + listen: http://localhost:7777 + connect: http://localhost:7777 database: connection_string: file:appservice.db max_open_conns: 100 @@ -66,8 +68,11 @@ app_service_api: conn_max_lifetime: -1 config_files: [] client_api: - listen: localhost:7771 - bind: localhost:7771 + internal_api: + listen: http://localhost:7771 + connect: http://localhost:7771 + external_api: + listen: http://[::]:8071 registration_disabled: false registration_shared_secret: "" enable_registration_captcha: false @@ -82,23 +87,29 @@ client_api: turn_username: "" turn_password: "" current_state_server: - listen: localhost:7782 - bind: localhost:7782 + internal_api: + listen: http://localhost:7782 + connect: http://localhost:7782 database: connection_string: file:currentstate.db max_open_conns: 100 max_idle_conns: 2 conn_max_lifetime: -1 edu_server: - listen: localhost:7778 - bind: localhost:7778 + internal_api: + listen: http://localhost:7778 + connect: http://localhost:7778 federation_api: - listen: localhost:7772 - bind: localhost:7772 + internal_api: + listen: http://localhost:7772 + connect: http://localhost:7772 + external_api: + listen: http://[::]:8072 federation_certificates: [] federation_sender: - listen: localhost:7775 - bind: localhost:7775 + internal_api: + listen: http://localhost:7775 + connect: http://localhost:7775 database: connection_string: file:federationsender.db max_open_conns: 100 @@ -112,16 +123,20 @@ federation_sender: host: localhost port: 8080 key_server: - listen: localhost:7779 - bind: localhost:7779 + internal_api: + listen: http://localhost:7779 + connect: http://localhost:7779 database: connection_string: file:keyserver.db max_open_conns: 100 max_idle_conns: 2 conn_max_lifetime: -1 media_api: - listen: localhost:7774 - bind: localhost:7774 + internal_api: + listen: http://localhost:7774 + connect: http://localhost:7774 + external_api: + listen: http://[::]:8074 database: connection_string: file:mediaapi.db max_open_conns: 100 @@ -142,16 +157,18 @@ media_api: height: 480 method: scale room_server: - listen: localhost:7770 - bind: localhost:7770 + internal_api: + listen: http://localhost:7770 + connect: http://localhost:7770 database: connection_string: file:roomserver.db max_open_conns: 100 max_idle_conns: 2 conn_max_lifetime: -1 server_key_api: - listen: localhost:7780 - bind: localhost:7780 + internal_api: + listen: http://localhost:7780 + connect: http://localhost:7780 database: connection_string: file:serverkeyapi.db max_open_conns: 100 @@ -165,16 +182,18 @@ server_key_api: - key_id: ed25519:a_RXGa public_key: l8Hft5qXKn1vfHrg3p4+W8gELQVo8N13JkluMfmn2sQ sync_api: - listen: localhost:7773 - bind: localhost:7773 + internal_api: + listen: http://localhost:7773 + connect: http://localhost:7773 database: connection_string: file:syncapi.db max_open_conns: 100 max_idle_conns: 2 conn_max_lifetime: -1 user_api: - listen: localhost:7781 - bind: localhost:7781 + internal_api: + listen: http://localhost:7781 + connect: http://localhost:7781 account_database: connection_string: file:userapi_accounts.db max_open_conns: 100 diff --git a/internal/setup/base.go b/internal/setup/base.go index c78639f6c..2cffb4e84 100644 --- a/internal/setup/base.go +++ b/internal/setup/base.go @@ -269,6 +269,7 @@ 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. +// nolint:gocyclo func (b *BaseDendrite) SetupAndServeHTTP( internalHTTPAddr, externalHTTPAddr config.HTTPAddress, certFile, keyFile *string,