Skip to content

Commit b3526b0

Browse files
author
Dimy Jeannot
committed
fix: adding explicit grpc port
1 parent 36021fa commit b3526b0

File tree

12 files changed

+68
-26
lines changed

12 files changed

+68
-26
lines changed

apps/clients/public/cli/v2alpha/oeco/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/openecosystems/ecosystem/apps/clients/public/cli/v2alpha/oeco
33
go 1.24.6
44

55
require (
6-
connectrpc.com/connect v1.19.0
6+
connectrpc.com/connect v1.19.1
77
github.com/apex/log v1.9.0
88
github.com/charmbracelet/bubbles v0.21.0
99
github.com/charmbracelet/bubbletea v1.3.5

apps/workloads/public/cryptography/v2alpha/encryption/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/openecosystems/ecosystem/apps/workloads/public/cryptography/v2
33
go 1.24.6
44

55
require (
6-
connectrpc.com/connect v1.19.0
6+
connectrpc.com/connect v1.19.1
77
github.com/openecosystems/ecosystem/go/oeco-sdk/v2beta v0.19.3
88
go.opentelemetry.io/otel/trace v1.37.0
99
)

apps/workloads/public/dns/v2alpha/dynamic-dns/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.24.6
55
require github.com/openecosystems/ecosystem/go/oeco-sdk/v2beta v0.19.3
66

77
require (
8-
connectrpc.com/connect v1.19.0 // indirect
8+
connectrpc.com/connect v1.19.1 // indirect
99
connectrpc.com/vanguard v0.3.0 // indirect
1010
dario.cat/mergo v1.0.2 // indirect
1111
github.com/BurntSushi/toml v1.5.0 // indirect

apps/workloads/public/ecosystem/v2alpha/ecosystem/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/openecosystems/ecosystem/apps/workloads/public/ecosystem/v2alp
33
go 1.24.6
44

55
require (
6-
connectrpc.com/connect v1.19.0
6+
connectrpc.com/connect v1.19.1
77
connectrpc.com/otelconnect v0.7.2
88
connectrpc.com/vanguard v0.3.0
99
go.uber.org/zap v1.27.0

go.work.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,8 @@ cloud.google.com/go/workflows v1.13.2 h1:jYIxrDOVCGvTBHIAVhqQ+P8fhE0trm+Hf2hgL1Y
536536
cloud.google.com/go/workflows v1.13.2/go.mod h1:l5Wj2Eibqba4BsADIRzPLaevLmIuYF2W+wfFBkRG3vU=
537537
connectrpc.com/connect v1.19.0 h1:LuqUbq01PqbtL0o7vn0WMRXzR2nNsiINe5zfcJ24pJM=
538538
connectrpc.com/connect v1.19.0/go.mod h1:tN20fjdGlewnSFeZxLKb0xwIZ6ozc3OQs2hTXy4du9w=
539+
connectrpc.com/connect v1.19.1 h1:R5M57z05+90EfEvCY1b7hBxDVOUl45PrtXtAV2fOC14=
540+
connectrpc.com/connect v1.19.1/go.mod h1:tN20fjdGlewnSFeZxLKb0xwIZ6ozc3OQs2hTXy4du9w=
539541
connectrpc.com/grpcreflect v1.2.0 h1:Q6og1S7HinmtbEuBvARLNwYmTbhEGRpHDhqrPNlmK+U=
540542
connectrpc.com/grpcreflect v1.2.0/go.mod h1:nwSOKmE8nU5u/CidgHtPYk1PFI3U9ignz7iDMxOYkSY=
541543
connectrpc.com/otelconnect v0.7.2/go.mod h1:JS7XUKfuJs2adhCnXhNHPHLz6oAaZniCJdSF00OZSew=

go/oeco-sdk/v2beta/bindings/nats/configurer.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"encoding/json"
55
"errors"
66
"fmt"
7+
"os"
78

89
"github.com/nats-io/nats.go"
910
sdkv2betalib "github.com/openecosystems/ecosystem/go/oeco-sdk/v2beta"
@@ -96,7 +97,11 @@ func (b *Binding) ValidateConfiguration() error {
9697
if b.configuration.Natsd.Clustered {
9798

9899
if b.configuration.Natsd.ServerName == "" {
99-
errs = append(errs, errors.New("Natsd.ServerName is required"))
100+
if podName, ok := os.LookupEnv("POD_NAME"); ok && podName != "" {
101+
b.configuration.Natsd.ServerName = podName
102+
} else {
103+
errs = append(errs, errors.New("Natsd.ServerName is required (missing and POD_NAME not set)"))
104+
}
100105
}
101106

102107
if b.configuration.Natsd.Cluster.Host == "" {

go/oeco-sdk/v2beta/gen/platform/spec/v2/spec_settings.pb.go

Lines changed: 21 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/oeco-sdk/v2beta/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.24.6
55
require (
66
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250717165733-d22d418d82d8.1
77
buf.build/go/protovalidate v0.14.0
8-
connectrpc.com/connect v1.19.0
8+
connectrpc.com/connect v1.19.1
99
connectrpc.com/vanguard v0.3.0
1010
dario.cat/mergo v1.0.2
1111
github.com/apex/log v1.9.0

go/oeco-sdk/v2beta/server.go

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ type Server struct {
4141
NetListener *net.Listener
4242

4343
options *serverOptions
44+
publicGRPCServer *http.Server
4445
publicHTTPServer *http.Server
4546
meshHTTPServer *http.Server
4647
// err error
@@ -214,6 +215,7 @@ func (server *Server) listenAndServe(ln *net.Listener) (httpServerErr chan error
214215
return
215216
}
216217

218+
publicGrpcEndpoint := settings.Platform.GetGrpcEndpoint()
217219
publicEndpoint := settings.Platform.GetEndpoint()
218220
meshEndpoint := settings.Platform.Mesh.GetEndpoint()
219221

@@ -250,6 +252,16 @@ func (server *Server) listenAndServe(ln *net.Listener) (httpServerErr chan error
250252
server.MeshHTTPServerHandler = meshMux
251253
meshMux.Handle("/", server.MeshServiceHandler)
252254

255+
publicGRPCServer := &http.Server{
256+
Addr: publicGrpcEndpoint,
257+
// Use h2c so we can serve HTTP/2 without TLS.
258+
Handler: h2c.NewHandler(edgeRouter(publicMux), server.PublicConnectHTTPServer),
259+
ReadTimeout: 5 * time.Second, // Time allowed to read the request
260+
WriteTimeout: 10 * time.Second, // Time allowed to write the response
261+
IdleTimeout: 15 * time.Second, // Time for keep-alive connections
262+
}
263+
server.publicGRPCServer = publicGRPCServer
264+
253265
publicHTTPServer := &http.Server{
254266
Addr: publicEndpoint,
255267
// Use h2c so we can serve HTTP/2 without TLS.
@@ -276,7 +288,12 @@ func (server *Server) listenAndServe(ln *net.Listener) (httpServerErr chan error
276288
go func() {
277289
_httpServerErr <- server.publicHTTPServer.ListenAndServe()
278290
}()
279-
fmt.Println("Public HTTP1.1/HTTP2.0/gRPC/gRPC-Web/Connect listening on " + settings.Platform.Endpoint)
291+
fmt.Println("Public HTTP1.1/HTTP2.0/Connect listening on " + settings.Platform.Endpoint)
292+
293+
go func() {
294+
_httpServerErr <- server.publicGRPCServer.ListenAndServe()
295+
}()
296+
fmt.Println("Public gRPC listening on " + settings.Platform.GrpcEndpoint)
280297
}
281298

282299
if server.MeshConnectHTTPServer != nil {
@@ -321,6 +338,10 @@ func (server *Server) Shutdown() {
321338
if err := server.publicHTTPServer.Shutdown(ctx); err != nil {
322339
fmt.Println("Public server shutdown error:", err)
323340
}
341+
342+
if err := server.publicGRPCServer.Shutdown(ctx); err != nil {
343+
fmt.Println("Public gRPC server shutdown error:", err)
344+
}
324345
}
325346

326347
if server.MeshConnectHTTPServer != nil {

libs/plugins/protoc-gen-platform/languages/typescript/plugins/client/templates/class_open.ts.tmpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ export class AdinoSDK {
66
constructor(private readonly options: AdinoSDKOptions) {
77
const interceptor = new SpecInterceptor(options);
88
const baseUrl = this.options.baseUrl ?? BaseUrl;
9+
const interceptors: Interceptor[] = [
10+
...(this.options.interceptors ?? []),
11+
interceptor.spec,
12+
];
913
this.transport = createConnectTransport({
1014
baseUrl: baseUrl,
1115
defaultTimeoutMs: this.options.timeoutMs,
12-
interceptors: [interceptor.spec],
16+
interceptors: interceptors,
1317
});
1418
}

0 commit comments

Comments
 (0)