mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-01 07:35:58 +08:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dabe7c2813 | |||
| fcf67d40cd | |||
| ca6b46c4ff | |||
| 35d6b7503c | |||
| ce3816cfc4 | |||
| 45a5661d2e | |||
| 383ae8e47e | |||
| baa6c18f93 | |||
| 25671158a4 | |||
| 923023271a | |||
| 0feb950c5a | |||
| 1e2d175c67 | |||
| 28177654c7 | |||
| baae864903 | |||
| ce752f7a00 | |||
| a73d8fe4f6 | |||
| 6713c4df52 | |||
| c9c698551b | |||
| e868073543 | |||
| 5eb97766b6 | |||
| 340ce42b17 | |||
| e9f5752e29 | |||
| c509f7d4d2 | |||
| 692ff29a0c | |||
| de641f574c | |||
| 57374a4df4 |
@@ -1,5 +1,5 @@
|
|||||||
USER=root
|
USER=root
|
||||||
PASSWORD=openIM123
|
PASSWORD=openIM123
|
||||||
MINIO_ENDPOINT=http://113.99.98.99:10005
|
MINIO_ENDPOINT=http://127.0.0.1:10005
|
||||||
API_URL=http://113.99.98.99:10002/object/
|
API_URL=http://127.0.0.1:10002/object/
|
||||||
DATA_DIR=./
|
DATA_DIR=./
|
||||||
+2
-2
@@ -23,7 +23,7 @@ RUN /bin/sh -c "make build"
|
|||||||
FROM alpine
|
FROM alpine
|
||||||
|
|
||||||
RUN echo "https://mirrors.aliyun.com/alpine/v3.4/main" > /etc/apk/repositories && \
|
RUN echo "https://mirrors.aliyun.com/alpine/v3.4/main" > /etc/apk/repositories && \
|
||||||
apk --no-cache add tzdata ca-certificates
|
apk --no-cache add tzdata ca-certificates bash
|
||||||
|
|
||||||
# Set directory to map logs, config files, scripts, and SDK
|
# Set directory to map logs, config files, scripts, and SDK
|
||||||
VOLUME ["/Open-IM-Server/logs", "/Open-IM-Server/config", "/Open-IM-Server/scripts", "/Open-IM-Server/db/sdk"]
|
VOLUME ["/Open-IM-Server/logs", "/Open-IM-Server/config", "/Open-IM-Server/scripts", "/Open-IM-Server/db/sdk"]
|
||||||
@@ -34,4 +34,4 @@ COPY --from=builder /Open-IM-Server/_output/bin/platforms/linux/amd64 /Open-IM-S
|
|||||||
|
|
||||||
WORKDIR /Open-IM-Server/scripts
|
WORKDIR /Open-IM-Server/scripts
|
||||||
|
|
||||||
CMD ["docker_start_all.sh"]
|
CMD ["./docker_start_all.sh"]
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
⭐️ Open source Instant Messaging Server ⭐️ <br>
|
⭐️ Open source Instant Messaging Server ⭐️ <br>
|
||||||
<h3>
|
<h3>
|
||||||
|
|
||||||
|
|
||||||
<p align=center>
|
<p align=center>
|
||||||
<a href="https://goreportcard.com/report/github.com/OpenIMSDK/Open-IM-Server"><img src="https://goreportcard.com/badge/github.com/OpenIMSDK/Open-IM-Server" alt="A+"></a>
|
<a href="https://goreportcard.com/report/github.com/OpenIMSDK/Open-IM-Server"><img src="https://goreportcard.com/badge/github.com/OpenIMSDK/Open-IM-Server" alt="A+"></a>
|
||||||
<a href="https://github.com/OpenIMSDK/Open-IM-Server/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22good+first+issue%22"><img src="https://img.shields.io/github/issues/OpenIMSDK/Open-IM-Server/good%20first%20issue?logo=%22github%22" alt="good first"></a>
|
<a href="https://github.com/OpenIMSDK/Open-IM-Server/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22good+first+issue%22"><img src="https://img.shields.io/github/issues/OpenIMSDK/Open-IM-Server/good%20first%20issue?logo=%22github%22" alt="good first"></a>
|
||||||
|
|||||||
+2
-2
@@ -100,7 +100,7 @@ services:
|
|||||||
|
|
||||||
|
|
||||||
openim_server:
|
openim_server:
|
||||||
image: ghcr.io/openimsdk/openim-server:v3.0
|
image: ghcr.io/openimsdk/openim-server:release-v3.1
|
||||||
container_name: openim-server
|
container_name: openim-server
|
||||||
volumes:
|
volumes:
|
||||||
- ./logs:/Open-IM-Server/logs
|
- ./logs:/Open-IM-Server/logs
|
||||||
@@ -124,7 +124,7 @@ services:
|
|||||||
max-file: "2"
|
max-file: "2"
|
||||||
|
|
||||||
openim_chat:
|
openim_chat:
|
||||||
image: ghcr.io/openimsdk/openim-chat:v1.0.0
|
image: ghcr.io/openimsdk/openim-chat:v1.1.1
|
||||||
container_name: openim_chat
|
container_name: openim_chat
|
||||||
restart: always
|
restart: always
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|||||||
@@ -39,7 +39,13 @@ type Req struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *Req) String() string {
|
func (r *Req) String() string {
|
||||||
return utils.StructToJsonString(r)
|
var tReq Req
|
||||||
|
tReq.ReqIdentifier = r.ReqIdentifier
|
||||||
|
tReq.Token = r.Token
|
||||||
|
tReq.SendID = r.SendID
|
||||||
|
tReq.OperationID = r.OperationID
|
||||||
|
tReq.MsgIncr = r.MsgIncr
|
||||||
|
return utils.StructToJsonString(tReq)
|
||||||
}
|
}
|
||||||
|
|
||||||
type Resp struct {
|
type Resp struct {
|
||||||
@@ -52,6 +58,12 @@ type Resp struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *Resp) String() string {
|
func (r *Resp) String() string {
|
||||||
|
var tResp Resp
|
||||||
|
tResp.ReqIdentifier = r.ReqIdentifier
|
||||||
|
tResp.MsgIncr = r.MsgIncr
|
||||||
|
tResp.OperationID = r.OperationID
|
||||||
|
tResp.ErrCode = r.ErrCode
|
||||||
|
tResp.ErrMsg = r.ErrMsg
|
||||||
return utils.StructToJsonString(r)
|
return utils.StructToJsonString(r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1040,7 +1040,7 @@ func (s *groupServer) GetUserReqApplicationList(ctx context.Context, req *pbGrou
|
|||||||
groupIDs := utils.Distinct(utils.Slice(requests, func(e *relationTb.GroupRequestModel) string {
|
groupIDs := utils.Distinct(utils.Slice(requests, func(e *relationTb.GroupRequestModel) string {
|
||||||
return e.GroupID
|
return e.GroupID
|
||||||
}))
|
}))
|
||||||
groups, err := s.GroupDatabase.FindGroup(ctx, groupIDs)
|
groups, err := s.GroupDatabase.FindNotDismissedGroup(ctx, groupIDs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ type GroupDatabase interface {
|
|||||||
CreateGroup(ctx context.Context, groups []*relationTb.GroupModel, groupMembers []*relationTb.GroupMemberModel) error
|
CreateGroup(ctx context.Context, groups []*relationTb.GroupModel, groupMembers []*relationTb.GroupMemberModel) error
|
||||||
TakeGroup(ctx context.Context, groupID string) (group *relationTb.GroupModel, err error)
|
TakeGroup(ctx context.Context, groupID string) (group *relationTb.GroupModel, err error)
|
||||||
FindGroup(ctx context.Context, groupIDs []string) (groups []*relationTb.GroupModel, err error)
|
FindGroup(ctx context.Context, groupIDs []string) (groups []*relationTb.GroupModel, err error)
|
||||||
|
FindNotDismissedGroup(ctx context.Context, groupIDs []string) (groups []*relationTb.GroupModel, err error)
|
||||||
SearchGroup(
|
SearchGroup(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
keyword string,
|
keyword string,
|
||||||
@@ -581,3 +582,7 @@ func (g *groupDatabase) CountRangeEverydayTotal(ctx context.Context, start time.
|
|||||||
func (g *groupDatabase) FindGroupRequests(ctx context.Context, groupID string, userIDs []string) (int64, []*relationTb.GroupRequestModel, error) {
|
func (g *groupDatabase) FindGroupRequests(ctx context.Context, groupID string, userIDs []string) (int64, []*relationTb.GroupRequestModel, error) {
|
||||||
return g.groupRequestDB.FindGroupRequests(ctx, groupID, userIDs)
|
return g.groupRequestDB.FindGroupRequests(ctx, groupID, userIDs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (g *groupDatabase) FindNotDismissedGroup(ctx context.Context, groupIDs []string) (groups []*relationTb.GroupModel, err error) {
|
||||||
|
return g.groupDB.FindNotDismissedGroup(ctx, groupIDs)
|
||||||
|
}
|
||||||
|
|||||||
@@ -99,3 +99,7 @@ func (g *GroupGorm) CountRangeEverydayTotal(ctx context.Context, start time.Time
|
|||||||
}
|
}
|
||||||
return v, nil
|
return v, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (g *GroupGorm) FindNotDismissedGroup(ctx context.Context, groupIDs []string) (groups []*relation.GroupModel, err error) {
|
||||||
|
return groups, utils.Wrap(g.DB.Where("group_id in (?) and status != ?", groupIDs, constant.GroupStatusDismissed).Find(&groups).Error, "")
|
||||||
|
}
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ type GroupModelInterface interface {
|
|||||||
UpdateMap(ctx context.Context, groupID string, args map[string]interface{}) (err error)
|
UpdateMap(ctx context.Context, groupID string, args map[string]interface{}) (err error)
|
||||||
UpdateStatus(ctx context.Context, groupID string, status int32) (err error)
|
UpdateStatus(ctx context.Context, groupID string, status int32) (err error)
|
||||||
Find(ctx context.Context, groupIDs []string) (groups []*GroupModel, err error)
|
Find(ctx context.Context, groupIDs []string) (groups []*GroupModel, err error)
|
||||||
|
FindNotDismissedGroup(ctx context.Context, groupIDs []string) (groups []*GroupModel, err error)
|
||||||
Take(ctx context.Context, groupID string) (group *GroupModel, err error)
|
Take(ctx context.Context, groupID string) (group *GroupModel, err error)
|
||||||
Search(
|
Search(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
|
|||||||
@@ -37,12 +37,24 @@ function onCtrlC () {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Load environment variables from .env file
|
||||||
|
source ${OPENIM_ROOT}/.env
|
||||||
|
|
||||||
# Get the public internet IP address
|
# Get the public internet IP address
|
||||||
internet_ip=$(curl ifconfig.me -s)
|
internet_ip=$(curl ifconfig.me -s)
|
||||||
echo -e "${PURPLE_PREFIX}=========> Your public internet IP address is ${internet_ip} ${COLOR_SUFFIX} \n"
|
echo -e "${PURPLE_PREFIX}=========> Your public internet IP address is ${internet_ip} ${COLOR_SUFFIX} \n"
|
||||||
|
|
||||||
# Load environment variables from .env file
|
# Replace local IP address with the public IP address in .env file
|
||||||
source ${OPENIM_ROOT}/.env
|
if [ $API_URL == "http://127.0.0.1:10002/object/" ]; then
|
||||||
|
sed -i "s/127.0.0.1/${internet_ip}/" ${OPENIM_ROOT}/.env
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $MINIO_ENDPOINT == "http://127.0.0.1:10005" ]; then
|
||||||
|
sed -i "s/127.0.0.1/${internet_ip}/" ${OPENIM_ROOT}/.env
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo -e "${PURPLE_PREFIX}=========> Your minio endpoint is ${MINIO_ENDPOINT} ${COLOR_SUFFIX} \n"
|
echo -e "${PURPLE_PREFIX}=========> Your minio endpoint is ${MINIO_ENDPOINT} ${COLOR_SUFFIX} \n"
|
||||||
|
|
||||||
@@ -59,15 +71,6 @@ echo -e "${PURPLE_PREFIX}=========> env_check.sh ${COLOR_SUFFIX} \n"
|
|||||||
|
|
||||||
${SCRIPTS_ROOT}/env_check.sh
|
${SCRIPTS_ROOT}/env_check.sh
|
||||||
|
|
||||||
# Replace local IP address with the public IP address in .env file
|
|
||||||
if [ $API_URL == "http://127.0.0.1:10002/object/" ]; then
|
|
||||||
sed -i "s/127.0.0.1/${internet_ip}/" ${OPENIM_ROOT}/.env
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $MINIO_ENDPOINT == "http://127.0.0.1:10005" ]; then
|
|
||||||
sed -i "s/127.0.0.1/${internet_ip}/" ${OPENIM_ROOT}/.env
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Go back to the previous directory
|
# Go back to the previous directory
|
||||||
cd ${OPENIM_ROOT}
|
cd ${OPENIM_ROOT}
|
||||||
|
|
||||||
@@ -79,4 +82,4 @@ else
|
|||||||
docker compose up -d
|
docker compose up -d
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${SCRIPTS_ROOT}/docker_check_service.sh
|
${SCRIPTS_ROOT}/docker_check_service.sh
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
GO := go
|
GO := go
|
||||||
GO_SUPPORTED_VERSIONS ?= 1.18|1.19|1.20
|
GO_SUPPORTED_VERSIONS ?= 1.18|1.19|1.20|1.21
|
||||||
|
|
||||||
GO_LDFLAGS += -X $(VERSION_PACKAGE).gitVersion=$(GIT_TAG) \
|
GO_LDFLAGS += -X $(VERSION_PACKAGE).gitVersion=$(GIT_TAG) \
|
||||||
-X $(VERSION_PACKAGE).gitCommit=$(GIT_COMMIT) \
|
-X $(VERSION_PACKAGE).gitCommit=$(GIT_COMMIT) \
|
||||||
@@ -204,4 +204,4 @@ go.clean:
|
|||||||
## copyright.help: Show copyright help
|
## copyright.help: Show copyright help
|
||||||
.PHONY: go.help
|
.PHONY: go.help
|
||||||
go.help: scripts/make-rules/golang.mk
|
go.help: scripts/make-rules/golang.mk
|
||||||
$(call smallhelp)
|
$(call smallhelp)
|
||||||
|
|||||||
Reference in New Issue
Block a user