add sdk svr to docker script

This commit is contained in:
Gordon 2021-10-08 17:50:09 +08:00
parent a1e9332606
commit c48245fc9b
10 changed files with 21 additions and 17 deletions

View File

@ -60,7 +60,7 @@ serverip:
api: api:
openImApiPort: [ 10000 ] openImApiPort: [ 10000 ]
sdk: sdk:
sdkWsPort: [ 30000 ] openImSdkWsPort: [ 30000 ]
credential: credential:
tencent: tencent:
@ -105,7 +105,7 @@ modulename:
pushName: push pushName: push
longconnsvr: longconnsvr:
websocketPort: [ 17778 ] openImWsPort: [ 17778 ]
websocketMaxConnNum: 10000 websocketMaxConnNum: 10000
websocketMaxMsgLen: 4096 websocketMaxMsgLen: 4096
websocketTimeOut: 10 websocketTimeOut: 10

View File

@ -4,9 +4,7 @@ source ./style_info.cfg
source ./path_info.cfg source ./path_info.cfg
source ./function.sh source ./function.sh
service_port_name=( service_port_name=(
#api port name
openImApiPort openImApiPort
#rpc port name
openImUserPort openImUserPort
openImFriendPort openImFriendPort
openImOfflineMessagePort openImOfflineMessagePort
@ -14,8 +12,8 @@ service_port_name=(
openImGroupPort openImGroupPort
openImAuthPort openImAuthPort
openImPushPort openImPushPort
websocketPort openImWsPort
sdkWsPort openImSdkWsPort
) )
for i in ${service_port_name[*]};do for i in ${service_port_name[*]};do
list=$(cat $config_path | grep -w ${i} | awk -F '[:]' '{print $NF}') list=$(cat $config_path | grep -w ${i} | awk -F '[:]' '{print $NF}')

View File

@ -8,6 +8,7 @@ need_to_start_server_shell=(
msg_gateway_start.sh msg_gateway_start.sh
push_start.sh push_start.sh
msg_transfer_start.sh msg_transfer_start.sh
sdk_svr_start.sh
) )
#fixme The 10 second delay to start the project is for the docker-compose one-click to start openIM when the infrastructure dependencies are not started #fixme The 10 second delay to start the project is for the docker-compose one-click to start openIM when the infrastructure dependencies are not started

View File

@ -4,7 +4,7 @@ source ./style_info.cfg
source ./path_info.cfg source ./path_info.cfg
source ./function.sh source ./function.sh
list1=$(cat $config_path | grep openImOnlineRelayPort | awk -F '[:]' '{print $NF}') list1=$(cat $config_path | grep openImOnlineRelayPort | awk -F '[:]' '{print $NF}')
list2=$(cat $config_path | grep websocketPort | awk -F '[:]' '{print $NF}') list2=$(cat $config_path | grep openImWsPort | awk -F '[:]' '{print $NF}')
list_to_string $list1 list_to_string $list1
rpc_ports=($ports_array) rpc_ports=($ports_array)
list_to_string $list2 list_to_string $list2
@ -39,7 +39,7 @@ if [ $check -ge 1 ]; then
ports=$(netstat -netulp | grep -w ${i} | awk '{print $4}' | awk -F '[:]' '{print $NF}') ports=$(netstat -netulp | grep -w ${i} | awk '{print $4}' | awk -F '[:]' '{print $NF}')
allPorts=${allPorts}"$ports " allPorts=${allPorts}"$ports "
done done
echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS !!!"${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS"${COLOR_SUFFIX}
echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${msg_gateway_name}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${msg_gateway_name}${COLOR_SUFFIX}
echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allNewPid}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allNewPid}${COLOR_SUFFIX}
echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX}

View File

@ -29,7 +29,7 @@ for i in $ports ;
do do
allPorts=${allPorts}"$i " allPorts=${allPorts}"$i "
done done
echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS !!!"${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS "${COLOR_SUFFIX}
echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${msg_transfer_name}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${msg_transfer_name}${COLOR_SUFFIX}
echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${newPid}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${newPid}${COLOR_SUFFIX}
echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX}

View File

@ -36,7 +36,7 @@ if [ $check -eq 1 ]; then
for i in $ports; do for i in $ports; do
allPorts=${allPorts}"$i " allPorts=${allPorts}"$i "
done done
echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS !!!"${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS "${COLOR_SUFFIX}
echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${push_name}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${push_name}${COLOR_SUFFIX}
echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${newPid}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${newPid}${COLOR_SUFFIX}
echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX}

View File

