diff --git a/chaoscenter/authentication/api/main.go b/chaoscenter/authentication/api/main.go index c325ccf97d4..08257d0fbcc 100644 --- a/chaoscenter/authentication/api/main.go +++ b/chaoscenter/authentication/api/main.go @@ -197,17 +197,15 @@ func runRestServer(applicationService services.ApplicationService) { routes.UserRouter(app, applicationService) routes.ProjectRouter(app, applicationService) - log.Infof("Listening and serving HTTP on %s", utils.RestPort) - if utils.EnableInternalTls { if utils.TlsCertPath != "" && utils.TlSKeyPath != "" { conf := utils.GetTlsConfig() server := http.Server{ - Addr: utils.RestPort, + Addr: ":" + utils.RestPort, Handler: app, TLSConfig: conf, } - log.Infof("Listening and serving HTTPS on %s", utils.RestPort) + log.Infof("Listening and serving HTTPS on :%s", utils.RestPort) err := server.ListenAndServeTLS("", "") if err != nil { log.Fatalf("Failure to start litmus-portal authentication REST server due to %v", err) @@ -216,8 +214,8 @@ func runRestServer(applicationService services.ApplicationService) { log.Fatalf("Failure to start chaoscenter authentication REST server due to empty TLS cert file path and TLS key path") } } else { - log.Infof("Listening and serving HTTP on %s", utils.RestPort) - err := app.Run(utils.RestPort) + log.Infof("Listening and serving HTTP on :%s", utils.RestPort) + err := app.Run(":" + utils.RestPort) if err != nil { log.Fatalf("Failure to start litmus-portal authentication REST server due to %v", err) } @@ -226,7 +224,7 @@ func runRestServer(applicationService services.ApplicationService) { func runGrpcServer(applicationService services.ApplicationService) { // Starting gRPC server - lis, err := net.Listen("tcp", utils.GrpcPort) + lis, err := net.Listen("tcp", ":"+utils.GrpcPort) if err != nil { log.Fatalf("Failure to start litmus-portal authentication server due"+ " to %s", err) @@ -234,7 +232,7 @@ func runGrpcServer(applicationService services.ApplicationService) { grpcApplicationServer := grpcHandler.ServerGrpc{ApplicationService: applicationService} grpcServer := grpc.NewServer() grpcPresenter.RegisterAuthRpcServiceServer(grpcServer, &grpcApplicationServer) - log.Infof("Listening and serving gRPC on %s", utils.GrpcPort) + log.Infof("Listening and serving gRPC on :%s", utils.GrpcPort) err = grpcServer.Serve(lis) if err != nil { log.Fatalf("Failure to start chaoscenter authentication GRPC server due to %v", err) @@ -244,7 +242,7 @@ func runGrpcServer(applicationService services.ApplicationService) { func runGrpcServerWithTLS(applicationService services.ApplicationService) { // Starting gRPC server - lis, err := net.Listen("tcp", utils.GrpcPort) + lis, err := net.Listen("tcp", ":"+utils.GrpcPort) if err != nil { log.Fatalf("Failure to start litmus-portal authentication server due to %s", err) } @@ -262,7 +260,7 @@ func runGrpcServerWithTLS(applicationService services.ApplicationService) { grpcPresenter.RegisterAuthRpcServiceServer(grpcServer, &grpcApplicationServer) - log.Infof("Listening and serving gRPC on %s with TLS", utils.GrpcPort) + log.Infof("Listening and serving gRPC on :%s with TLS", utils.GrpcPort) err = grpcServer.Serve(lis) if err != nil { log.Fatalf("Failure to start chaoscenter authentication GRPC server due to %v", err) diff --git a/chaoscenter/graphql/server/pkg/grpc/auth_grpc_client.go b/chaoscenter/graphql/server/pkg/grpc/auth_grpc_client.go index e1b996eefbf..6eb0c24d63b 100644 --- a/chaoscenter/graphql/server/pkg/grpc/auth_grpc_client.go +++ b/chaoscenter/graphql/server/pkg/grpc/auth_grpc_client.go @@ -30,7 +30,7 @@ func GetAuthGRPCSvcClient(conn *grpc.ClientConn) (protos.AuthRpcServiceClient, * tlsCredential := credentials.NewTLS(conf) // Set up a connection to the server. - conn, err = grpc.NewClient(utils.Config.LitmusAuthGrpcEndpoint+utils.Config.LitmusAuthGrpcPort, grpc.WithTransportCredentials(tlsCredential)) + conn, err = grpc.NewClient(utils.Config.LitmusAuthGrpcEndpoint+":"+utils.Config.LitmusAuthGrpcPort, grpc.WithTransportCredentials(tlsCredential)) if err != nil { logrus.Fatalf("did not connect: %v", err) } @@ -38,7 +38,7 @@ func GetAuthGRPCSvcClient(conn *grpc.ClientConn) (protos.AuthRpcServiceClient, * logrus.Fatalf("Failure to start chaoscenter authentication REST server due to empty TLS cert file path and TLS key path") } } else { - conn, err = grpc.Dial(utils.Config.LitmusAuthGrpcEndpoint+utils.Config.LitmusAuthGrpcPort, grpc.WithBlock(), grpc.WithInsecure()) + conn, err = grpc.Dial(utils.Config.LitmusAuthGrpcEndpoint+":"+utils.Config.LitmusAuthGrpcPort, grpc.WithBlock(), grpc.WithInsecure()) if err != nil { logrus.Fatalf("did not connect: %s", err) } diff --git a/chaoscenter/graphql/server/utils/variables.go b/chaoscenter/graphql/server/utils/variables.go index a9d1f58661b..678c7feb731 100644 --- a/chaoscenter/graphql/server/utils/variables.go +++ b/chaoscenter/graphql/server/utils/variables.go @@ -22,7 +22,7 @@ type Configuration struct { ChaosCenterUiEndpoint string `split_words:"true" default:"https://localhost:8080"` TlsCertB64 string `split_words:"true"` LitmusAuthGrpcEndpoint string `split_words:"true" default:"localhost"` - LitmusAuthGrpcPort string `split_words:"true" default:":3030"` + LitmusAuthGrpcPort string `split_words:"true" default:"3030"` KubeConfigFilePath string `split_words:"true"` RemoteHubMaxSize string `split_words:"true"` SkipSslVerify string `split_words:"true"` diff --git a/chaoscenter/manifests/litmus-getting-started.yaml b/chaoscenter/manifests/litmus-getting-started.yaml index 8f26c8bf59e..8ae51e80573 100644 --- a/chaoscenter/manifests/litmus-getting-started.yaml +++ b/chaoscenter/manifests/litmus-getting-started.yaml @@ -236,7 +236,7 @@ spec: - name: LITMUS_AUTH_GRPC_ENDPOINT value: "litmusportal-auth-server-service" - name: LITMUS_AUTH_GRPC_PORT - value: ":3030" + value: "3030" - name: WORKFLOW_HELPER_IMAGE_VERSION value: "ci" - name: REMOTE_HUB_MAX_SIZE @@ -346,7 +346,7 @@ spec: - name: LITMUS_GQL_GRPC_ENDPOINT value: "litmusportal-server-service" - name: LITMUS_GQL_GRPC_PORT - value: ":8000" + value: "8000" - name: ALLOWED_ORIGINS value: ".*" #eg: ^(http://|https://|)litmuschaos.io(:[0-9]+|)?,^(http://|https://|)litmusportal-server-service(:[0-9]+|)? - name: ENABLE_INTERNAL_TLS diff --git a/chaoscenter/manifests/litmus-installation.yaml b/chaoscenter/manifests/litmus-installation.yaml index aa214b00b03..62c40d517f6 100644 --- a/chaoscenter/manifests/litmus-installation.yaml +++ b/chaoscenter/manifests/litmus-installation.yaml @@ -262,7 +262,7 @@ spec: - name: LITMUS_AUTH_GRPC_ENDPOINT value: "litmusportal-auth-server-service" - name: LITMUS_AUTH_GRPC_PORT - value: ":3030" + value: "3030" - name: WORKFLOW_HELPER_IMAGE_VERSION value: "ci" - name: REMOTE_HUB_MAX_SIZE @@ -379,7 +379,7 @@ spec: - name: LITMUS_GQL_GRPC_ENDPOINT value: "litmusportal-server-service" - name: LITMUS_GQL_GRPC_PORT - value: ":8000" + value: "8000" - name: ALLOWED_ORIGINS value: "^(http://|https://|)litmuschaos.io(:[0-9]+|)?,^(http://|https://|)litmusportal-server-service(:[0-9]+|)?" #ip needs to added here - name: ENABLE_INTERNAL_TLS diff --git a/chaoscenter/manifests/litmus-without-resources.yaml b/chaoscenter/manifests/litmus-without-resources.yaml index 49e07dfb5f9..9645e9a247a 100644 --- a/chaoscenter/manifests/litmus-without-resources.yaml +++ b/chaoscenter/manifests/litmus-without-resources.yaml @@ -253,7 +253,7 @@ spec: - name: LITMUS_AUTH_GRPC_ENDPOINT value: "litmusportal-auth-server-service" - name: LITMUS_AUTH_GRPC_PORT - value: ":3030" + value: "3030" - name: WORKFLOW_HELPER_IMAGE_VERSION value: "ci" - name: REMOTE_HUB_MAX_SIZE @@ -361,7 +361,7 @@ spec: - name: LITMUS_GQL_GRPC_ENDPOINT value: "litmusportal-server-service" - name: LITMUS_GQL_GRPC_PORT - value: ":8000" + value: "8000" - name: ALLOWED_ORIGINS value: "^(http://|https://|)litmuschaos.io(:[0-9]+|)?,^(http://|https://|)litmusportal-server-service(:[0-9]+|)?" #ip needs to added here - name: ENABLE_INTERNAL_TLS