mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Merge branch 'OpenIMSDK:main' into main
This commit is contained in:
commit
59f948bde2
1
.env
1
.env
@ -1,4 +1,5 @@
|
|||||||
USER=root
|
USER=root
|
||||||
PASSWORD=openIM123
|
PASSWORD=openIM123
|
||||||
MINIO_ENDPOINT=http://127.0.0.1:10005
|
MINIO_ENDPOINT=http://127.0.0.1:10005
|
||||||
|
API_URL=http://127.0.0.1:10002/object/
|
||||||
DATA_DIR=./
|
DATA_DIR=./
|
||||||
|
@ -9,6 +9,10 @@ source .env
|
|||||||
echo $MINIO_ENDPOINT
|
echo $MINIO_ENDPOINT
|
||||||
|
|
||||||
# Replace local IP address with the public IP address in .env file
|
# 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}/" .env
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $MINIO_ENDPOINT == "http://127.0.0.1:10005" ]; then
|
if [ $MINIO_ENDPOINT == "http://127.0.0.1:10005" ]; then
|
||||||
sed -i "s/127.0.0.1/${internet_ip}/" .env
|
sed -i "s/127.0.0.1/${internet_ip}/" .env
|
||||||
fi
|
fi
|
||||||
|
@ -18,19 +18,20 @@ const (
|
|||||||
|
|
||||||
///ContentType
|
///ContentType
|
||||||
//UserRelated
|
//UserRelated
|
||||||
Text = 101
|
ContentTypeBegin = 100
|
||||||
Picture = 102
|
Text = 101
|
||||||
Voice = 103
|
Picture = 102
|
||||||
Video = 104
|
Voice = 103
|
||||||
File = 105
|
Video = 104
|
||||||
AtText = 106
|
File = 105
|
||||||
Merger = 107
|
AtText = 106
|
||||||
Card = 108
|
Merger = 107
|
||||||
Location = 109
|
Card = 108
|
||||||
Custom = 110
|
Location = 109
|
||||||
Revoke = 111
|
Custom = 110
|
||||||
Typing = 113
|
Revoke = 111
|
||||||
Quote = 114
|
Typing = 113
|
||||||
|
Quote = 114
|
||||||
|
|
||||||
AdvancedText = 117
|
AdvancedText = 117
|
||||||
|
|
||||||
|
@ -26,10 +26,10 @@ func (x *MsgData) Check() error {
|
|||||||
if x.Content == nil {
|
if x.Content == nil {
|
||||||
return errs.ErrArgs.Wrap("content is empty")
|
return errs.ErrArgs.Wrap("content is empty")
|
||||||
}
|
}
|
||||||
if x.ContentType < 101 || x.ContentType > 203 {
|
if x.ContentType <= constant.ContentTypeBegin || x.ContentType >= constant.NotificationEnd {
|
||||||
return errs.ErrArgs.Wrap("content is empty")
|
return errs.ErrArgs.Wrap("content type is invalid")
|
||||||
}
|
}
|
||||||
if x.SessionType < 1 || x.SessionType > 4 {
|
if x.SessionType < constant.SingleChatType || x.SessionType > constant.NotificationChatType {
|
||||||
return errs.ErrArgs.Wrap("sessionType is invalid")
|
return errs.ErrArgs.Wrap("sessionType is invalid")
|
||||||
}
|
}
|
||||||
if x.SessionType == constant.SingleChatType || x.SessionType == constant.NotificationChatType {
|
if x.SessionType == constant.SingleChatType || x.SessionType == constant.NotificationChatType {
|
||||||
|
@ -51,6 +51,8 @@ sed -i '/redis:/,/password:/s/password: .*/password: '${PASSWORD}'/' $config_fil
|
|||||||
sed -i "/minio:/,/isDistributedMod:/ s/accessKeyID:.*/accessKeyID: $USER/" $config_file
|
sed -i "/minio:/,/isDistributedMod:/ s/accessKeyID:.*/accessKeyID: $USER/" $config_file
|
||||||
sed -i "/minio:/,/isDistributedMod:/ s/secretAccessKey:.*/secretAccessKey: $PASSWORD/" $config_file
|
sed -i "/minio:/,/isDistributedMod:/ s/secretAccessKey:.*/secretAccessKey: $PASSWORD/" $config_file
|
||||||
sed -i '/minio:/,/endpoint:/s|endpoint: .*|endpoint: '${MINIO_ENDPOINT}'|' $config_file
|
sed -i '/minio:/,/endpoint:/s|endpoint: .*|endpoint: '${MINIO_ENDPOINT}'|' $config_file
|
||||||
|
sed -i '/object:/,/apiURL:/s|apiURL: .*|apiURL: '${API_URL}'|' $config_file
|
||||||
|
|
||||||
|
|
||||||
# Replace secret for token
|
# Replace secret for token
|
||||||
sed -i "s/secret: .*/secret: $PASSWORD/" $config_file
|
sed -i "s/secret: .*/secret: $PASSWORD/" $config_file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user