@ -4,8 +4,8 @@ source ./style_info.cfg
source ./path_info.cfg source ./path_info.cfg
source ./function.sh source ./function.sh
list1=$(cat $config_path | grep openImApiPort | awk -F '[:]' '{print $NF}') list1=$(cat $config_path | grep openImApiPort | awk -F '[:]' '{print $NF}')
list2=$(cat $config_path | grep websocketPort | awk -F '[:]' '{print $NF}') list2=$(cat $config_path | grep openImWsPort | awk -F '[:]' '{print $NF}')
list3=$(cat $config_path | grep sdkWsPort | awk -F '[:]' '{print $NF}') list3=$(cat $config_path | grep openImSdkWsPort | awk -F '[:]' '{print $NF}')
list_to_string $list1 list_to_string $list1
api_ports=($ports_array) api_ports=($ports_array)
list_to_string $list2 list_to_string $list2

View File

@ -14,7 +14,7 @@ type config struct {
GinPort []int `yaml:"openImApiPort"` GinPort []int `yaml:"openImApiPort"`
} }
Sdk struct { Sdk struct {
WsPort []int `yaml:"sdkWsPort"` WsPort []int `yaml:"openImSdkWsPort"`
} }
Credential struct { Credential struct {
Tencent struct { Tencent struct {
@ -92,7 +92,7 @@ type config struct {
PushName string `yaml:"pushName"` PushName string `yaml:"pushName"`
} }
LongConnSvr struct { LongConnSvr struct {
WebsocketPort []int `yaml:"websocketPort"` WebsocketPort []int `yaml:"openImWsPort"`
WebsocketMaxConnNum int `yaml:"websocketMaxConnNum"` WebsocketMaxConnNum int `yaml:"websocketMaxConnNum"`
WebsocketMaxMsgLen int `yaml:"websocketMaxMsgLen"` WebsocketMaxMsgLen int `yaml:"websocketMaxMsgLen"`
WebsocketTimeOut int `yaml:"websocketTimeOut"` WebsocketTimeOut int `yaml:"websocketTimeOut"`

View File

@ -110,6 +110,10 @@ func (s *friendServer) ImportFriend(ctx context.Context, req *pbFriend.ImportFri
SessionType: constant.SingleChatType, SessionType: constant.SingleChatType,
OperationID: req.OperationID, OperationID: req.OperationID,
}) })
} else {
resp.CommonResp.ErrorMsg = "some uid establish failed"
resp.CommonResp.ErrorCode = 408
resp.FailedUidList = append(resp.FailedUidList, v)
} }
} }
} }

View File

@ -81,7 +81,7 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
log.Error(claims.UID, req.OperationID, "FindUserByUID failed, err: ", err.Error()) log.Error(claims.UID, req.OperationID, "FindUserByUID failed, err: ", err.Error())
return &pbGroup.InviteUserToGroupResp{ErrorCode: config.ErrParam.ErrCode, ErrorMsg: config.ErrParam.ErrMsg}, nil return &pbGroup.InviteUserToGroupResp{ErrorCode: config.ErrParam.ErrCode, ErrorMsg: config.ErrParam.ErrMsg}, nil
}*/ }*/
var nicknameList string
for _, v := range req.UidList { for _, v := range req.UidList {
var resultNode pbGroup.Id2Result var resultNode pbGroup.Id2Result
resultNode.UId = v resultNode.UId = v
@ -113,7 +113,7 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
if err != nil { if err != nil {
log.Error("", "", "add mongo group member failed, db.DB.AddGroupMember fail [err: %s]", err.Error()) log.Error("", "", "add mongo group member failed, db.DB.AddGroupMember fail [err: %s]", err.Error())
} }
nicknameList = nicknameList + toUserInfo.Name + " "
resp.Id2Result = append(resp.Id2Result, &resultNode) resp.Id2Result = append(resp.Id2Result, &resultNode)
} }
resp.ErrorCode = 0 resp.ErrorCode = 0
@ -121,12 +121,13 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
//if claims.UID == config.Config.AppManagerUid //if claims.UID == config.Config.AppManagerUid
if utils.IsContain(claims.UID, config.Config.Manager.AppManagerUid) { if utils.IsContain(claims.UID, config.Config.Manager.AppManagerUid) {
m, _ := imdb.FindUserByUID(claims.UID)
var iu inviteUserToGroupReq var iu inviteUserToGroupReq
iu.GroupID = req.GroupID iu.GroupID = req.GroupID
iu.OperationID = req.OperationID iu.OperationID = req.OperationID
iu.Reason = req.Reason iu.Reason = req.Reason
iu.UidList = req.UidList iu.UidList = req.UidList
n := content_struct.NotificationContent{1, req.GroupID, iu.ContentToString()} n := content_struct.NotificationContent{1, nicknameList + " invited into the group chat by " + m.Name, iu.ContentToString()}
logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{
SendID: claims.UID, SendID: claims.UID,
RecvID: req.GroupID, RecvID: req.GroupID,