diff --git a/.gitignore b/.gitignore index 9cea0d86f..7ca2fe3fd 100644 --- a/.gitignore +++ b/.gitignore @@ -31,16 +31,16 @@ _output/ ### OpenIM deploy ### deploy/openim_demo -deploy/openim_api +deploy/openim-api deploy/openim_msg_gateway deploy/openim_msg_transfer -deploy/openim_push +deploy/openim-push deploy/openim_timer_task -deploy/openim_rpc_user -deploy/openim_rpc_friend -deploy/openim_rpc_group -deploy/openim_rpc_msg -deploy/openim_rpc_auth +deploy/openim-rpc-user +deploy/openim-rpc-friend +deploy/openim-rpc-group +deploy/openim-rpc-msg +deploy/openim-rpc-auth deploy/Open-IM-SDK-Core # files used by the developer diff --git a/Makefile b/Makefile index 8d5c66eb5..5fcc3b8c3 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ Options: BINS Binaries to build. Default is all binaries under cmd. This option is available when using: make {build}(.multiarch) - Example: make build BINS="openim_api openim_cmdutils". + Example: make build BINS="openim-api openim-cmdutils". PLATFORMS Platform to build for. Default is linux_arm64 and linux_amd64. This option is available when using: make {build}.multiarch diff --git a/cmd/openim_api/Makefile b/cmd/openim_api/Makefile deleted file mode 100644 index 4fe47f51f..000000000 --- a/cmd/openim_api/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -.PHONY: all build run gotool install clean help - -NAME=openim_api -BIN_DIR=../../bin/ - -OS:= $(or $(os),linux) -ARCH:=$(or $(arch),amd64) -all: gotool build - -ifeq ($(OS),windows) - -BINARY_NAME=${NAME}.exe - -else - -BINARY_NAME=${NAME} - -endif - -build: - CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME} - -run: - @go run ./ - -gotool: - go fmt ./ - go vet ./ - -install:build - mv ${BINARY_NAME} ${BIN_DIR} - -clean: - @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi diff --git a/cmd/openim_api/deploy.Dockerfile b/cmd/openim_api/deploy.Dockerfile deleted file mode 100644 index 24a17af37..000000000 --- a/cmd/openim_api/deploy.Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM ubuntu - -WORKDIR /Open-IM-Server/bin - -RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\ -&&apt-get install net-tools -#Non-interactive operation -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get install -y vim curl tzdata gawk -#Time zone adjusted to East eighth District -RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata -RUN apt-get -qq update \ - && apt-get -qq install -y --no-install-recommends ca-certificates curl -COPY ./openim_api ./ - -VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"] - -CMD ["./openim_api","--port", "10002"] diff --git a/cmd/openim_api/main.go b/cmd/openim_api/main.go deleted file mode 100644 index aac83a805..000000000 --- a/cmd/openim_api/main.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright © 2023 OpenIM. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "context" - "fmt" - "net" - "os" - "runtime" - "strconv" - "time" - - "net/http" - _ "net/http/pprof" - - "github.com/OpenIMSDK/Open-IM-Server/internal/api" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/log" - "github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry" - openKeeper "github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry/zookeeper" -) - -func main() { - apiCmd := cmd.NewApiCmd() - apiCmd.AddPortFlag() - apiCmd.AddApi(run) - if err := apiCmd.Execute(); err != nil { - panic(err.Error()) - } -} - -func startPprof() { - runtime.GOMAXPROCS(1) - runtime.SetMutexProfileFraction(1) - runtime.SetBlockProfileRate(1) - if err := http.ListenAndServe(":6060", nil); err != nil { - panic(err) - } - os.Exit(0) -} - -func run(port int) error { - if port == 0 { - return fmt.Errorf("port is empty") - } - rdb, err := cache.NewRedis() - if err != nil { - return err - } - fmt.Println("api start init discov client") - var client discoveryregistry.SvcDiscoveryRegistry - client, err = openKeeper.NewClient(config.Config.Zookeeper.ZkAddr, config.Config.Zookeeper.Schema, - openKeeper.WithFreq(time.Hour), openKeeper.WithUserNameAndPassword( - config.Config.Zookeeper.Username, - config.Config.Zookeeper.Password, - ), openKeeper.WithRoundRobin(), openKeeper.WithTimeout(10), openKeeper.WithLogger(log.NewZkLogger())) - if err != nil { - return err - } - if client.CreateRpcRootNodes(config.GetServiceNames()); err != nil { - return err - } - fmt.Println("api init discov client success") - fmt.Println("api register public config to discov") - if err := client.RegisterConf2Registry(constant.OpenIMCommonConfigKey, config.EncodeConfig()); err != nil { - return err - } - fmt.Println("api register public config to discov success") - router := api.NewGinRouter(client, rdb) - fmt.Println("api init router success") - var address string - if config.Config.Api.ListenIP != "" { - address = net.JoinHostPort(config.Config.Api.ListenIP, strconv.Itoa(port)) - } else { - address = net.JoinHostPort("0.0.0.0", strconv.Itoa(port)) - } - fmt.Println("start api server, address: ", address, ", OpenIM version: ", config.Version) - log.ZInfo(context.Background(), "start server success", "address", address, "version", config.Version) - go startPprof() - err = router.Run(address) - if err != nil { - log.ZError(context.Background(), "api run failed ", err, "address", address) - return err - } - return nil -} diff --git a/cmd/openim_cmdutils/Makefile b/cmd/openim_cmdutils/Makefile deleted file mode 100644 index 9c51aee84..000000000 --- a/cmd/openim_cmdutils/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -.PHONY: all build run gotool install clean help - -NAME=openim_cmd_utils -BIN_DIR=../../bin/ - -OS:= $(or $(os),linux) -ARCH:=$(or $(arch),amd64) -all: gotool build - -ifeq ($(OS),windows) - -BINARY_NAME=${NAME}.exe - -else - -BINARY_NAME=${NAME} - -endif - -build: - CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME} - -run: - @go run ./ - -gotool: - go fmt ./ - go vet ./ - -install:build - mv ${BINARY_NAME} ${BIN_DIR} - -clean: - @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi diff --git a/cmd/openim_cmdutils/main.go b/cmd/openim_cmdutils/main.go deleted file mode 100644 index 64079c7e1..000000000 --- a/cmd/openim_cmdutils/main.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright © 2023 OpenIM. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" -) - -func main() { - msgUtilsCmd := cmd.NewMsgUtilsCmd("openIMCmdUtils", "openIM cmd utils", nil) - getCmd := cmd.NewGetCmd() - fixCmd := cmd.NewFixCmd() - clearCmd := cmd.NewClearCmd() - seqCmd := cmd.NewSeqCmd() - msgCmd := cmd.NewMsgCmd() - getCmd.AddCommand(seqCmd.GetSeqCmd(), msgCmd.GetMsgCmd()) - getCmd.AddSuperGroupIDFlag() - getCmd.AddUserIDFlag() - getCmd.AddBeginSeqFlag() - getCmd.AddLimitFlag() - // openIM get seq --userID=xxx - // openIM get seq --superGroupID=xxx - // openIM get msg --userID=xxx --beginSeq=100 --limit=10 - // openIM get msg --superGroupID=xxx --beginSeq=100 --limit=10 - - fixCmd.AddCommand(seqCmd.FixSeqCmd()) - fixCmd.AddSuperGroupIDFlag() - fixCmd.AddUserIDFlag() - fixCmd.AddFixAllFlag() - // openIM fix seq --userID=xxx - // openIM fix seq --superGroupID=xxx - // openIM fix seq --fixAll - - clearCmd.AddCommand(msgCmd.ClearMsgCmd()) - clearCmd.AddSuperGroupIDFlag() - clearCmd.AddUserIDFlag() - clearCmd.AddClearAllFlag() - clearCmd.AddBeginSeqFlag() - clearCmd.AddLimitFlag() - // openIM clear msg --userID=xxx --beginSeq=100 --limit=10 - // openIM clear msg --superGroupID=xxx --beginSeq=100 --limit=10 - // openIM clear msg --clearAll - msgUtilsCmd.AddCommand(&getCmd.Command, &fixCmd.Command, &clearCmd.Command) - if err := msgUtilsCmd.Execute(); err != nil { - panic(err) - } -} diff --git a/cmd/openim_crontask/Makefile b/cmd/openim_crontask/Makefile deleted file mode 100644 index 1f09bf396..000000000 --- a/cmd/openim_crontask/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -.PHONY: all build run gotool install clean help - -NAME=openim_cron_task -BIN_DIR=../../bin/ - -OS:= $(or $(os),linux) -ARCH:=$(or $(arch),amd64) -all: gotool build - -ifeq ($(OS),windows) - -BINARY_NAME=${NAME}.exe - -else - -BINARY_NAME=${NAME} - -endif - -build: - CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME} - -run: - @go run ./ - -gotool: - go fmt ./ - go vet ./ - -install:build - mv ${BINARY_NAME} ${BIN_DIR} - -clean: - @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi diff --git a/cmd/openim_crontask/deploy.Dockerfile b/cmd/openim_crontask/deploy.Dockerfile deleted file mode 100644 index 07d328474..000000000 --- a/cmd/openim_crontask/deploy.Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM ubuntu - -WORKDIR /Open-IM-Server/bin - -RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\ -&&apt-get install net-tools -#Non-interactive operation -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get install -y vim curl tzdata gawk -#Time zone adjusted to East eighth District -RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata -RUN apt-get -qq update \ - && apt-get -qq install -y --no-install-recommends ca-certificates curl -COPY ./openim_cron_task ./ - -VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"] - -CMD ["./openim_cron_task"] diff --git a/cmd/openim_crontask/main.go b/cmd/openim_crontask/main.go deleted file mode 100644 index 73deb8c66..000000000 --- a/cmd/openim_crontask/main.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright © 2023 OpenIM. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/tools" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" -) - -func main() { - cronTaskCmd := cmd.NewCronTaskCmd() - if err := cronTaskCmd.Exec(tools.StartCronTask); err != nil { - panic(err.Error()) - } -} diff --git a/cmd/openim_msggateway/Makefile b/cmd/openim_msggateway/Makefile deleted file mode 100644 index 07cad40a9..000000000 --- a/cmd/openim_msggateway/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -.PHONY: all build run gotool install clean help - -NAME=openim_msg_gateway -BIN_DIR=../../bin/ - -OS:= $(or $(os),linux) -ARCH:=$(or $(arch),amd64) -all: gotool build - -ifeq ($(OS),windows) - -BINARY_NAME=${NAME}.exe - -else - -BINARY_NAME=${NAME} - -endif - -build: - CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME} - -run: - @go run ./ - -gotool: - go fmt ./ - go vet ./ - -install:build - mv ${BINARY_NAME} ${BIN_DIR} - -clean: - @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi diff --git a/cmd/openim_msggateway/deploy.Dockerfile b/cmd/openim_msggateway/deploy.Dockerfile deleted file mode 100644 index eab3d16db..000000000 --- a/cmd/openim_msggateway/deploy.Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM ubuntu - -WORKDIR /Open-IM-Server/bin - -RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\ -&&apt-get install net-tools -#Non-interactive operation -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get install -y vim curl tzdata gawk -#Time zone adjusted to East eighth District -RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata -RUN apt-get -qq update \ - && apt-get -qq install -y --no-install-recommends ca-certificates curl -COPY ./openim_msg_gateway ./ - -VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"] - -CMD ["./openim_msg_gateway","--port", "10140" "--ws_port", "10001", "--prometheus_port", "20240"] diff --git a/cmd/openim_msggateway/main.go b/cmd/openim_msggateway/main.go deleted file mode 100644 index 2782e4fd3..000000000 --- a/cmd/openim_msggateway/main.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright © 2023 OpenIM. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" -) - -func main() { - msgGatewayCmd := cmd.NewMsgGatewayCmd() - msgGatewayCmd.AddWsPortFlag() - msgGatewayCmd.AddPortFlag() - msgGatewayCmd.AddPrometheusPortFlag() - if err := msgGatewayCmd.Exec(); err != nil { - panic(err.Error()) - } -} diff --git a/cmd/openim_msgtransfer/Makefile b/cmd/openim_msgtransfer/Makefile deleted file mode 100644 index dc22834de..000000000 --- a/cmd/openim_msgtransfer/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -.PHONY: all build run gotool install clean help - -NAME=openim_msg_transfer -BIN_DIR=../../bin/ - -OS:= $(or $(os),linux) -ARCH:=$(or $(arch),amd64) -all: gotool build - -ifeq ($(OS),windows) - -BINARY_NAME=${NAME}.exe - -else - -BINARY_NAME=${NAME} - -endif - -build: - CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME} - -run: - @go run ./ - -gotool: - go fmt ./ - go vet ./ - -install:build - mv ${BINARY_NAME} ${BIN_DIR} - -clean: - @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi diff --git a/cmd/openim_msgtransfer/deploy.Dockerfile b/cmd/openim_msgtransfer/deploy.Dockerfile deleted file mode 100644 index 91767adf4..000000000 --- a/cmd/openim_msgtransfer/deploy.Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM ubuntu - -WORKDIR /Open-IM-Server/bin - -RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\ -&&apt-get install net-tools -#Non-interactive operation -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get install -y vim curl tzdata gawk -#Time zone adjusted to East eighth District -RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata -RUN apt-get -qq update \ - && apt-get -qq install -y --no-install-recommends ca-certificates curl -COPY ./openim_msg_transfer ./ - -VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"] - -CMD ["./openim_msg_transfer","--prometheus_port", "21400"] diff --git a/cmd/openim_msgtransfer/main.go b/cmd/openim_msgtransfer/main.go deleted file mode 100644 index aef347793..000000000 --- a/cmd/openim_msgtransfer/main.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright © 2023 OpenIM. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" -) - -func main() { - msgTransferCmd := cmd.NewMsgTransferCmd() - msgTransferCmd.AddPrometheusPortFlag() - if err := msgTransferCmd.Exec(); err != nil { - panic(err.Error()) - } -} diff --git a/cmd/openim_push/Makefile b/cmd/openim_push/Makefile deleted file mode 100644 index c67882553..000000000 --- a/cmd/openim_push/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -.PHONY: all build run gotool install clean help - -NAME=openim_push -BIN_DIR=../../bin/ - -OS:= $(or $(os),linux) -ARCH:=$(or $(arch),amd64) -all: gotool build - -ifeq ($(OS),windows) - -BINARY_NAME=${NAME}.exe - -else - -BINARY_NAME=${NAME} - -endif - -build: - CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME} - -run: - @go run ./ - -gotool: - go fmt ./ - go vet ./ - -install:build - mv ${BINARY_NAME} ${BIN_DIR} - -clean: - @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi diff --git a/cmd/openim_push/deploy.Dockerfile b/cmd/openim_push/deploy.Dockerfile deleted file mode 100644 index 9b9a542c3..000000000 --- a/cmd/openim_push/deploy.Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM ubuntu - -WORKDIR /Open-IM-Server/bin - -RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\ -&&apt-get install net-tools -#Non-interactive operation -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get install -y vim curl tzdata gawk -#Time zone adjusted to East eighth District -RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata -RUN apt-get -qq update \ - && apt-get -qq install -y --no-install-recommends ca-certificates curl -COPY ./openim_push ./ - -VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"] - -CMD ["./openim_push", "--port", "10170", "--prometheus_port", "20170"] diff --git a/cmd/openim_push/main.go b/cmd/openim_push/main.go deleted file mode 100644 index 03db8ae03..000000000 --- a/cmd/openim_push/main.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright © 2023 OpenIM. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/push" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" -) - -func main() { - pushCmd := cmd.NewRpcCmd("push") - pushCmd.AddPortFlag() - pushCmd.AddPrometheusPortFlag() - if err := pushCmd.Exec(); err != nil { - panic(err.Error()) - } - if err := pushCmd.StartSvr(config.Config.RpcRegisterName.OpenImPushName, push.Start); err != nil { - panic(err.Error()) - } -} diff --git a/cmd/openim_rpc/openim_rpc_auth/Makefile b/cmd/openim_rpc/openim_rpc_auth/Makefile deleted file mode 100644 index f702786ae..000000000 --- a/cmd/openim_rpc/openim_rpc_auth/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -.PHONY: all build run gotool install clean help - -NAME=openim_auth -BIN_DIR=../../../bin/ - -OS:= $(or $(os),linux) -ARCH:=$(or $(arch),amd64) -all: gotool build - -ifeq ($(OS),windows) - -BINARY_NAME=${NAME}.exe - -else - -BINARY_NAME=${NAME} - -endif - -build: - CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME} - -run: - @go run ./ - -gotool: - go fmt ./ - go vet ./ - -install:build - mv ${BINARY_NAME} ${BIN_DIR} - -clean: - @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi diff --git a/cmd/openim_rpc/openim_rpc_auth/deploy.Dockerfile b/cmd/openim_rpc/openim_rpc_auth/deploy.Dockerfile deleted file mode 100644 index 1fc1682dd..000000000 --- a/cmd/openim_rpc/openim_rpc_auth/deploy.Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM ubuntu - -WORKDIR /Open-IM-Server/bin - -RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\ -&&apt-get install net-tools -#Non-interactive operation -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get install -y vim curl tzdata gawk -#Time zone adjusted to East eighth District -RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata -RUN apt-get -qq update \ - && apt-get -qq install -y --no-install-recommends ca-certificates curl -COPY ./openim_auth ./ - -VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"] - -CMD ["./openim_auth", "--port", "10160"] diff --git a/cmd/openim_rpc/openim_rpc_auth/main.go b/cmd/openim_rpc/openim_rpc_auth/main.go deleted file mode 100644 index 524804988..000000000 --- a/cmd/openim_rpc/openim_rpc_auth/main.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright © 2023 OpenIM. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/rpc/auth" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" -) - -func main() { - authCmd := cmd.NewRpcCmd("auth") - authCmd.AddPortFlag() - authCmd.AddPrometheusPortFlag() - if err := authCmd.Exec(); err != nil { - panic(err.Error()) - } - if err := authCmd.StartSvr(config.Config.RpcRegisterName.OpenImAuthName, auth.Start); err != nil { - panic(err.Error()) - } -} diff --git a/cmd/openim_rpc/openim_rpc_conversation/Makefile b/cmd/openim_rpc/openim_rpc_conversation/Makefile deleted file mode 100644 index fa973060e..000000000 --- a/cmd/openim_rpc/openim_rpc_conversation/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -.PHONY: all build run gotool install clean help - -NAME=openim_conversation -BIN_DIR=../../../bin/ - -OS:= $(or $(os),linux) -ARCH:=$(or $(arch),amd64) -all: gotool build - -ifeq ($(OS),windows) - -BINARY_NAME=${NAME}.exe - -else - -BINARY_NAME=${NAME} - -endif - -build: - CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME} - -run: - @go run ./ - -gotool: - go fmt ./ - go vet ./ - -install:build - mv ${BINARY_NAME} ${BIN_DIR} - -clean: - @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi diff --git a/cmd/openim_rpc/openim_rpc_conversation/deploy.Dockerfile b/cmd/openim_rpc/openim_rpc_conversation/deploy.Dockerfile deleted file mode 100644 index 5aab79104..000000000 --- a/cmd/openim_rpc/openim_rpc_conversation/deploy.Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM ubuntu - -WORKDIR /Open-IM-Server/bin - -RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\ -&&apt-get install net-tools -#Non-interactive operation -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get install -y vim curl tzdata gawk -#Time zone adjusted to East eighth District -RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata -RUN apt-get -qq update \ - && apt-get -qq install -y --no-install-recommends ca-certificates curl -COPY ./openim_conversation ./ - -VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"] - -CMD ["./openim_conversation", "--port", "10230", "--prometheus_port","20230"] diff --git a/cmd/openim_rpc/openim_rpc_conversation/main.go b/cmd/openim_rpc/openim_rpc_conversation/main.go deleted file mode 100644 index fec8226f8..000000000 --- a/cmd/openim_rpc/openim_rpc_conversation/main.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright © 2023 OpenIM. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/rpc/conversation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" -) - -func main() { - rpcCmd := cmd.NewRpcCmd("conversation") - rpcCmd.AddPortFlag() - rpcCmd.AddPrometheusPortFlag() - if err := rpcCmd.Exec(); err != nil { - panic(err.Error()) - } - if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImConversationName, conversation.Start); err != nil { - panic(err.Error()) - } -} diff --git a/cmd/openim_rpc/openim_rpc_friend/Makefile b/cmd/openim_rpc/openim_rpc_friend/Makefile deleted file mode 100644 index 8cbb39c2b..000000000 --- a/cmd/openim_rpc/openim_rpc_friend/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -.PHONY: all build run gotool install clean help - -NAME=openim_friend -BIN_DIR=../../../bin/ - -OS:= $(or $(os),linux) -ARCH:=$(or $(arch),amd64) -all: gotool build - -ifeq ($(OS),windows) - -BINARY_NAME=${NAME}.exe - -else - -BINARY_NAME=${NAME} - -endif - -build: - CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME} - -run: - @go run ./ - -gotool: - go fmt ./ - go vet ./ - -install:build - mv ${BINARY_NAME} ${BIN_DIR} - -clean: - @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi diff --git a/cmd/openim_rpc/openim_rpc_friend/deploy.Dockerfile b/cmd/openim_rpc/openim_rpc_friend/deploy.Dockerfile deleted file mode 100644 index 3aaf86885..000000000 --- a/cmd/openim_rpc/openim_rpc_friend/deploy.Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM ubuntu - -WORKDIR /Open-IM-Server/bin - -RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\ -&&apt-get install net-tools -#Non-interactive operation -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get install -y vim curl tzdata gawk -#Time zone adjusted to East eighth District -RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata -RUN apt-get -qq update \ - && apt-get -qq install -y --no-install-recommends ca-certificates curl -COPY ./openim_friend ./ - -VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"] - -CMD ["./openim_friend", "--port", "10120", "--prometheus_port","20120"] diff --git a/cmd/openim_rpc/openim_rpc_friend/main.go b/cmd/openim_rpc/openim_rpc_friend/main.go deleted file mode 100644 index fbd44038e..000000000 --- a/cmd/openim_rpc/openim_rpc_friend/main.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright © 2023 OpenIM. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/rpc/friend" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" -) - -func main() { - rpcCmd := cmd.NewRpcCmd("friend") - rpcCmd.AddPortFlag() - rpcCmd.AddPrometheusPortFlag() - if err := rpcCmd.Exec(); err != nil { - panic(err.Error()) - } - if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImFriendName, friend.Start); err != nil { - panic(err.Error()) - } -} diff --git a/cmd/openim_rpc/openim_rpc_group/Makefile b/cmd/openim_rpc/openim_rpc_group/Makefile deleted file mode 100644 index b33dbb259..000000000 --- a/cmd/openim_rpc/openim_rpc_group/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -.PHONY: all build run gotool install clean help - -NAME=openim_group -BIN_DIR=../../../bin/ - -OS:= $(or $(os),linux) -ARCH:=$(or $(arch),amd64) -all: gotool build - -ifeq ($(OS),windows) - -BINARY_NAME=${NAME}.exe - -else - -BINARY_NAME=${NAME} - -endif - -build: - CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME} - -run: - @go run ./ - -gotool: - go fmt ./ - go vet ./ - -install:build - mv ${BINARY_NAME} ${BIN_DIR} - -clean: - @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi diff --git a/cmd/openim_rpc/openim_rpc_group/deploy.Dockerfile b/cmd/openim_rpc/openim_rpc_group/deploy.Dockerfile deleted file mode 100644 index 1adb00bc5..000000000 --- a/cmd/openim_rpc/openim_rpc_group/deploy.Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM ubuntu - -WORKDIR /Open-IM-Server/bin - -RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\ -&&apt-get install net-tools -#Non-interactive operation -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get install -y vim curl tzdata gawk -#Time zone adjusted to East eighth District -RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata -RUN apt-get -qq update \ - && apt-get -qq install -y --no-install-recommends ca-certificates curl -COPY ./openim_group ./ - -VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"] - -CMD ["./openim_group", "--port", "10150", "--prometheus_port","20150"] diff --git a/cmd/openim_rpc/openim_rpc_group/main.go b/cmd/openim_rpc/openim_rpc_group/main.go deleted file mode 100644 index 06baac155..000000000 --- a/cmd/openim_rpc/openim_rpc_group/main.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright © 2023 OpenIM. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/rpc/group" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" -) - -func main() { - rpcCmd := cmd.NewRpcCmd("group") - rpcCmd.AddPortFlag() - rpcCmd.AddPrometheusPortFlag() - if err := rpcCmd.Exec(); err != nil { - panic(err.Error()) - } - if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImGroupName, group.Start); err != nil { - panic(err.Error()) - } -} diff --git a/cmd/openim_rpc/openim_rpc_msg/Makefile b/cmd/openim_rpc/openim_rpc_msg/Makefile deleted file mode 100644 index b27c5c420..000000000 --- a/cmd/openim_rpc/openim_rpc_msg/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -.PHONY: all build run gotool install clean help - -NAME=openim_msg -BIN_DIR=../../../bin/ - -OS:= $(or $(os),linux) -ARCH:=$(or $(arch),amd64) -all: gotool build - -ifeq ($(OS),windows) - -BINARY_NAME=${NAME}.exe - -else - -BINARY_NAME=${NAME} - -endif - -build: - CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME} - -run: - @go run ./ - -gotool: - go fmt ./ - go vet ./ - -install:build - mv ${BINARY_NAME} ${BIN_DIR} - -clean: - @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi diff --git a/cmd/openim_rpc/openim_rpc_msg/deploy.Dockerfile b/cmd/openim_rpc/openim_rpc_msg/deploy.Dockerfile deleted file mode 100644 index 10fd29f0a..000000000 --- a/cmd/openim_rpc/openim_rpc_msg/deploy.Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM ubuntu - -WORKDIR /Open-IM-Server/bin - -RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\ -&&apt-get install net-tools -#Non-interactive operation -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get install -y vim curl tzdata gawk -#Time zone adjusted to East eighth District -RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata -RUN apt-get -qq update \ - && apt-get -qq install -y --no-install-recommends ca-certificates curl -COPY ./openim_msg ./ - -VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"] - -CMD ["./openim_msg", "--port", "10130", "--prometheus_port","20130"] diff --git a/cmd/openim_rpc/openim_rpc_msg/main.go b/cmd/openim_rpc/openim_rpc_msg/main.go deleted file mode 100644 index 356081d33..000000000 --- a/cmd/openim_rpc/openim_rpc_msg/main.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright © 2023 OpenIM. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/rpc/msg" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" -) - -func main() { - rpcCmd := cmd.NewRpcCmd("msg") - rpcCmd.AddPortFlag() - rpcCmd.AddPrometheusPortFlag() - if err := rpcCmd.Exec(); err != nil { - panic(err.Error()) - } - if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImMsgName, msg.Start); err != nil { - panic(err.Error()) - } -} diff --git a/cmd/openim_rpc/openim_rpc_third/Makefile b/cmd/openim_rpc/openim_rpc_third/Makefile deleted file mode 100644 index b5a7c546a..000000000 --- a/cmd/openim_rpc/openim_rpc_third/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -.PHONY: all build run gotool install clean help - -NAME=openim_third -BIN_DIR=../../../bin/ - -OS:= $(or $(os),linux) -ARCH:=$(or $(arch),amd64) -all: gotool build - -ifeq ($(OS),windows) - -BINARY_NAME=${NAME}.exe - -else - -BINARY_NAME=${NAME} - -endif - -build: - CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME} - -run: - @go run ./ - -gotool: - go fmt ./ - go vet ./ - -install:build - mv ${BINARY_NAME} ${BIN_DIR} - -clean: - @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi diff --git a/cmd/openim_rpc/openim_rpc_third/deploy.Dockerfile b/cmd/openim_rpc/openim_rpc_third/deploy.Dockerfile deleted file mode 100644 index 7b6a1dfaf..000000000 --- a/cmd/openim_rpc/openim_rpc_third/deploy.Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM ubuntu - -WORKDIR /Open-IM-Server/bin - -RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\ -&&apt-get install net-tools -#Non-interactive operation -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get install -y vim curl tzdata gawk -#Time zone adjusted to East eighth District -RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata -RUN apt-get -qq update \ - && apt-get -qq install -y --no-install-recommends ca-certificates curl -COPY ./openim_third ./ - -VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"] - -CMD ["./openim_third", "--port", "10200"] diff --git a/cmd/openim_rpc/openim_rpc_third/main.go b/cmd/openim_rpc/openim_rpc_third/main.go deleted file mode 100644 index c070e6811..000000000 --- a/cmd/openim_rpc/openim_rpc_third/main.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright © 2023 OpenIM. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/rpc/third" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" -) - -func main() { - rpcCmd := cmd.NewRpcCmd("third") - rpcCmd.AddPortFlag() - rpcCmd.AddPrometheusPortFlag() - if err := rpcCmd.Exec(); err != nil { - panic(err.Error()) - } - if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImThirdName, third.Start); err != nil { - panic(err.Error()) - } -} diff --git a/cmd/openim_rpc/openim_rpc_user/Makefile b/cmd/openim_rpc/openim_rpc_user/Makefile deleted file mode 100644 index aef2d605a..000000000 --- a/cmd/openim_rpc/openim_rpc_user/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -.PHONY: all build run gotool install clean help - -NAME=openim_user -BIN_DIR=../../../bin/ - -OS:= $(or $(os),linux) -ARCH:=$(or $(arch),amd64) -all: gotool build - -ifeq ($(OS),windows) - -BINARY_NAME=${NAME}.exe - -else - -BINARY_NAME=${NAME} - -endif - -build: - CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME} - -run: - @go run ./ - -gotool: - go fmt ./ - go vet ./ - -install:build - mv ${BINARY_NAME} ${BIN_DIR} - -clean: - @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi diff --git a/cmd/openim_rpc/openim_rpc_user/deploy.Dockerfile b/cmd/openim_rpc/openim_rpc_user/deploy.Dockerfile deleted file mode 100644 index 0977dd634..000000000 --- a/cmd/openim_rpc/openim_rpc_user/deploy.Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM ubuntu - -WORKDIR /Open-IM-Server/bin - -RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\ -&&apt-get install net-tools -#Non-interactive operation -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get install -y vim curl tzdata gawk -#Time zone adjusted to East eighth District -RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata -RUN apt-get -qq update \ - && apt-get -qq install -y --no-install-recommends ca-certificates curl -COPY ./openim_user ./ - -VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"] - -CMD ["./openim_user", "--port", "10110"] diff --git a/cmd/openim_rpc/openim_rpc_user/main.go b/cmd/openim_rpc/openim_rpc_user/main.go deleted file mode 100644 index 6d6d9008d..000000000 --- a/cmd/openim_rpc/openim_rpc_user/main.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright © 2023 OpenIM. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "github.com/OpenIMSDK/Open-IM-Server/internal/rpc/user" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" -) - -func main() { - rpcCmd := cmd.NewRpcCmd("user") - rpcCmd.AddPortFlag() - rpcCmd.AddPrometheusPortFlag() - if err := rpcCmd.Exec(); err != nil { - panic(err.Error()) - } - if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImUserName, user.Start); err != nil { - panic(err.Error()) - } -} diff --git a/docs/contrib/cicd-actions.md b/docs/contrib/cicd-actions.md index 2a95860be..99072f369 100644 --- a/docs/contrib/cicd-actions.md +++ b/docs/contrib/cicd-actions.md @@ -71,7 +71,7 @@ DEBUG Whether or not to generate debug symbols. Default is 0. ❓ BINS Binaries to build. Default is all binaries under cmd. 🛠️ This option is available when using: make {build}(.multiarch) 🧰 -Example: make build BINS="openim_api openim_cms_api". +Example: make build BINS="openim-api openim_cms_api". PLATFORMS Platform to build for. Default is linux_arm64 and linux_amd64. 🌍 This option is available when using: make {build}.multiarch 🌍 diff --git a/scripts/lib/golang.sh b/scripts/lib/golang.sh index 56e34703b..b442e1160 100755 --- a/scripts/lib/golang.sh +++ b/scripts/lib/golang.sh @@ -33,20 +33,20 @@ readonly OPENIM_SUPPORTED_CLIENT_PLATFORMS=( # If you update this list, please also update build/BUILD. openim::golang::server_targets() { local targets=( - openim_api - openim_cmdutils - openim_cmdutils - openim_crontask - openim_msggateway - openim_msgtransfer - openim_push - openim_rpc_auth - openim_rpc_conversation - openim_rpc_friend - openim_rpc_group - openim_rpc_msg - openim_rpc_third - openim_rpc_user + openim-api + openim-cmdutils + openim-cmdutils + openim-crontask + openim-msggateway + openim-msgtransfer + openim-push + openim-rpc-auth + openim-rpc-conversation + openim-rpc-friend + openim-rpc-group + openim-rpc-msg + openim-rpc-third + openim-rpc-user ) echo "${targets[@]}" } diff --git a/scripts/lib/release.sh b/scripts/lib/release.sh index d6cdcdfcb..a198e1ae6 100755 --- a/scripts/lib/release.sh +++ b/scripts/lib/release.sh @@ -407,18 +407,18 @@ function openim::release::package_iam_manifests_tarball() { mkdir -p "${dst_dir}" cp -r ${src_dir}/* "${dst_dir}" #cp "${src_dir}/openim-api.yaml" "${dst_dir}" - #cp "${src_dir}/openim_cmdutils.yaml" "${dst_dir}" - #cp "${src_dir}/openim_crontask.yaml" "${dst_dir}" - #cp "${src_dir}/openim_msggateway.yaml" "${dst_dir}" - #cp "${src_dir}/openim_msgtransfer.yaml" "${dst_dir}" - #cp "${src_dir}/openim_push.yaml" "${dst_dir}" - #cp "${src_dir}/openim_rpc_auth.yaml" "${dst_dir}" - #cp "${src_dir}/openim_rpc_conversation.yaml" "${dst_dir}" - #cp "${src_dir}/openim_rpc_friend.yaml" "${dst_dir}" - #cp "${src_dir}/openim_rpc_group.yaml" "${dst_dir}" - #cp "${src_dir}/openim_rpc_msg.yaml" "${dst_dir}" - #cp "${src_dir}/openim_rpc_third.yaml" "${dst_dir}" - #cp "${src_dir}/openim_rpc_user.yaml" "${dst_dir}" + #cp "${src_dir}/openim-cmdutils.yaml" "${dst_dir}" + #cp "${src_dir}/openim-crontask.yaml" "${dst_dir}" + #cp "${src_dir}/openim-msggateway.yaml" "${dst_dir}" + #cp "${src_dir}/openim-msgtransfer.yaml" "${dst_dir}" + #cp "${src_dir}/openim-push.yaml" "${dst_dir}" + #cp "${src_dir}/openim-rpc-auth.yaml" "${dst_dir}" + #cp "${src_dir}/openim-rpc-conversation.yaml" "${dst_dir}" + #cp "${src_dir}/openim-rpc-friend.yaml" "${dst_dir}" + #cp "${src_dir}/openim-rpc-group.yaml" "${dst_dir}" + #cp "${src_dir}/openim-rpc-msg.yaml" "${dst_dir}" + #cp "${src_dir}/openim-rpc-third.yaml" "${dst_dir}" + #cp "${src_dir}/openim-rpc-user.yaml" "${dst_dir}" #cp "${OPENIM_ROOT}/cluster/gce/gci/health-monitor.sh" "${dst_dir}/health-monitor.sh" openim::release::clean_cruft diff --git a/scripts/lib/util.sh b/scripts/lib/util.sh index 63d32eb79..04eb21de7 100755 --- a/scripts/lib/util.sh +++ b/scripts/lib/util.sh @@ -233,35 +233,35 @@ openim::util::gen-docs() { "${gendocs}" "${dest}/docs/guide/en-US/cmd/imctl/" mkdir -p "${dest}/docs/guide/en-US/cmd/" - "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim_api" - "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim_cmdutils" - "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim_crontask" - "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim_msggateway" - "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim_msgtransfer" - "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim_push" - "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim_rpc_auth" - "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim_rpc_conversation" - "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim_rpc_friend" - "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim_rpc_group" - "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim_rpc_msg" - "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim_rpc_third" - "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim_rpc_user" + "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim-api" + "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim-cmdutils" + "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim-crontask" + "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim-msggateway" + "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim-msgtransfer" + "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim-push" + "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim-rpc-auth" + "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim-rpc-conversation" + "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim-rpc-friend" + "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim-rpc-group" + "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim-rpc-msg" + "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim-rpc-third" + "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/" "openim-rpc-user" "${geniamdocs}" "${dest}/docs/guide/en-US/cmd/imctl" "imctl" mkdir -p "${dest}/docs/man/man1/" -"${genman}" "${dest}/docs/man/man1/" "openim_api" -"${genman}" "${dest}/docs/man/man1/" "openim_cmdutils" -"${genman}" "${dest}/docs/man/man1/" "openim_crontask" -"${genman}" "${dest}/docs/man/man1/" "openim_msggateway" -"${genman}" "${dest}/docs/man/man1/" "openim_msgtransfer" -"${genman}" "${dest}/docs/man/man1/" "openim_push" -"${genman}" "${dest}/docs/man/man1/" "openim_rpc_auth" -"${genman}" "${dest}/docs/man/man1/" "openim_rpc_conversation" -"${genman}" "${dest}/docs/man/man1/" "openim_rpc_friend" -"${genman}" "${dest}/docs/man/man1/" "openim_rpc_group" -"${genman}" "${dest}/docs/man/man1/" "openim_rpc_msg" -"${genman}" "${dest}/docs/man/man1/" "openim_rpc_third" -"${genman}" "${dest}/docs/man/man1/" "openim_rpc_user" +"${genman}" "${dest}/docs/man/man1/" "openim-api" +"${genman}" "${dest}/docs/man/man1/" "openim-cmdutils" +"${genman}" "${dest}/docs/man/man1/" "openim-crontask" +"${genman}" "${dest}/docs/man/man1/" "openim-msggateway" +"${genman}" "${dest}/docs/man/man1/" "openim-msgtransfer" +"${genman}" "${dest}/docs/man/man1/" "openim-push" +"${genman}" "${dest}/docs/man/man1/" "openim-rpc-auth" +"${genman}" "${dest}/docs/man/man1/" "openim-rpc-conversation" +"${genman}" "${dest}/docs/man/man1/" "openim-rpc-friend" +"${genman}" "${dest}/docs/man/man1/" "openim-rpc-group" +"${genman}" "${dest}/docs/man/man1/" "openim-rpc-msg" +"${genman}" "${dest}/docs/man/man1/" "openim-rpc-third" +"${genman}" "${dest}/docs/man/man1/" "openim-rpc-user" mkdir -p "${dest}/docs/guide/en-US/yaml/imctl/" "${genyaml}" "${dest}/docs/guide/en-US/yaml/imct/" diff --git a/scripts/make-rules/common.mk b/scripts/make-rules/common.mk index e99585a76..d471ec112 100644 --- a/scripts/make-rules/common.mk +++ b/scripts/make-rules/common.mk @@ -147,18 +147,18 @@ endef # Here are some examples of builds define MAKEFILE_EXAMPLE -# make build BINS=openim_api Only a single openim_api binary is built. +# make build BINS=openim-api Only a single openim-api binary is built. # make -j (nproc) all Run tidy gen add-copyright format lint cover build concurrently. # make gen Generate all necessary files. # make release Build release binaries for all platforms. # make verify-copyright Verify the license headers for all files. # make install-deepcopy-gen Install deepcopy-gen tools if the license is missing. -# make build BINS=openim_api V=1 DEBUG=1 Build debug binaries for only openim_api. +# make build BINS=openim-api V=1 DEBUG=1 Build debug binaries for only openim-api. # make multiarch -j PLATFORMS="linux_arm64 linux_amd64" V=1 Build binaries for both platforms. endef export MAKEFILE_EXAMPLE -# Define all help functions @printf "\n\033[1mCurrent openim_api version information: $(shell openim_api version):\033[0m\n\n" +# Define all help functions @printf "\n\033[1mCurrent openim-api version information: $(shell openim-api version):\033[0m\n\n" define makeallhelp @printf "\n\033[1mMake example:\033[0m\n\n" $(call MAKEFILE_EXAMPLE) diff --git a/scripts/make-rules/golang.mk b/scripts/make-rules/golang.mk index f0042e043..9602dbbbd 100644 --- a/scripts/make-rules/golang.mk +++ b/scripts/make-rules/golang.mk @@ -71,20 +71,20 @@ EXCLUDE_TESTS=github.com/OpenIMSDK/Open-IM-Server/test github.com/OpenIMSDK/Open # ❯ tree -L 1 cmd # cmd # ├── openim-sdk-core/ - main.go -# ├── openim_api +# ├── openim-api # ├── openim_cms_api # ├── openim_cron_task # ├── openim_demo # ├── openim_msg_gateway # ├── openim_msg_transfer -# ├── openim_push +# ├── openim-push # ├── rpc/openim_admin_cms/ - main.go # └── test/ - main.go # COMMAND=openim # PLATFORM=linux_amd64 # OS=linux # ARCH=amd64 -# BINS=openim_api openim_cms_api openim_cron_task openim_demo openim_msg_gateway openim_msg_transfer openim_push +# BINS=openim-api openim_cms_api openim_cron_task openim_demo openim_msg_gateway openim_msg_transfer openim-push # BIN_DIR=/root/workspaces/OpenIM/_output/bin # ============================================================================== diff --git a/scripts/path_info.cfg b/scripts/path_info.cfg index 530455f36..aa36164ae 100644 --- a/scripts/path_info.cfg +++ b/scripts/path_info.cfg @@ -1,92 +1,96 @@ -#Don't put the space between "=" -msg_gateway_name="openim_msg_gateway" -msg_gateway_binary_root="../bin/" +# Determine the architecture and version +architecture=$(uname -m) +version=$(uname -s | tr '[:upper:]' '[:lower:]') + +# Define the supported architectures and corresponding bin directories +declare -A supported_architectures=( + ["linux-amd64"]="_output/bin/platforms/linux/amd64" + ["linux-arm64"]="_output/bin/platforms/linux/arm64" + ["linux-mips64"]="_output/bin/platforms/linux/mips64" + ["linux-mips64le"]="_output/bin/platforms/linux/mips64le" + ["linux-ppc64le"]="_output/bin/platforms/linux/ppc64le" + ["linux-s390x"]="_output/bin/platforms/linux/s390x" + ["darwin-amd64"]="_output/bin/platforms/darwin/amd64" + ["windows-amd64"]="_output/bin/platforms/windows/amd64" + ["linux-x86_64"]="_output/bin/platforms/linux/amd64" # Alias for linux-amd64 + ["darwin-x86_64"]="_output/bin/platforms/darwin/amd64" # Alias for darwin-amd64 +) + +# Check if the architecture and version are supported +if [[ -z ${supported_architectures["$version-$architecture"]} ]]; then + echo "Unsupported architecture: $architecture or version: $version" + exit 1 +fi + +# Set the BIN_DIR based on the architecture and version +BIN_DIR=${supported_architectures["$version-$architecture"]} + +echo "BIN_DIR: $BIN_DIR" + +# Don't put the space between "=" +msg_gateway_name="openim-msggateway" +msg_gateway_binary_root= $BIN_DIR msg_gateway_source_root="../cmd/msggateway/" msg_name="openim_msg" -msg_binary_root="../bin/" +msg_binary_root=$BIN_DIR msg_source_root="../cmd/rpc/msg/" -push_name="openim_push" -push_binary_root="../bin/" +push_name="openim-push" +push_binary_root=$BIN_DIR push_source_root="../cmd/push/" - - msg_transfer_name="openim_msg_transfer" -msg_transfer_binary_root="../bin/" +msg_transfer_binary_root=$BIN_DIR msg_transfer_source_root="../cmd/msgtransfer/" msg_transfer_service_num=4 - -sdk_server_name="openim_sdk_server" -sdk_server_binary_root="../bin/" -sdk_server_source_root="../cmd/Open-IM-SDK-Core/" - - cron_task_name="openim_cron_task" -cron_task_binary_root="../bin/" +cron_task_binary_root=$BIN_DIR cron_task_source_root="../cmd/crontask/" cmd_utils_name="openim_cmd_utils" -cmd_utils_binary_root="../bin/" +cmd_utils_binary_root=$BIN_DIR cmd_utils_source_root="../cmd/cmduitls/" -#Global configuration file default dir +# Global configuration file default dir config_path="../config/config.yaml" -#servicefile dir path +# servicefile dir path service_source_root=( - #api service file - ../cmd/api/ - #rpc service file - ../cmd/rpc/user/ - ../cmd/rpc/friend/ - ../cmd/rpc/group/ - ../cmd/rpc/auth/ - ../cmd/rpc/conversation/ - ../cmd/rpc/third/ - ../cmd/crontask - ${msg_gateway_source_root} - ${msg_transfer_source_root} - ${msg_source_root} - ${push_source_root} - # ${sdk_server_source_root} -) -#service filename -service_names=( - #api service filename - openim_api - #rpc service filename - openim_user - openim_friend - openim_group - openim_auth - openim_conversation - openim_third - openim_cron_task - ${msg_gateway_name} - ${msg_transfer_name} - ${msg_name} - ${push_name} - # ${sdk_server_name} + # api service file + "../cmd/api/" + # rpc service file + "../cmd/rpc/user/" + "../cmd/rpc/friend/" + "../cmd/rpc/group/" + "../cmd/rpc/auth/" + "../cmd/rpc/conversation/" + "../cmd/rpc/third/" + "../cmd/crontask" + "${msg_gateway_source_root}" + "${msg_transfer_source_root}" + "${msg_source_root}" + "${push_source_root}" + # "${sdk_server_source_root}" ) -image_names=( - #api service file - api - #rpc service file - user - friend - group - auth - conversation - third - cron_task - msg_gateway - msg_transfer - msg - push - # sdk_server -) +# service filename +service_names=( + # api service filename + "openim-api" + # rpc service filename + "openim_user" + "openim_friend" + "openim_group" + "openim_auth" + "openim_conversation" + "openim_third" + "openim_cron_task" + "${msg_gateway_name}" + "${msg_transfer_name}" + "${msg_name}" + "${push_name}" + # "${sdk_server_name}" +) \ No newline at end of file diff --git a/scripts/start_rpc_service.sh b/scripts/start_rpc_service.sh index d0c2f721d..379dba474 100755 --- a/scripts/start_rpc_service.sh +++ b/scripts/start_rpc_service.sh @@ -21,7 +21,7 @@ source ./function.sh #service filename service_filename=( #api - openim_api + openim-api #rpc openim_user openim_friend