Merge branch 'main' into fix/fix-scripts-path

pull/525/head
Xinwei Xiong 2 years ago committed by GitHub
commit 92b92d00a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,5 @@
USER=root
PASSWORD=openIM123
MINIO_ENDPOINT=http://127.0.0.1:10005
API_URL=http://127.0.0.1:10002/object/
DATA_DIR=./

@ -66,6 +66,7 @@ jobs:
run: |
make format
echo "Run go format successfully"
continue-on-error: true
# - name: Generate all necessary files, such as error code files
# run: |
@ -149,4 +150,4 @@ jobs:
# uses: goreleaser/goreleaser-action@v4
# with:
# version: latest
# args: release --clean --skip-publish --snapshot
# args: release --clean --skip-publish --snapshot

@ -9,6 +9,10 @@ source .env
echo $MINIO_ENDPOINT
# 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
sed -i "s/127.0.0.1/${internet_ip}/" .env
fi

@ -18,19 +18,20 @@ const (
///ContentType
//UserRelated
Text = 101
Picture = 102
Voice = 103
Video = 104
File = 105
AtText = 106
Merger = 107
Card = 108
Location = 109
Custom = 110
Revoke = 111
Typing = 113
Quote = 114
ContentTypeBegin = 100
Text = 101
Picture = 102
Voice = 103
Video = 104
File = 105
AtText = 106
Merger = 107
Card = 108
Location = 109
Custom = 110
Revoke = 111
Typing = 113
Quote = 114
AdvancedText = 117

@ -26,10 +26,10 @@ func (x *MsgData) Check() error {
if x.Content == nil {
return errs.ErrArgs.Wrap("content is empty")
}
if x.ContentType < 101 || x.ContentType > 203 {
return errs.ErrArgs.Wrap("content is empty")
if x.ContentType <= constant.ContentTypeBegin || x.ContentType >= constant.NotificationEnd {
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")
}
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/secretAccessKey:.*/secretAccessKey: $PASSWORD/" $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
sed -i "s/secret: .*/secret: $PASSWORD/" $config_file

@ -24,6 +24,9 @@ source $SCRIPTS_ROOT/function.sh
cd $SCRIPTS_ROOT
chmod +x build_all_service.sh
./build_all_service.sh
echo -e "${YELLOW_PREFIX}=======>SCRIPTS_ROOT=$SCRIPTS_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>OPENIM_ROOT=$OPENIM_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>pwd=$PWD${COLOR_SUFFIX}"

Loading…
Cancel
Save