diff options
author | gvit <gvit@ydb.tech> | 2023-11-08 00:49:24 +0300 |
---|---|---|
committer | gvit <gvit@ydb.tech> | 2023-11-08 01:12:57 +0300 |
commit | 66a25941c62a453ffd1d9e2bb2f007a65ab10364 (patch) | |
tree | 8d6c1701c33a836a47ce4942848cedeb29030755 | |
parent | d8b4abf5dc60664a332b8a7636bea320f17dc204 (diff) | |
download | ydb-66a25941c62a453ffd1d9e2bb2f007a65ab10364.tar.gz |
allow to override address KIKIMR-19984
-rw-r--r-- | ydb/core/driver_lib/run/kikimr_services_initializers.cpp | 4 | ||||
-rw-r--r-- | ydb/core/protos/config.proto | 1 | ||||
-rw-r--r-- | ydb/core/raw_socket/sock_listener.cpp | 2 | ||||
-rw-r--r-- | ydb/core/raw_socket/sock_listener.h | 1 |
4 files changed, 7 insertions, 1 deletions
diff --git a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp index 7905a60a8dd..bd8fe08b555 100644 --- a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp +++ b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp @@ -2655,6 +2655,10 @@ void TLocalPgWireServiceInitializer::InitializeServices(NActors::TActorSystemSet settings.SslCertificatePem = Config.GetLocalPgWireConfig().GetSslCertificate(); } + if (Config.GetLocalPgWireConfig().HasAddress()) { + settings.Address = Config.GetLocalPgWireConfig().GetAddress(); + } + setup->LocalServices.emplace_back( TActorId(), TActorSetupCmd(NPG::CreatePGListener(MakePollerActorId(), NLocalPgWire::CreateLocalPgWireProxyId(), settings), diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto index ea706ad72f2..0c14f00299b 100644 --- a/ydb/core/protos/config.proto +++ b/ydb/core/protos/config.proto @@ -1956,6 +1956,7 @@ message TClientCertificateAuthorization { message TLocalPgWireConfig { optional int32 ListeningPort = 1 [default = 5432]; optional string SslCertificate = 5; + optional string Address = 6 [default = "::"]; } message TKafkaProxyConfig { diff --git a/ydb/core/raw_socket/sock_listener.cpp b/ydb/core/raw_socket/sock_listener.cpp index cbeffc5c4e2..611f15d05fd 100644 --- a/ydb/core/raw_socket/sock_listener.cpp +++ b/ydb/core/raw_socket/sock_listener.cpp @@ -49,7 +49,7 @@ public: void Bootstrap() { TSocketType socket; - TSocketAddressType bindAddress(socket.MakeAddress("::", Settings.Port)); + TSocketAddressType bindAddress(socket.MakeAddress(Settings.Address, Settings.Port)); int err = socket.Bind(bindAddress.get()); if (err == 0) { std::shared_ptr<TEndpointInfo> endpoint = std::make_shared<TEndpointInfo>(); diff --git a/ydb/core/raw_socket/sock_listener.h b/ydb/core/raw_socket/sock_listener.h index 14342b8c512..a3ad725e0d9 100644 --- a/ydb/core/raw_socket/sock_listener.h +++ b/ydb/core/raw_socket/sock_listener.h @@ -13,6 +13,7 @@ struct TListenerSettings { TString CertificateFile; TString PrivateKeyFile; TString SslCertificatePem; + TString Address = "::"; }; enum EErrorAction { |