diff --git a/Dockerfile b/Dockerfile index 91773e1..fc065ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,6 @@ LABEL maintainer="Bo-Yi Wu " ADD config/config.yml / ADD bin/gorush / -EXPOSE 8088 +EXPOSE 8088 9000 ENTRYPOINT ["/gorush"] CMD ["-c", "config.yml"] diff --git a/Dockerfile.arm b/Dockerfile.arm index 9c7be04..f8470c8 100644 --- a/Dockerfile.arm +++ b/Dockerfile.arm @@ -10,6 +10,6 @@ LABEL maintainer="Bo-Yi Wu " ADD config/config.yml / ADD bin/gorush-arm /gorush -EXPOSE 8088 +EXPOSE 8088 9000 ENTRYPOINT ["/gorush"] CMD ["-c", "config.yml"] diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index 6fb54e6..be5fdba 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -10,6 +10,6 @@ LABEL maintainer="Bo-Yi Wu " ADD config/config.yml / ADD bin/gorush-arm64 /gorush -EXPOSE 8088 +EXPOSE 8088 9000 ENTRYPOINT ["/gorush"] CMD ["-c", "config.yml"] diff --git a/README.md b/README.md index 2252ecc..59ac1c5 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ core: grpc: enabled: false # enabale gRPC server - port: 50051 + port: 9000 api: push_uri: "/api/push" @@ -675,7 +675,7 @@ import ( ) const ( - address = "localhost:50051" + address = "localhost:9000" ) func main() { @@ -710,7 +710,7 @@ var services = require('./gorush_grpc_pb'); var grpc = require('grpc'); function main() { - var client = new services.GorushClient('localhost:50051', + var client = new services.GorushClient('localhost:9000', grpc.credentials.createInsecure()); var request = new messages.NotificationRequest(); request.setPlatform(2); diff --git a/config/config.go b/config/config.go index d3f25cf..0cc8162 100644 --- a/config/config.go +++ b/config/config.go @@ -188,7 +188,7 @@ func BuildDefaultPushConf() ConfYaml { // gRPC Server conf.GRPC.Enabled = false - conf.GRPC.Port = "50051" + conf.GRPC.Port = "9000" return conf } diff --git a/config/config.yml b/config/config.yml index cdc5a4d..2db1377 100644 --- a/config/config.yml +++ b/config/config.yml @@ -22,7 +22,7 @@ core: grpc: enabled: false # enabale gRPC server - port: 50051 + port: 9000 api: push_uri: "/api/push" diff --git a/config/config_test.go b/config/config_test.go index a4bc43a..a69efae 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -119,7 +119,7 @@ func (suite *ConfigTestSuite) TestValidateConfDefault() { // gRPC assert.Equal(suite.T(), false, suite.ConfGorushDefault.GRPC.Enabled) - assert.Equal(suite.T(), "50051", suite.ConfGorushDefault.GRPC.Port) + assert.Equal(suite.T(), "9000", suite.ConfGorushDefault.GRPC.Port) } func (suite *ConfigTestSuite) TestValidateConf() { @@ -184,7 +184,7 @@ func (suite *ConfigTestSuite) TestValidateConf() { // gRPC assert.Equal(suite.T(), false, suite.ConfGorush.GRPC.Enabled) - assert.Equal(suite.T(), "50051", suite.ConfGorush.GRPC.Port) + assert.Equal(suite.T(), "9000", suite.ConfGorush.GRPC.Port) } func TestConfigTestSuite(t *testing.T) { diff --git a/rpc/example/go/client.go b/rpc/example/go/client.go index 2c6b1c3..254621a 100644 --- a/rpc/example/go/client.go +++ b/rpc/example/go/client.go @@ -9,7 +9,7 @@ import ( ) const ( - address = "localhost:50051" + address = "localhost:9000" ) func main() { diff --git a/rpc/example/node/client.js b/rpc/example/node/client.js index 2965910..81cdfc2 100644 --- a/rpc/example/node/client.js +++ b/rpc/example/node/client.js @@ -4,7 +4,7 @@ var services = require('./gorush_grpc_pb'); var grpc = require('grpc'); function main() { - var client = new services.GorushClient('localhost:50051', + var client = new services.GorushClient('localhost:9000', grpc.credentials.createInsecure()); var request = new messages.NotificationRequest(); request.setPlatform(2); diff --git a/rpc/server.go b/rpc/server.go index 17ee111..682c846 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -12,7 +12,7 @@ import ( ) const ( - port = ":50051" + port = ":9000" ) // server is used to implement gorush grpc server. @@ -46,7 +46,7 @@ func RunGRPCServer() error { lis, err := net.Listen("tcp", ":"+gorush.PushConf.GRPC.Port) if err != nil { - gorush.LogError.Error("failed to listen: %v", err) + gorush.LogError.Errorf("failed to listen: %v", err) return err } s := grpc.NewServer() @@ -55,7 +55,7 @@ func RunGRPCServer() error { reflection.Register(s) gorush.LogAccess.Debug("gRPC server is running on " + gorush.PushConf.GRPC.Port + " port.") if err := s.Serve(lis); err != nil { - gorush.LogError.Error("failed to serve: %v", err) + gorush.LogError.Errorf("failed to serve: %v", err) return err }