commit
20dfafd218
@ -0,0 +1,13 @@
|
||||
|
||||
MONGO_IMAGE=mongo:6.0.2
|
||||
REDIS_IMAGE=redis:7.0.0
|
||||
ZOOKEEPER_IMAGE=bitnami/zookeeper:3.8
|
||||
KAFKA_IMAGE=bitnami/kafka:3.5.1
|
||||
MINIO_IMAGE=minio/minio:RELEASE.2024-01-11T07-46-16Z
|
||||
|
||||
|
||||
OPENIM_WEB_FRONT_IMAGE=ghcr.io/openimsdk/openim-web:v3.5.0-docker
|
||||
OPENIM_ADMIN_FRONT_IMAGE=ghcr.io/openimsdk/openim-admin:toc-base-open-docker.35
|
||||
|
||||
DATA_DIR=./
|
||||
|
@ -0,0 +1 @@
|
||||
*.sh text eol=lf
|
@ -0,0 +1,50 @@
|
||||
# https://github.com/marketplace/actions/conformity-checker-for-project
|
||||
baseConfig:
|
||||
searchDirectory: "./"
|
||||
ignoreCase: false
|
||||
|
||||
directoryNaming:
|
||||
allowHyphens: true
|
||||
allowUnderscores: false
|
||||
mustBeLowercase: true
|
||||
|
||||
fileNaming:
|
||||
allowHyphens: true
|
||||
allowUnderscores: true
|
||||
mustBeLowercase: true
|
||||
|
||||
ignoreFormats:
|
||||
- "\\.log$"
|
||||
- "\\.env$"
|
||||
- "README\\.md$"
|
||||
- "_test\\.go$"
|
||||
- "\\.md$"
|
||||
- _test\\.txt$
|
||||
- LICENSE
|
||||
- Dockerfile
|
||||
- CODEOWNERS
|
||||
- Makefile
|
||||
|
||||
ignoreDirectories:
|
||||
- "vendor"
|
||||
- ".git"
|
||||
- "deployments"
|
||||
- "node_modules"
|
||||
- "logs"
|
||||
- "CHANGELOG"
|
||||
- "components"
|
||||
- "_output"
|
||||
- "tools/openim-web"
|
||||
- "CHANGELOG"
|
||||
- "examples/Test_directory"
|
||||
- test/testdata
|
||||
|
||||
fileTypeSpecificNaming:
|
||||
".yaml":
|
||||
allowHyphens: true
|
||||
allowUnderscores: false
|
||||
mustBeLowercase: true
|
||||
".go":
|
||||
allowHyphens: false
|
||||
allowUnderscores: true
|
||||
mustBeLowercase: true
|
@ -1,31 +1,49 @@
|
||||
# Build Stage
|
||||
FROM golang:1.20 AS builder
|
||||
# Use Go 1.21 Alpine as the base image for building the application
|
||||
FROM golang:1.21-alpine as builder
|
||||
|
||||
# Set go mod installation source and proxy
|
||||
ARG GO111MODULE=on
|
||||
ARG GOPROXY=https://goproxy.io,direct
|
||||
# Define the base directory for the application as an environment variable
|
||||
ENV SERVER_DIR=/openim-server
|
||||
|
||||
ENV GO111MODULE=$GO111MODULE
|
||||
ENV GOPROXY=$GOPROXY
|
||||
# Set the working directory inside the container based on the environment variable
|
||||
WORKDIR $SERVER_DIR
|
||||
|
||||
# Set up the working directory
|
||||
WORKDIR /openim/openim-server
|
||||
# Set the Go proxy to improve dependency resolution speed
|
||||
ENV GOPROXY=https://goproxy.io,direct
|
||||
|
||||
# Copy all files from the current directory into the container
|
||||
COPY . .
|
||||
|
||||
# Copy all files to the container
|
||||
ADD . .
|
||||
RUN go mod download
|
||||
|
||||
RUN make clean
|
||||
RUN make build
|
||||
# Install Mage to use for building the application
|
||||
RUN go install github.com/magefile/mage@v1.15.0
|
||||
|
||||
FROM ghcr.io/openim-sigs/openim-ubuntu-image:latest
|
||||
# Optionally build your application if needed
|
||||
RUN mage build
|
||||
|
||||
WORKDIR ${SERVER_WORKDIR}
|
||||
# Using Alpine Linux with Go environment for the final image
|
||||
FROM golang:1.21-alpine
|
||||
|
||||
# Copy scripts and binary files to the production image
|
||||
COPY --from=builder ${OPENIM_SERVER_BINDIR} /openim/openim-server/_output/bin
|
||||
COPY --from=builder ${OPENIM_SERVER_CMDDIR} /openim/openim-server/scripts
|
||||
COPY --from=builder ${SERVER_WORKDIR}/config /openim/openim-server/config
|
||||
COPY --from=builder ${SERVER_WORKDIR}/deployments /openim/openim-server/deployments
|
||||
# Install necessary packages, such as bash
|
||||
RUN apk add --no-cache bash
|
||||
|
||||
CMD ["/openim/openim-server/scripts/docker-start-all.sh"]
|
||||
# Set the environment and work directory
|
||||
ENV SERVER_DIR=/openim-server
|
||||
WORKDIR $SERVER_DIR
|
||||
|
||||
|
||||
# Copy the compiled binaries and mage from the builder image to the final image
|
||||
COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output
|
||||
COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config
|
||||
COPY --from=builder /go/bin/mage /usr/local/bin/mage
|
||||
COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/
|
||||
COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/
|
||||
COPY --from=builder $SERVER_DIR/magefile.go $SERVER_DIR/
|
||||
COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/
|
||||
COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/
|
||||
COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/
|
||||
|
||||
RUN go get github.com/openimsdk/gomake@v0.0.9
|
||||
|
||||
# Set the command to run when the container starts
|
||||
ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"]
|
||||
|
@ -1,255 +0,0 @@
|
||||
# ==============================================================================
|
||||
# define the default goal
|
||||
#
|
||||
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
## all: Run tidy, gen, add-copyright, format, lint, cover, build ✨
|
||||
.PHONY: all
|
||||
all: tidy gen add-copyright verify test-api lint cover restart
|
||||
|
||||
# ==============================================================================
|
||||
# Build set
|
||||
|
||||
ROOT_PACKAGE=github.com/openimsdk/open-im-server
|
||||
# TODO: This is version control for the future https://github.com/openimsdk/open-im-server/issues/574
|
||||
VERSION_PACKAGE=github.com/openimsdk/open-im-server/v3/pkg/version
|
||||
|
||||
# ==============================================================================
|
||||
# Includes
|
||||
|
||||
include scripts/make-rules/common.mk # make sure include common.mk at the first include line
|
||||
include scripts/make-rules/golang.mk
|
||||
include scripts/make-rules/image.mk
|
||||
include scripts/make-rules/copyright.mk
|
||||
include scripts/make-rules/gen.mk
|
||||
include scripts/make-rules/dependencies.mk
|
||||
include scripts/make-rules/tools.mk
|
||||
include scripts/make-rules/release.mk
|
||||
include scripts/make-rules/swagger.mk
|
||||
|
||||
# ==============================================================================
|
||||
# Usage
|
||||
|
||||
define USAGE_OPTIONS
|
||||
|
||||
Options:
|
||||
|
||||
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-cmdutils".
|
||||
|
||||
PLATFORMS Platform to build for. Default is linux_arm64 and linux_amd64.
|
||||
This option is available when using: make {build}.multiarch
|
||||
Example: make multiarch PLATFORMS="linux_s390x linux_mips64
|
||||
linux_mips64le darwin_amd64 windows_amd64 linux_amd64 linux_arm64".
|
||||
|
||||
V Set to 1 enable verbose build. Default is 0.
|
||||
endef
|
||||
export USAGE_OPTIONS
|
||||
|
||||
# ==============================================================================
|
||||
# Targets
|
||||
|
||||
## init: Initialize openim server project ✨
|
||||
.PHONY: init
|
||||
init:
|
||||
@$(MAKE) gen.init
|
||||
|
||||
## init-githooks: Initialize git hooks ✨
|
||||
.PHONY: init-githooks
|
||||
init-githooks:
|
||||
@$(MAKE) gen.init-githooks
|
||||
|
||||
## gen: Generate all necessary files. ✨
|
||||
.PHONY: gen
|
||||
gen:
|
||||
@$(MAKE) gen.run
|
||||
|
||||
## demo: Run demo get started with Makefiles quickly ✨
|
||||
.PHONY: demo
|
||||
demo:
|
||||
@$(MAKE) go.demo
|
||||
|
||||
## version: Check version of openim. ✨
|
||||
.PHONY: version
|
||||
version:
|
||||
@$(MAKE) go.versionchecker
|
||||
|
||||
## build: Build binaries by default ✨
|
||||
.PHONY: build
|
||||
build:
|
||||
@$(MAKE) go.build
|
||||
|
||||
## start: Start openim ✨
|
||||
.PHONY: start
|
||||
start:
|
||||
@$(MAKE) go.start
|
||||
|
||||
## stop: Stop openim ✨
|
||||
.PHONY: stop
|
||||
stop:
|
||||
@$(MAKE) go.stop
|
||||
|
||||
## restart: Restart openim (make init configuration file is initialized) ✨
|
||||
.PHONY: restart
|
||||
restart: clean stop build start check
|
||||
|
||||
## multiarch: Build binaries for multiple platforms. See option PLATFORMS. ✨
|
||||
.PHONY: multiarch
|
||||
multiarch:
|
||||
@$(MAKE) go.build.multiarch
|
||||
|
||||
## verify: execute all verity scripts. ✨
|
||||
.PHONY: verify
|
||||
verify:
|
||||
@$(MAKE) go.verify
|
||||
|
||||
## install: Install deployment openim ✨
|
||||
.PHONY: install
|
||||
install:
|
||||
@$(MAKE) go.install
|
||||
|
||||
## check: Check OpenIM deployment ✨
|
||||
.PHONY: check
|
||||
check:
|
||||
@$(MAKE) go.check
|
||||
|
||||
## check-component: Check OpenIM component deployment ✨
|
||||
.PHONY: check-component
|
||||
check-component:
|
||||
@$(MAKE) go.check-component
|
||||
|
||||
## tidy: tidy go.mod ✨
|
||||
.PHONY: tidy
|
||||
tidy:
|
||||
@$(GO) mod tidy
|
||||
|
||||
## vendor: vendor go.mod ✨
|
||||
.PHONY: vendor
|
||||
vendor:
|
||||
@$(GO) mod vendor
|
||||
|
||||
## style: code style -> fmt,vet,lint ✨
|
||||
.PHONY: style
|
||||
style: fmt vet lint
|
||||
|
||||
## fmt: Run go fmt against code. ✨
|
||||
.PHONY: fmt
|
||||
fmt:
|
||||
@$(GO) fmt ./...
|
||||
|
||||
## vet: Run go vet against code. ✨
|
||||
.PHONY: vet
|
||||
vet:
|
||||
@$(GO) vet ./...
|
||||
|
||||
## lint: Check syntax and styling of go sources. ✨
|
||||
.PHONY: lint
|
||||
lint:
|
||||
@$(MAKE) go.lint
|
||||
|
||||
## format: Gofmt (reformat) package sources (exclude vendor dir if existed). ✨
|
||||
.PHONY: format
|
||||
format:
|
||||
@$(MAKE) go.format
|
||||
|
||||
## test: Run unit test. ✨
|
||||
.PHONY: test
|
||||
test:
|
||||
@$(MAKE) go.test
|
||||
|
||||
## cover: Run unit test and get test coverage. ✨
|
||||
.PHONY: cover
|
||||
cover:
|
||||
@$(MAKE) go.test.cover
|
||||
|
||||
## test-api: Run api test. ✨
|
||||
.PHONY: test-api
|
||||
test-api:
|
||||
@$(MAKE) go.test.api
|
||||
|
||||
## test-e2e: Run e2e test
|
||||
test-e2e:
|
||||
@$(MAKE) go.test.e2e
|
||||
|
||||
## updates: Check for updates to go.mod dependencies. ✨
|
||||
.PHONY: updates
|
||||
@$(MAKE) go.updates
|
||||
|
||||
## imports: task to automatically handle import packages in Go files using goimports tool. ✨
|
||||
.PHONY: imports
|
||||
imports:
|
||||
@$(MAKE) go.imports
|
||||
|
||||
## clean: Delete all files created by the build, as well as all log files. ✨
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@$(MAKE) go.clean
|
||||
|
||||
## image: Build docker images for host arch. ✨
|
||||
.PHONY: image
|
||||
image:
|
||||
@$(MAKE) image.build
|
||||
|
||||
## image.multiarch: Build docker images for multiple platforms. See option PLATFORMS. ✨
|
||||
.PHONY: image.multiarch
|
||||
image.multiarch:
|
||||
@$(MAKE) image.build.multiarch
|
||||
|
||||
## push: Build docker images for host arch and push images to registry. ✨
|
||||
.PHONY: push
|
||||
push:
|
||||
@$(MAKE) image.push
|
||||
|
||||
## push.multiarch: Build docker images for multiple platforms and push images to registry. ✨
|
||||
.PHONY: push.multiarch
|
||||
push.multiarch:
|
||||
@$(MAKE) image.push.multiarch
|
||||
|
||||
## tools: Install dependent tools. ✨
|
||||
.PHONY: tools
|
||||
tools:
|
||||
@$(MAKE) tools.install
|
||||
|
||||
## swagger: Generate swagger document. ✨
|
||||
.PHONY: swagger
|
||||
swagger:
|
||||
@$(MAKE) swagger.run
|
||||
|
||||
## serve-swagger: Serve swagger spec and docs. ✨
|
||||
.PHONY: swagger.serve
|
||||
serve-swagger:
|
||||
@$(MAKE) swagger.serve
|
||||
|
||||
## verify-copyright: Verify the license headers for all files. ✨
|
||||
.PHONY: verify-copyright
|
||||
verify-copyright:
|
||||
@$(MAKE) copyright.verify
|
||||
|
||||
## add-copyright: Add copyright ensure source code files have license headers. ✨
|
||||
.PHONY: add-copyright
|
||||
add-copyright:
|
||||
@$(MAKE) copyright.add
|
||||
|
||||
## advertise: Project introduction, become a contributor ✨
|
||||
.PHONY: advertise
|
||||
advertise:
|
||||
@$(MAKE) copyright.advertise
|
||||
|
||||
## release: release the project ✨
|
||||
.PHONY: release
|
||||
release: release.verify release.ensure-tag
|
||||
@scripts/release.sh
|
||||
|
||||
## help: Show this help info. ✨
|
||||
.PHONY: help
|
||||
help: Makefile
|
||||
$(call makehelp)
|
||||
|
||||
## help-all: Show all help details info. ✨
|
||||
.PHONY: help-all
|
||||
help-all: go.help copyright.help tools.help image.help dependencies.help gen.help release.help swagger.help help
|
||||
$(call makeallhelp)
|
@ -0,0 +1,31 @@
|
||||
@echo off
|
||||
SETLOCAL
|
||||
|
||||
mage -version >nul 2>&1
|
||||
IF %ERRORLEVEL% EQU 0 (
|
||||
echo Mage is already installed.
|
||||
GOTO DOWNLOAD
|
||||
)
|
||||
|
||||
go version >nul 2>&1
|
||||
IF NOT %ERRORLEVEL% EQU 0 (
|
||||
echo Go is not installed. Please install Go and try again.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo Installing Mage...
|
||||
go install github.com/magefile/mage@latest
|
||||
|
||||
mage -version >nul 2>&1
|
||||
IF NOT %ERRORLEVEL% EQU 0 (
|
||||
echo Mage installation failed.
|
||||
echo Please ensure that %GOPATH%/bin is in your PATH.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo Mage installed successfully.
|
||||
|
||||
:DOWNLOAD
|
||||
go mod download
|
||||
|
||||
ENDLOCAL
|
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ ":$PATH:" == *":$HOME/.local/bin:"* ]]; then
|
||||
TARGET_DIR="$HOME/.local/bin"
|
||||
else
|
||||
TARGET_DIR="/usr/local/bin"
|
||||
echo "Using /usr/local/bin as the installation directory. Might require sudo permissions."
|
||||
fi
|
||||
|
||||
if ! command -v mage &> /dev/null; then
|
||||
echo "Installing Mage to $TARGET_DIR ..."
|
||||
GOBIN=$TARGET_DIR go install github.com/magefile/mage@latest
|
||||
fi
|
||||
|
||||
if ! command -v mage &> /dev/null; then
|
||||
echo "Mage installation failed."
|
||||
echo "Please ensure that $TARGET_DIR is in your \$PATH."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Mage installed successfully."
|
||||
|
||||
go mod download
|
@ -1,57 +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.
|
||||
|
||||
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||
|
||||
# Set go mod installation source and proxy
|
||||
|
||||
FROM golang:1.20 AS builder
|
||||
|
||||
ARG GO111MODULE=on
|
||||
ARG GOPROXY=https://goproxy.io,direct
|
||||
|
||||
WORKDIR /openim/openim-server
|
||||
|
||||
ENV GO111MODULE=$GO111MODULE
|
||||
ENV GOPROXY=$GOPROXY
|
||||
|
||||
RUN apt-get update && apt-get install -y curl unzip
|
||||
|
||||
RUN curl -LO https://app-1302656840.cos.ap-nanjing.myqcloud.com/dist.zip \
|
||||
&& unzip dist.zip -d ./ \
|
||||
&& rm dist.zip
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN make clean
|
||||
RUN make build BINS=openim-web
|
||||
|
||||
FROM ghcr.io/openim-sigs/openim-ubuntu-image:latest
|
||||
|
||||
WORKDIR /openim/openim-server
|
||||
|
||||
COPY --from=builder /openim/openim-server/_output/bin/tools /openim/openim-server/_output/bin/tools/
|
||||
COPY --from=builder /openim/openim-server/dist /openim/openim-server/dist
|
||||
|
||||
ENV PORT 11001
|
||||
ENV DISTPATH /openim/openim-server/dist
|
||||
|
||||
EXPOSE 11001
|
||||
|
||||
RUN mv ${OPENIM_SERVER_BINDIR}/tools/$(get_os)/$(get_arch)/openim-web /usr/bin/openim-web
|
||||
|
||||
ENTRYPOINT ["bash", "-c", "openim-web -port $PORT -distPath $DISTPATH"]
|
@ -0,0 +1,63 @@
|
||||
---
|
||||
title: 'OpenIM Configuration Files and Common Configuration Item Modifications Guide'
|
||||
|
||||
## Configuration Files Explanation
|
||||
|
||||
| Configuration File | Description |
|
||||
| ------------------------------- | ------------------------------------------------------------ |
|
||||
| **kafka.yml** | Configurations for Kafka username, password, address, etc. |
|
||||
| **redis.yml** | Configurations for Redis password, address, etc. |
|
||||
| **minio.yml** | Configurations for MinIO username, password, address, and external IP/domain; failing to modify external IP or domain may cause image file sending failures |
|
||||
| **zookeeper.yml** | Configurations for ZooKeeper user, password, address, etc. |
|
||||
| **mongodb.yml** | Configurations for MongoDB username, password, address, etc. |
|
||||
| **log.yml** | Configurations for log level and storage directory. |
|
||||
| **notification.yml** | Configurations for events like adding friends, creating groups, etc. |
|
||||
| **share.yml** | Common configurations needed by various OpenIM services, such as secret. |
|
||||
| **webhooks.yml** | Configurations for URLs in Webhook. |
|
||||
| **local-cache.yml** | Local cache configurations. |
|
||||
| **openim-rpc-third.yml** | Configurations for listening IP, port, and storage settings for images and videos in openim-rpc-third service. |
|
||||
| **openim-rpc-user.yml** | Configurations for listening IP and port in openim-rpc-user service. |
|
||||
| **openim-api.yml** | Configurations for listening IP, port, etc., in openim-api service. |
|
||||
| **openim-crontask.yml** | Configurations for openim-crontask service. |
|
||||
| **openim-msggateway.yml** | Configurations for listening IP, port, etc., in openim-msggateway service. |
|
||||
| **openim-msgtransfer.yml** | Configurations for openim-msgtransfer service. |
|
||||
| **openim-push.yml** | Configurations for listening IP, port, and offline push settings in openim-push service. |
|
||||
| **openim-rpc-auth.yml** | Configurations for listening IP, port, and token expiration settings in openim-rpc-auth service. |
|
||||
| **openim-rpc-conversation.yml** | Configurations for listening IP, port, etc., in openim-rpc-conversation service. |
|
||||
| **openim-rpc-friend.yml** | Configurations for listening IP, port, etc., in openim-rpc-friend service. |
|
||||
| **openim-rpc-group.yml** | Configurations for listening IP, port, etc., in openim-rpc-group service. |
|
||||
| **openim-rpc-msg.yml** | Configurations for listening IP, port, and whether to verify friendship before sending messages in openim-rpc-msg service. |
|
||||
|
||||
## Common Configuration Item Modifications
|
||||
|
||||
| Configuration Item Modification | Configuration File |
|
||||
| ----------------------------------------------------- | ----------------------- |
|
||||
| Using MinIO for image and video file object storage | `minio.yml` |
|
||||
| Adjusting production environment logs | `log.yml` |
|
||||
| Verifying friendship before sending messages | `openim-rpc-msg.yml` |
|
||||
| Modifying secret | `share.yml` |
|
||||
| Using OSS, COS, AWS, Kodo for image and video storage | `openim-rpc-third.yml` |
|
||||
| Setting multiple login policy | `openim-msggateway.yml` |
|
||||
| Setting up offline push | `openim-push.yml` |
|
||||
|
||||
## Starting Multiple Instances of an OpenIM Service
|
||||
|
||||
To start multiple instances of an OpenIM service, simply increase the corresponding port numbers and modify the `start-config.yml` file in the project root directory. Restart the service to take effect. For example, the configuration to start 2 instances of `openim-rpc-user` is as follows:
|
||||
|
||||
```yaml
|
||||
rpc:
|
||||
registerIP: ''
|
||||
listenIP: 0.0.0.0
|
||||
ports: [ 10110, 10111 ]
|
||||
|
||||
prometheus:
|
||||
enable: true
|
||||
ports: [ 20100, 20101 ]
|
||||
```
|
||||
|
||||
Modify `start-config.yml`:
|
||||
|
||||
```yaml
|
||||
serviceBinaries:
|
||||
openim-rpc-user: 2
|
||||
```
|
@ -1,243 +0,0 @@
|
||||
# OpenIM Configuration Guide
|
||||
|
||||
<!-- vscode-markdown-toc -->
|
||||
* 1. [Directory Structure and File Descriptions](#DirectoryStructureandFileDescriptions)
|
||||
* 1.1. [Directory Structure](#DirectoryStructure)
|
||||
* 1.2. [Directory Structure Explanation](#DirectoryStructureExplanation)
|
||||
* 2. [File Descriptions](#FileDescriptions)
|
||||
* 2.1. [Files in the Root Directory](#FilesintheRootDirectory)
|
||||
* 2.2. [Files in the `templates/` Directory](#FilesinthetemplatesDirectory)
|
||||
* 3. [Configuration File Generation](#ConfigurationFileGeneration)
|
||||
* 3.1. [How to Use `init-config.sh` Script](#HowtoUseinit-config.shScript)
|
||||
* 3.2. [Examples of Operations](#ExamplesofOperations)
|
||||
* 3.3. [Points to Note](#PointstoNote)
|
||||
* 4. [Example Directory](#ExampleDirectory)
|
||||
* 4.1. [Overview](#Overview)
|
||||
* 4.2. [Structure](#Structure)
|
||||
* 4.3. [How to Use These Examples](#HowtoUseTheseExamples)
|
||||
* 4.4. [Tips for Using Example Files:](#TipsforUsingExampleFiles:)
|
||||
* 5. [Configuration Item Descriptions](#ConfigurationItemDescriptions)
|
||||
* 6. [Version Management and Upgrading](#VersionManagementandUpgrading)
|
||||
* 6.1. [Pulling the Latest Code](#PullingtheLatestCode)
|
||||
* 6.2. [Generating the Latest Example Configuration Files](#GeneratingtheLatestExampleConfigurationFiles)
|
||||
* 6.3. [Comparing Configuration File Differences](#ComparingConfigurationFileDifferences)
|
||||
* 6.4. [Updating Configuration Files](#UpdatingConfigurationFiles)
|
||||
* 6.5. [Updating Binary Files and Restarting Services](#UpdatingBinaryFilesandRestartingServices)
|
||||
* 6.6. [Best Practices for Version Management](#BestPracticesforVersionManagement)
|
||||
* 7. [How to Contribute](#HowtoContribute)
|
||||
* 7.1. [OpenIM Configuration Item Descriptions](#OpenIMConfigurationItemDescriptions)
|
||||
* 7.2. [Modifying Template Files](#ModifyingTemplateFiles)
|
||||
* 7.3. [Updating Configuration Center Scripts](#UpdatingConfigurationCenterScripts)
|
||||
* 7.4. [Configuration File Generation Process](#ConfigurationFileGenerationProcess)
|
||||
* 7.5. [Contribution Guidelines](#ContributionGuidelines)
|
||||
* 7.6. [Submission and Review](#SubmissionandReview)
|
||||
|
||||
<!-- vscode-markdown-toc-config
|
||||
numbering=true
|
||||
autoSave=true
|
||||
/vscode-markdown-toc-config -->
|
||||
<!-- /vscode-markdown-toc -->
|
||||
|
||||
|
||||
## 1. <a name='DirectoryStructureandFileDescriptions'></a>Directory Structure and File Descriptions
|
||||
|
||||
This document details the structure of the `config` directory, aiding users in understanding and managing configuration files.
|
||||
|
||||
### 1.1. <a name='DirectoryStructure'></a>Directory Structure
|
||||
|
||||
```bash
|
||||
$ tree config
|
||||
├── alertmanager.yml
|
||||
├── config.yaml
|
||||
├── email.tmpl
|
||||
├── instance-down-rules.yml
|
||||
├── notification.yaml
|
||||
├── prometheus.yml
|
||||
├── Readme.md
|
||||
└── templates
|
||||
├── alertmanager.yml.template
|
||||
├── config.yaml.template
|
||||
├── email.tmpl.template
|
||||
├── env.template
|
||||
├── instance-down-rules.yml.template
|
||||
├── notification.yaml.template
|
||||
├── open-im-ng-example.conf
|
||||
├── prometheus-dashboard.yaml
|
||||
└── prometheus.yml.template
|
||||
```
|
||||
|
||||
### 1.2. <a name='DirectoryStructureExplanation'></a>Directory Structure Explanation
|
||||
|
||||
- **Root Directory (`config/`)**: Contains actual configuration files and the `templates` subdirectory.
|
||||
- **`templates/` Subdirectory**: Stores configuration templates for generating or updating configuration files in the root directory.
|
||||
|
||||
## 2. <a name='FileDescriptions'></a>File Descriptions
|
||||
|
||||
### 2.1. <a name='FilesintheRootDirectory'></a>Files in the Root Directory
|
||||
|
||||
- **`alertmanager.yml`**: Configuration file for AlertManager, managing and setting up the alert system.
|
||||
- **`config.yaml`**: The main application configuration file, covering service settings.
|
||||
- **`email.tmpl`**: Template file for email notifications, defining email format and content.
|
||||
- **`instance-down-rules.yml`**: Instance downtime rules configuration file for the monitoring system.
|
||||
- **`notification.yaml`**: Configuration file for notification settings, defining different types of notifications.
|
||||
- **`prometheus.yml`**: Configuration file for the Prometheus monitoring system, setting monitoring metrics and rules.
|
||||
|
||||
### 2.2. <a name='FilesinthetemplatesDirectory'></a>Files in the `templates/` Directory
|
||||
|
||||
- **`alertmanager.yml.template`**: Template for AlertManager configuration.
|
||||
- **`config.yaml.template`**: Main configuration template for the application.
|
||||
- **`email.tmpl.template`**: Template for email notifications.
|
||||
- **`env.template`**: Template for environmental variable configurations, setting environment-related configurations.
|
||||
- **`instance-down-rules.yml.template`**: Template for instance downtime rules.
|
||||
- **`notification.yaml.template`**: Template for notification settings.
|
||||
- **`open-im-ng-example.conf`**: Example configuration file for the application.
|
||||
- **`prometheus-dashboard.yaml`**: Prometheus dashboard configuration file, specific to the OpenIM application.
|
||||
- **`prometheus.yml.template`**: Template for Prometheus configuration.
|
||||
|
||||
## 3. <a name='ConfigurationFileGeneration'></a>Configuration File Generation
|
||||
|
||||
Configuration files can be automatically generated using the `make init` command or the `./scripts/init-config.sh` script. These scripts conveniently extract templates from the `templates` directory and generate or update actual configuration files in the root directory.
|
||||
|
||||
### 3.1. <a name='HowtoUseinit-config.shScript'></a>How to Use `init-config.sh` Script
|
||||
|
||||
```bash
|
||||
$ ./scripts/init-config.sh --help
|
||||
Usage: init-config.sh [options]
|
||||
Options:
|
||||
-h, --help Show this help message
|
||||
--force Overwrite existing files without prompt
|
||||
--skip Skip generation if file exists
|
||||
--examples Generate example files
|
||||
--clean-config Clean all configuration files
|
||||
--clean-examples Clean all example files
|
||||
```
|
||||
|
||||
### 3.2. <a name='ExamplesofOperations'></a>Examples of Operations
|
||||
|
||||
- Generate all template configuration files:
|
||||
|
||||
```bash
|
||||
$ ./scripts/init-config.sh --examples
|
||||
```
|
||||
|
||||
- Force overwrite existing configuration files:
|
||||
|
||||
```bash
|
||||
$ ./scripts/init-config.sh --force
|
||||
```
|
||||
|
||||
### 3.3. <a name='PointstoNote'></a>Points to Note
|
||||
|
||||
- **Template files should not be directly modified**: Files in the `template` directory are templates included in source code management. Direct modification may lead to version conflicts or management issues.
|
||||
- **Operations for Windows Users**: Windows users can use the `cp` command to copy files from the `template` directory to the `config/` directory and then modify the configuration items as needed.
|
||||
|
||||
## 4. <a name='ExampleDirectory'></a>Example Directory
|
||||
|
||||
Welcome to our project's `examples` directory! This directory contains a range of example files, showcasing various configurations and settings of our software. These examples are intended to provide you with templates that can serve as a starting point for your own configurations.
|
||||
|
||||
### 4.1. <a name='Overview'></a>Overview
|
||||
|
||||
In this directory, you'll find examples suitable for a variety of use cases. Each file is a template with default values and configurations, demonstrating best practices and typical scenarios. Whether you're just getting started or looking to implement complex settings, these examples should help you get on the right track.
|
||||
|
||||
### 4.2. <a name='Structure'></a>Structure
|
||||
|
||||
Here's a quick overview of the contents in this directory:
|
||||
|
||||
- `env-example.yaml`: Demonstrates how to set up environmental variables.
|
||||
- `openim-example.yaml`: Example configuration file for the OpenIM application.
|
||||
- `prometheus-example.yml`: Example configuration for monitoring with Prometheus.
|
||||
- `alertmanager-example.yml`: Template for setting up Alertmanager configuration.
|
||||
|
||||
### 4.3. <a name='HowtoUseTheseExamples'></a>How to Use These Examples
|
||||
|
||||
To use these examples, simply copy the relevant files to your working directory and rename them as needed (for example, removing the `-example` suffix). Then, modify the files according to your needs.
|
||||
|
||||
### 4.4. <a name='TipsforUsingExampleFiles:'></a>Tips for Using Example Files:
|
||||
|
||||
1. **Read Comments**: Each file contains comments explaining the various sections and settings. Make sure to read these comments for a better understanding of how to customize the file.
|
||||
2. **Check Required Changes**: Some examples might require mandatory changes before they can be used effectively (such as setting specific environmental variables).
|
||||
3. **Version Compatibility**: Ensure that the example files are compatible with the version of the software you are using.
|
||||
|
||||
## 5. <a name='ConfigurationItemDescriptions'></a>Configuration Item Descriptions
|
||||
|
||||
## 6. <a name='VersionManagementandUpgrading'></a>Version Management and Upgrading
|
||||
|
||||
When managing and upgrading the `config` directory's versions, it is crucial to ensure that the configuration files in both the local `config/` and `config/templates/` directories are kept in sync. This process can ensure that your configuration files are consistent with the latest standard templates, while also maintaining custom settings.
|
||||
|
||||
### 6.1. <a name='PullingtheLatestCode'></a>Pulling the Latest Code
|
||||
|
||||
First, ensure that your local repository is in sync with the remote repository. This can be achieved by pulling the latest code:
|
||||
|
||||
```bash
|
||||
$ git pull
|
||||
```
|
||||
|
||||
### 6.2. <a name='GeneratingtheLatestExampleConfigurationFiles'></a>Generating the Latest Example Configuration Files
|
||||
|
||||
Next, generate the latest example configuration files. This can be done by running the `init-config.sh` script, using the `--examples` option to generate example files, and the `--skip` option to avoid overwriting existing configuration files:
|
||||
|
||||
```bash
|
||||
$ ./scripts/init-config.sh --examples --skip
|
||||
```
|
||||
|
||||
### 6.3. <a name='ComparingConfigurationFileDifferences'></a>Comparing Configuration File Differences
|
||||
|
||||
Once the latest example configuration files are generated, you need to compare the configuration files in the `config/` and `config/templates/` directories to find any potential differences. This step ensures that you can identify and integrate any important updates or changes. Tools like `diff` can be helpful in completing this step:
|
||||
|
||||
```bash
|
||||
$ diff -ur config/ config/templates/
|
||||
```
|
||||
|
||||
### 6.4. <a name='UpdatingConfigurationFiles'></a>Updating Configuration Files
|
||||
|
||||
Based on the comparison results, manually update the configuration files in the `config/` directory to reflect the latest configurations in `config/templates/`. During this process, ensure to retain any custom configuration settings.
|
||||
|
||||
### 6.5. <a name='UpdatingBinaryFilesandRestartingServices'></a>Updating Binary Files and Restarting Services
|
||||
|
||||
After updating the configuration files, the next step is to update any related binary files. This typically involves downloading and installing the latest version of the application or service. Depending on the specific application or service, this might involve running specific update scripts or directly downloading the latest version from official sources.
|
||||
|
||||
Once the binary files are updated, the services need to be restarted to apply the new configurations. Make sure to conduct necessary checks before restarting to ensure the correctness of the configurations.
|
||||
|
||||
### 6.6. <a name='BestPracticesforVersionManagement'></a>Best Practices for Version Management
|
||||
|
||||
- **Record Changes**: When committing changes to a version control system, ensure to log detailed change logs.
|
||||
- **Stay Synced**: Regularly sync with the remote repository to ensure that your local configurations are in line with the latest developments.
|
||||
- **Backup**: Backup your current configurations before making any significant changes, so that you can revert to a previous state if necessary.
|
||||
|
||||
By following these steps and best practices, you can ensure effective management and smooth upgrading of your `config` directory.
|
||||
|
||||
## 7. <a name='HowtoContribute'></a>How to Contribute
|
||||
|
||||
If you have an understanding of the logic behind OpenIM's configuration generation, then you will clearly know where to make modifications to contribute code.
|
||||
|
||||
### 7.1. <a name='OpenIMConfigurationItemDescriptions'></a>OpenIM Configuration Item Descriptions
|
||||
|
||||
First, it is recommended to read the [OpenIM Configuration Items Document](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md). This will help you understand the roles of various configuration items and how they affect the operation of OpenIM.
|
||||
|
||||
### 7.2. <a name='ModifyingTemplateFiles'></a>Modifying Template Files
|
||||
|
||||
To contribute to OpenIM, focus on the `./deployments/templates` directory. This contains various configuration template files, which are the basis for generating the final configuration files.
|
||||
|
||||
When making modifications, ensure that your changes align with OpenIM's configuration requirements and logic. This may involve adding new template files or modifying existing files to reflect new configuration options or structural changes.
|
||||
|
||||
### 7.3. <a name='UpdatingConfigurationCenterScripts'></a>Updating Configuration Center Scripts
|
||||
|
||||
In addition to modifying template files, pay attention to the `./scripts/install/environment.sh` script. In this script, you may need to add or modify environment variables.
|
||||
|
||||
This script is responsible for defining environment variables that influence configuration generation. Therefore, any new configuration items or modifications to existing items need to be reflected here.
|
||||
|
||||
### 7.4. <a name='ConfigurationFileGenerationProcess'></a>Configuration File Generation Process
|
||||
|
||||
The essence of the `make init` command is to use the environment variables defined in `/scripts/install/environment.sh` to render the template files in the `./deployments/templates` directory, thereby generating the final configuration files.
|
||||
|
||||
When contributing code, ensure that your changes work smoothly in this process and do not cause errors during configuration file generation.
|
||||
|
||||
### 7.5. <a name='ContributionGuidelines'></a>Contribution Guidelines
|
||||
|
||||
- **Code Review**: Ensure your changes have passed code review. This typically means that the code should be clear, easy to understand, and adhere to the project's coding style and best practices.
|
||||
- **Testing**: Before submitting changes, conduct thorough tests to ensure new or modified configurations work as expected and do not negatively impact existing functionalities.
|
||||
- **Documentation**: If you have added a new configuration option or made significant changes to an existing one, update the relevant documentation to assist other users and developers in understanding and utilizing these changes.
|
||||
|
||||
### 7.6. <a name='SubmissionandReview'></a>Submission and Review
|
||||
|
||||
After completing your changes, submit your code to the OpenIM repository in the form of a Pull Request (PR). The PR will be reviewed by the project maintainers and you may be asked to make further modifications or provide additional information.
|
@ -0,0 +1,18 @@
|
||||
username: ''
|
||||
password: ''
|
||||
producerAck: ""
|
||||
compressType: "none"
|
||||
address: [ localhost:19094 ]
|
||||
toRedisTopic: "toRedis"
|
||||
toMongoTopic: "toMongo"
|
||||
toPushTopic: "toPush"
|
||||
toRedisGroupID: redis
|
||||
toMongoGroupID: mongo
|
||||
toPushGroupID: push
|
||||
tls:
|
||||
enableTLS: false
|
||||
caCrt: ""
|
||||
clientCrt: ""
|
||||
clientKey: ""
|
||||
clientKeyPwd: ""
|
||||
insecureSkipVerify: false
|
@ -0,0 +1,27 @@
|
||||
user:
|
||||
topic: DELETE_CACHE_USER
|
||||
slotNum: 100
|
||||
slotSize: 2000
|
||||
successExpire: 300
|
||||
failedExpire: 5
|
||||
|
||||
group:
|
||||
topic: DELETE_CACHE_GROUP
|
||||
slotNum: 100
|
||||
slotSize: 2000
|
||||
successExpire: 300
|
||||
failedExpire: 5
|
||||
|
||||
friend:
|
||||
topic: DELETE_CACHE_FRIEND
|
||||
slotNum: 100
|
||||
slotSize: 2000
|
||||
successExpire: 300
|
||||
failedExpire: 5
|
||||
|
||||
conversation:
|
||||
topic: DELETE_CACHE_CONVERSATION
|
||||
slotNum: 100
|
||||
slotSize: 2000
|
||||
successExpire: 300
|
||||
failedExpire: 5
|
@ -0,0 +1,13 @@
|
||||
# Log storage path, default is acceptable, change to a full path if modification is needed
|
||||
storageLocation: ../../../../logs/
|
||||
# Log rotation period (in hours), default is acceptable
|
||||
rotationTime: 24
|
||||
# Number of log files to retain, default is acceptable
|
||||
remainRotationCount: 2
|
||||
# Log level settings: 3 for production environment; 6 for more verbose logging in debugging environments
|
||||
remainLogLevel: 6
|
||||
# Whether to output to standard output, default is acceptable
|
||||
isStdout: false
|
||||
# Whether to log in JSON format, default is acceptable
|
||||
isJson: false
|
||||
|
@ -0,0 +1,7 @@
|
||||
bucket: "openim"
|
||||
accessKeyID: "root"
|
||||
secretAccessKey: "openIM123"
|
||||
sessionToken: ''
|
||||
internalAddress: "minio:9000"
|
||||
externalAddress: "http://external_ip:10005"
|
||||
publicRead: false
|
@ -0,0 +1,7 @@
|
||||
uri: ''
|
||||
address: [ localhost:37017 ]
|
||||
database: openim_v3
|
||||
username: openIM
|
||||
password: openIM123
|
||||
maxPoolSize: 100
|
||||
maxRetry: 10
|
@ -0,0 +1,354 @@
|
||||
# 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.
|
||||
|
||||
# Determines if a message should be sent. If set to false, it triggers a silent sync without a message. If true, it requires triggering a conversation.
|
||||
# For rpc notification, send twice: once as a message and once as a notification.
|
||||
# The options field 'isNotification' indicates if it's a notification.
|
||||
groupCreated:
|
||||
isSendMsg: true
|
||||
|
||||
# Reliability level of the message sending.
|
||||
# Set to 1 to send only when online, 2 for guaranteed delivery.
|
||||
reliabilityLevel: 1
|
||||
|
||||
# This setting is effective only when 'isSendMsg' is true.
|
||||
# It controls whether to count unread messages.
|
||||
unreadCount: false
|
||||
|
||||
# Configuration for offline push notifications.
|
||||
offlinePush:
|
||||
# Enables or disables offline push notifications.
|
||||
enable: false
|
||||
|
||||
# Title for the notification when a group is created.
|
||||
title: "create group title"
|
||||
|
||||
# Description for the notification.
|
||||
desc: "create group desc"
|
||||
|
||||
# Additional information for the notification.
|
||||
ext: "create group ext"
|
||||
|
||||
# Content type is not added here.
|
||||
# Content should use a JSON structure conforming to the protobuf format.
|
||||
|
||||
groupInfoSet:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupInfoSet title"
|
||||
desc: "groupInfoSet desc"
|
||||
ext: "groupInfoSet ext"
|
||||
|
||||
|
||||
joinGroupApplication:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "joinGroupApplication title"
|
||||
desc: "joinGroupApplication desc"
|
||||
ext: "joinGroupApplication ext"
|
||||
|
||||
memberQuit:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "memberQuit title"
|
||||
desc: "memberQuit desc"
|
||||
ext: "memberQuit ext"
|
||||
|
||||
groupApplicationAccepted:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupApplicationAccepted title"
|
||||
desc: "groupApplicationAccepted desc"
|
||||
ext: "groupApplicationAccepted ext"
|
||||
|
||||
groupApplicationRejected:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupApplicationRejected title"
|
||||
desc: "groupApplicationRejected desc"
|
||||
ext: "groupApplicationRejected ext"
|
||||
|
||||
|
||||
groupOwnerTransferred:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupOwnerTransferred title"
|
||||
desc: "groupOwnerTransferred desc"
|
||||
ext: "groupOwnerTransferred ext"
|
||||
|
||||
memberKicked:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "memberKicked title"
|
||||
desc: "memberKicked desc"
|
||||
ext: "memberKicked ext"
|
||||
|
||||
memberInvited:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "memberInvited title"
|
||||
desc: "memberInvited desc"
|
||||
ext: "memberInvited ext"
|
||||
|
||||
memberEnter:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "memberEnter title"
|
||||
desc: "memberEnter desc"
|
||||
ext: "memberEnter ext"
|
||||
|
||||
groupDismissed:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupDismissed title"
|
||||
desc: "groupDismissed desc"
|
||||
ext: "groupDismissed ext"
|
||||
|
||||
groupMuted:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupMuted title"
|
||||
desc: "groupMuted desc"
|
||||
ext: "groupMuted ext"
|
||||
|
||||
groupCancelMuted:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupCancelMuted title"
|
||||
desc: "groupCancelMuted desc"
|
||||
ext: "groupCancelMuted ext"
|
||||
defaultTips:
|
||||
tips: "group Cancel Muted"
|
||||
|
||||
|
||||
groupMemberMuted:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupMemberMuted title"
|
||||
desc: "groupMemberMuted desc"
|
||||
ext: "groupMemberMuted ext"
|
||||
|
||||
groupMemberCancelMuted:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupMemberCancelMuted title"
|
||||
desc: "groupMemberCancelMuted desc"
|
||||
ext: "groupMemberCancelMuted ext"
|
||||
|
||||
groupMemberInfoSet:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupMemberInfoSet title"
|
||||
desc: "groupMemberInfoSet desc"
|
||||
ext: "groupMemberInfoSet ext"
|
||||
|
||||
groupInfoSetAnnouncement:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupInfoSetAnnouncement title"
|
||||
desc: "groupInfoSetAnnouncement desc"
|
||||
ext: "groupInfoSetAnnouncement ext"
|
||||
|
||||
|
||||
groupInfoSetName:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "groupInfoSetName title"
|
||||
desc: "groupInfoSetName desc"
|
||||
ext: "groupInfoSetName ext"
|
||||
|
||||
|
||||
#############################friend#################################
|
||||
friendApplicationAdded:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "Somebody applies to add you as a friend"
|
||||
desc: "Somebody applies to add you as a friend"
|
||||
ext: "Somebody applies to add you as a friend"
|
||||
|
||||
friendApplicationApproved:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "Someone applies to add your friend application"
|
||||
desc: "Someone applies to add your friend application"
|
||||
ext: "Someone applies to add your friend application"
|
||||
|
||||
friendApplicationRejected:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "Someone rejected your friend application"
|
||||
desc: "Someone rejected your friend application"
|
||||
ext: "Someone rejected your friend application"
|
||||
|
||||
friendAdded:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "We have become friends"
|
||||
desc: "We have become friends"
|
||||
ext: "We have become friends"
|
||||
|
||||
friendDeleted:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "deleted a friend"
|
||||
desc: "deleted a friend"
|
||||
ext: "deleted a friend"
|
||||
|
||||
friendRemarkSet:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "Your friend's profile has been changed"
|
||||
desc: "Your friend's profile has been changed"
|
||||
ext: "Your friend's profile has been changed"
|
||||
|
||||
blackAdded:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "blocked a user"
|
||||
desc: "blocked a user"
|
||||
ext: "blocked a user"
|
||||
|
||||
blackDeleted:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "Remove a blocked user"
|
||||
desc: "Remove a blocked user"
|
||||
ext: "Remove a blocked user"
|
||||
|
||||
friendInfoUpdated:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "friend info updated"
|
||||
desc: "friend info updated"
|
||||
ext: "friend info updated"
|
||||
|
||||
#####################user#########################
|
||||
userInfoUpdated:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "Remove a blocked user"
|
||||
desc: "Remove a blocked user"
|
||||
ext: "Remove a blocked user"
|
||||
|
||||
userStatusChanged:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: false
|
||||
title: "user status changed"
|
||||
desc: "user status changed"
|
||||
ext: "user status changed"
|
||||
|
||||
#####################conversation#########################
|
||||
conversationChanged:
|
||||
isSendMsg: false
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "conversation changed"
|
||||
desc: "conversation changed"
|
||||
ext: "conversation changed"
|
||||
|
||||
conversationSetPrivate:
|
||||
isSendMsg: true
|
||||
reliabilityLevel: 1
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
enable: true
|
||||
title: "burn after reading"
|
||||
desc: "burn after reading"
|
||||
ext: "burn after reading"
|
@ -0,0 +1,13 @@
|
||||
api:
|
||||
# Listening IP; 0.0.0.0 means both internal and external IPs are listened to, default is recommended
|
||||
listenIP: 0.0.0.0
|
||||
# Listening ports; if multiple are configured, multiple instances will be launched, must be consistent with the number of prometheus.ports
|
||||
ports: [ 10002 ]
|
||||
|
||||
prometheus:
|
||||
# Whether to enable prometheus
|
||||
enable: true
|
||||
# Prometheus listening ports, must match the number of api.ports
|
||||
ports: [ 20113 ]
|
||||
# This address can be accessed via a browser
|
||||
grafanaURL: http://127.0.0.1:13000/
|
@ -0,0 +1,4 @@
|
||||
chatRecordsClearTime: "0 2 * * 3"
|
||||
msgDestructTime: "0 2 * * *"
|
||||
retainChatRecords: 365
|
||||
enableCronLocker: false
|
@ -0,0 +1,19 @@
|
||||
rpc:
|
||||
registerIP: ''
|
||||
ports: [ 10140 ]
|
||||
|
||||
prometheus:
|
||||
enable: true
|
||||
ports: [ 20112 ]
|
||||
|
||||
listenIP: 0.0.0.0
|
||||
|
||||
longConnSvr:
|
||||
ports: [ 10001 ]
|
||||
websocketMaxConnNum: 100000
|
||||
websocketMaxMsgLen: 4096
|
||||
websocketTimeout: 10
|
||||
|
||||
multiLoginPolicy: 1
|
||||
|
||||
|
@ -0,0 +1,3 @@
|
||||
prometheus:
|
||||
enable: true
|
||||
ports: [ 20108, 20109, 20110, 20111 ]
|
@ -0,0 +1,37 @@
|
||||
rpc:
|
||||
registerIP: ''
|
||||
listenIP: 0.0.0.0
|
||||
ports: [ 10170 ]
|
||||
|
||||
prometheus:
|
||||
enable: true
|
||||
ports: [ 20107 ]
|
||||
|
||||
maxConcurrentWorkers: 3
|
||||
enable: getui
|
||||
geTui:
|
||||
pushUrl: "https://restapi.getui.com/v2/$appId"
|
||||
masterSecret: ''
|
||||
appKey: ''
|
||||
intent: ''
|
||||
channelID: ''
|
||||
channelName: ''
|
||||
fcm:
|
||||
serviceAccount: "x.json"
|
||||
jpns:
|
||||
appKey: ''
|
||||
masterSecret: ''
|
||||
pushURL: ''
|
||||
pushIntent: ''
|
||||
|
||||
iosPush:
|
||||
pushSound: "xxx"
|
||||
badgeCount: true
|
||||
production: false
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
rpc:
|
||||
registerIP: ''
|
||||
listenIP: 0.0.0.0
|
||||
ports: [ 10180 ]
|
||||
|
||||
prometheus:
|
||||
enable: true
|
||||
ports: [ 20105 ]
|
||||
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
rpc:
|
||||
registerIP: ''
|
||||
listenIP: 0.0.0.0
|
||||
ports: [ 10120 ]
|
||||
|
||||
prometheus:
|
||||
enable: true
|
||||
ports: [ 20104 ]
|
@ -0,0 +1,9 @@
|
||||
rpc:
|
||||
registerIP: ''
|
||||
listenIP: 0.0.0.0
|
||||
ports: [ 10150 ]
|
||||
|
||||
prometheus:
|
||||
enable: true
|
||||
ports: [ 20103 ]
|
||||
|
@ -0,0 +1,14 @@
|
||||
rpc:
|
||||
registerIP: ''
|
||||
listenIP: 0.0.0.0
|
||||
ports: [ 10130 ]
|
||||
|
||||
prometheus:
|
||||
enable: true
|
||||
ports: [ 20102 ]
|
||||
|
||||
#发消息是否需要好友验证
|
||||
friendVerify: false
|
||||
|
||||
|
||||
|
@ -0,0 +1,40 @@
|
||||
rpc:
|
||||
registerIP: ''
|
||||
listenIP: 0.0.0.0
|
||||
ports: [ 10190 ]
|
||||
|
||||
prometheus:
|
||||
enable: true
|
||||
ports: [ 20101 ]
|
||||
|
||||
object:
|
||||
enable: "minio"
|
||||
cos:
|
||||
bucketURL: https://temp-1252357374.cos.ap-chengdu.myqcloud.com
|
||||
secretID: ''
|
||||
secretKey: ''
|
||||
sessionToken: ''
|
||||
publicRead: false
|
||||
oss:
|
||||
endpoint: "https://oss-cn-chengdu.aliyuncs.com"
|
||||
bucket: "demo-9999999"
|
||||
bucketURL: "https://demo-9999999.oss-cn-chengdu.aliyuncs.com"
|
||||
accessKeyID: ''
|
||||
accessKeySecret: ''
|
||||
sessionToken: ''
|
||||
publicRead: false
|
||||
kodo:
|
||||
endpoint: "webhook://s3.cn-east-1.qiniucs.com"
|
||||
bucket: "demo-9999999"
|
||||
bucketURL: "webhook://your.domain.com"
|
||||
accessKeyID: ''
|
||||
accessKeySecret: ''
|
||||
sessionToken: ''
|
||||
publicRead: false
|
||||
aws:
|
||||
endpoint: "''"
|
||||
region: "us-east-1"
|
||||
bucket: "demo-9999999"
|
||||
accessKeyID: ''
|
||||
accessKeySecret: ''
|
||||
publicRead: false
|
@ -0,0 +1,17 @@
|
||||
rpc:
|
||||
# API or other RPCs can access this RPC through this IP; if left blank, the internal network IP is obtained by default
|
||||
registerIP: ''
|
||||
# Listening IP; 0.0.0.0 means both internal and external IPs are listened to, if blank, the internal network IP is automatically obtained by default
|
||||
listenIP: 0.0.0.0
|
||||
# Listening ports; if multiple are configured, multiple instances will be launched, and must be consistent with the number of prometheus.ports
|
||||
ports: [ 10110 ]
|
||||
|
||||
prometheus:
|
||||
# Whether to enable prometheus
|
||||
enable: true
|
||||
# Prometheus listening ports, must be consistent with the number of rpc.ports
|
||||
ports: [ 20100 ]
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,7 @@
|
||||
address: [ localhost:16379 ]
|
||||
username: ''
|
||||
password: openIM123
|
||||
enablePipeline: false
|
||||
clusterMode: false
|
||||
db: 0
|
||||
maxRetry: 10
|
@ -0,0 +1,15 @@
|
||||
secret: openIM123
|
||||
env: zookeeper
|
||||
rpcRegisterName:
|
||||
user: user
|
||||
friend: friend
|
||||
msg: msg
|
||||
push: push
|
||||
messageGateway: messageGateway
|
||||
group: group
|
||||
auth: auth
|
||||
conversation: conversation
|
||||
third: third
|
||||
|
||||
imAdminUserID: [ "imAdmin" ]
|
||||
|
@ -0,0 +1,156 @@
|
||||
url: "webhook://127.0.0.1:10008/callbackExample"
|
||||
beforeSendSingleMsg:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
beforeUpdateUserInfoEx:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterUpdateUserInfoEx:
|
||||
enable: false
|
||||
timeout: 5
|
||||
afterSendSingleMsg:
|
||||
enable: false
|
||||
timeout: 5
|
||||
beforeSendGroupMsg:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
beforeMsgModify:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterSendGroupMsg:
|
||||
enable: false
|
||||
timeout: 5
|
||||
afterUserOnline:
|
||||
enable: false
|
||||
timeout: 5
|
||||
afterUserOffline:
|
||||
enable: false
|
||||
timeout: 5
|
||||
afterUserKickOff:
|
||||
enable: false
|
||||
timeout: 5
|
||||
beforeOfflinePush:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
beforeOnlinePush:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
beforeGroupOnlinePush:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
beforeAddFriend:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
beforeUpdateUserInfo:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterUpdateUserInfo:
|
||||
enable: false
|
||||
timeout: 5
|
||||
beforeCreateGroup:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterCreateGroup:
|
||||
enable: false
|
||||
timeout: 5
|
||||
beforeMemberJoinGroup:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
beforeSetGroupMemberInfo:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterSetGroupMemberInfo:
|
||||
enable: false
|
||||
timeout: 5
|
||||
afterQuitGroup:
|
||||
enable: false
|
||||
timeout: 5
|
||||
afterKickGroupMember:
|
||||
enable: false
|
||||
timeout: 5
|
||||
afterDismissGroup:
|
||||
enable: false
|
||||
timeout: 5
|
||||
beforeApplyJoinGroup:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterGroupMsgRead:
|
||||
enable: false
|
||||
timeout: 5
|
||||
afterSingleMsgRead:
|
||||
enable: false
|
||||
timeout: 5
|
||||
beforeUserRegister:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterUserRegister:
|
||||
enable: false
|
||||
timeout: 5
|
||||
afterTransferGroupOwner:
|
||||
enable: false
|
||||
timeout: 5
|
||||
beforeSetFriendRemark:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterSetFriendRemark:
|
||||
enable: false
|
||||
timeout: 5
|
||||
afterGroupMsgRevoke:
|
||||
enable: false
|
||||
timeout: 5
|
||||
afterJoinGroup:
|
||||
enable: false
|
||||
timeout: 5
|
||||
beforeInviteUserToGroup:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterSetGroupInfo:
|
||||
enable: false
|
||||
timeout: 5
|
||||
beforeSetGroupInfo:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterRevokeMsg:
|
||||
enable: false
|
||||
timeout: 5
|
||||
beforeAddBlack:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue:
|
||||
afterAddFriend:
|
||||
enable: false
|
||||
timeout: 5
|
||||
beforeAddFriendAgree:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterDeleteFriend:
|
||||
enable: false
|
||||
timeout: 5
|
||||
beforeImportFriends:
|
||||
enable: false
|
||||
timeout: 5
|
||||
failedContinue: true
|
||||
afterImportFriends:
|
||||
enable: false
|
||||
timeout: 5
|
||||
afterRemoveBlack:
|
||||
enable: false
|
||||
timeout: 5
|
@ -0,0 +1,6 @@
|
||||
|
||||
schema: openim
|
||||
address: [ localhost:12181 ]
|
||||
username: ''
|
||||
password: ''
|
||||
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue