diff --git a/assets/README.md b/assets/README.md index d3e735dc0..152e5850c 100644 --- a/assets/README.md +++ b/assets/README.md @@ -25,7 +25,7 @@ assets/ ## Copyright Notice: -The OpenIM logo, including its variations and animated versions, displayed in this repository [OpenIM](https://github.com/OpenIMSDK/openim) under the `/assets/logo` and `/assets/logo-gif` directories, are protected by copyright laws. +The OpenIM logo, including its variations and animated versions, displayed in this repository [OpenIM](https://github.com/openimsdk/open-im-server) under the `/assets/logo` and `/assets/logo-gif` directories, are protected by copyright laws. The logo design is credited to @Xx(席欣). diff --git a/docker-compose.yml b/docker-compose.yml index defc910c4..ba6699a3b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -126,8 +126,9 @@ services: # Uncomment and configure the following services as needed # openim-admin: - # image: ${IMAGE_REGISTRY:-ghcr.io/openimsdk}/openim-admin-front:v3.4.0 - # container_name: openim-admin + # # https://github.com/openimsdk/open-im-server/issues/1662 + # image: ${IMAGE_REGISTRY:-ghcr.io/openimsdk}/openim-admin:${ADMIN_FRONT_VERSION:-toc-base-open-docker.35} + # container_name: openim-admin # restart: always # ports: # - "${OPENIM_ADMIN_FRONT_PORT:-11002}:80" @@ -141,8 +142,8 @@ services: # hostname: prometheus # restart: always # volumes: - # - ./config/prometheus.yml:/etc/prometheus/prometheus.yml - # - ./config/instance-down-rules.yml:/etc/prometheus/instance-down-rules.yml + # - "${DATA_DIR:-./}/config/instance-down-rules.yml:/etc/prometheus/instance-down-rules.yml" + # - "${DATA_DIR:-./}/config/prometheus.yml:/etc/prometheus/prometheus.yml" # ports: # - "${PROMETHEUS_PORT:-19090}:9090" # networks: @@ -155,8 +156,8 @@ services: # hostname: alertmanager # restart: always # volumes: - # - ./config/alertmanager.yml:/etc/alertmanager/alertmanager.yml - # - ./config/email.tmpl:/etc/alertmanager/email.tmpl + # - ${DATA_DIR:-./}/config/alertmanager.yml:/etc/alertmanager/alertmanager.yml + # - ${DATA_DIR:-./}/config/email.tmpl:/etc/alertmanager/email.tmpl # ports: # - "${ALERT_MANAGER_PORT:-19093}:9093" # networks: @@ -172,7 +173,7 @@ services: # ports: # - "${GRAFANA_PORT:-13000}:3000" # volumes: - # - ${DATA_DIR:-./}/components/grafana:/var/lib/grafana + # - "${DATA_DIR:-./}/components/grafana:/var/lib/grafana" # networks: # server: # ipv4_address: ${GRAFANA_NETWORK_ADDRESS:-172.28.0.11} diff --git a/docs/contrib/environment.md b/docs/contrib/environment.md index 7425c8022..275868111 100644 --- a/docs/contrib/environment.md +++ b/docs/contrib/environment.md @@ -108,7 +108,7 @@ export CHAT_IMAGE_VERSION="main" export SERVER_IMAGE_VERSION="main" ``` -These variables are stored within the [`environment.sh`](https://github.com/OpenIMSDK/openim-docker/blob/main/scripts/install/environment.sh) configuration: +These variables are stored within the [`environment.sh`](https://github.com/OpenIMSDK/open-im-server/blob/main/scripts/install/environment.sh) configuration: ```bash readonly CHAT_IMAGE_VERSION=${CHAT_IMAGE_VERSION:-'main'} diff --git a/docs/contrib/gitcherry-pick.md b/docs/contrib/gitcherry-pick.md index 010685d65..2e901385f 100644 --- a/docs/contrib/gitcherry-pick.md +++ b/docs/contrib/gitcherry-pick.md @@ -75,7 +75,7 @@ It is critical that our full community is actively engaged on enhancements in th - Be aware the cherry pick script assumes you have a git remote called `upstream` that points at the openim-server github org. - Please see our [recommended Git workflow](https://github.com/openimsdk/open-im-server/blob/main/docs/contributors/github-workflow.md#workflow). + Please see our [recommended Git workflow](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/github-workflow.md#workflow). - You will need to run the cherry pick script separately for each patch release you want to cherry pick to. Cherry picks should be applied to all [active](https://github.com/openimsdk/open-im-server/releases) release branches where the fix is applicable. diff --git a/docs/contrib/github-workflow.md b/docs/contrib/github-workflow.md index 0afbae144..50f2e0bb2 100644 --- a/docs/contrib/github-workflow.md +++ b/docs/contrib/github-workflow.md @@ -8,7 +8,6 @@ description: | commit hygiene. --- -![Git workflow](git_workflow.png) ## 1. Fork in the cloud @@ -28,10 +27,10 @@ neither `$GOPATH/src/github.com/${your github profile name}/` nor any other pattern will work. ```sh -export working_dir="$(go env GOPATH)/src/k8s.io" +export working_dir="$(go env GOPATH)/src/github.com/openimsdk" ``` -If you already do Go development on github, the `k8s.io` directory +If you already do Go development on github, the `github.com/openimsdk` directory will be a sibling to your existing `github.com` directory. Set `user` to match your github profile name: diff --git a/docs/contrib/offline-deployment.md b/docs/contrib/offline-deployment.md index 39fc3598e..0e0755143 100644 --- a/docs/contrib/offline-deployment.md +++ b/docs/contrib/offline-deployment.md @@ -6,25 +6,57 @@ Below are the base images and their versions you'll need: -- wurstmeister/kafka -- redis:7.0.0 -- mongo:6.0.2 -- mysql:5.7 -- wurstmeister/zookeeper -- minio/minio +- [ ] bitnami/kafka:3.5.1 +- [ ] redis:7.0.0 +- [ ] mongo:6.0.2 +- [ ] bitnami/zookeeper:3.8 +- [ ] minio/minio:latest + +> [!IMPORTANT] +> It is important to note that OpenIM removed mysql components from versions v3.5.0 (release-v3.5) and above, so mysql can be deployed without this requirement or above + +**If you need to install more IM components or monitoring products:** + +OpenIM: + +> [!TIP] +> If you need to install more IM components or monitoring products [images.md](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/images.md) + +- [ ] ghcr.io/openimsdk/openim-web:latest +- [ ] ghcr.io/openimsdk/openim-admin:latest +- [ ] ghcr.io/openimsdk/openim-chat:latest +- [ ] ghcr.io/openimsdk/openim-server:latest + + +Monitoring: + +- [ ] prom/prometheus:v2.48.1 +- [ ] prom/alertmanager:v0.23.0 +- [ ] grafana/grafana:10.2.2 +- [ ] bitnami/node-exporter:1.7.0 + Use the following commands to pull these base images: -``` -docker pull wurstmeister/kafka +```bash +docker pull bitnami/kafka:3.5.1 docker pull redis:7.0.0 docker pull mongo:6.0.2 docker pull mysql:5.7 -docker pull wurstmeister/zookeeper -docker pull minio/minio +docker pull bitnami/zookeeper:3.8 +docker pull minio/minio:latest ``` -## 2. OpenIM & Chat Images +If you need to install more IM components or monitoring products: + +```bash +docker pull prom/prometheus:v2.48.1 +docker pull prom/alertmanager:v0.23.0 +docker pull grafana/grafana:10.2.2 +docker pull bitnami/node-exporter:1.7.0 +``` + +## 2. OpenIM Images **For detailed understanding of version management and storage of OpenIM and Chat**: [version.md](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/version.md) @@ -42,9 +74,26 @@ docker pull ghcr.io/openimsdk/openim-server: - Execute the following command to pull the image: ```bash -docker pull ghcr.io/openimsdk/openim-server: +docker pull ghcr.io/openimsdk/openim-chat: ``` +### Web Image + +- Execute the following command to pull the image: + +```bash +docker pull ghcr.io/openimsdk/openim-web: +``` + +### Admin Image + +- Execute the following command to pull the image: + +```bash +docker pull ghcr.io/openimsdk/openim-admin: +``` + + ## 3. Image Storage Selection **Repositories**: @@ -71,46 +120,49 @@ You can select from the following versions: 1. **Pull images**: Execute the above `docker pull` commands to pull all required images locally. 2. **Save images**: -``` +```bash docker save -o .tar ``` 1. **Fetch code**: Clone the repository: +```bash +git clone https://github.com/openimsdk/openim-docker.git ``` -git clone https://github.com/OpenIMSDK/openim-docker.git -``` -Or download the code from [Releases](https://github.com/OpenIMSDK/openim-docker/releases/). +Or download the code from [Releases](https://github.com/openimsdk/openim-docker/releases/). + +> Because of the difference between win and linux newlines, please do not clone the repository with win and then synchronize scp to linux. 1. **Transfer files**: Use `scp` to transfer all images and code to the intranet server. -``` +```bash scp .tar user@remote-ip:/path/on/remote/server ``` Or choose other transfer methods such as a hard drive. -1. **Import images**: On the intranet server: +2. **Import images**: On the intranet server: -``` +```bash docker load -i .tar ``` -1. **Deploy**: Navigate to the `openim-docker` repository directory and follow the README guide for deployment. -2. **Deploy using Docker-compose**: +3. **Deploy**: Navigate to the `openim-docker` repository directory and follow the [README guide](https://github.com/openimsdk/openim-docker) for deployment. -``` -docker-compose up -d +4. **Deploy using docker compose**: + +```bash +docker compose up -d # Verify -docker-compose ps +docker compose ps ``` > **Note**: If you're using a version of Docker prior to 20, make sure you've installed `docker-compose`. ## 6. Reference Links -- [OpenIMSDK Issue #432](https://github.com/openimsdk/open-im-server/issues/432) +- [openimsdk Issue #432](https://github.com/openimsdk/open-im-server/issues/432) - [Notion Link](https://nsddd.notion.site/435ee747c0bc44048da9300a2d745ad3?pvs=25) -- [OpenIMSDK Issue #474](https://github.com/openimsdk/open-im-server/issues/474) \ No newline at end of file +- [openimsdk Issue #474](https://github.com/openimsdk/open-im-server/issues/474) \ No newline at end of file diff --git a/docs/contrib/prometheus-grafana.md b/docs/contrib/prometheus-grafana.md index a59847f71..5b57c5942 100644 --- a/docs/contrib/prometheus-grafana.md +++ b/docs/contrib/prometheus-grafana.md @@ -111,32 +111,35 @@ Importing Grafana Dashboards is a straightforward process and is applicable to O To monitor OpenIM in Grafana, you need to focus on three categories of key metrics, each with its specific deployment and configuration steps: -1. **OpenIM Metrics (`prometheus-dashboard.yaml`)**: - + **Configuration File Path**: Located at `config/prometheus-dashboard.yaml`. - + **Enabling Monitoring**: Set the environment variable `export PROMETHEUS_ENABLE=true` to enable Prometheus monitoring. - + **More Information**: Refer to the [OpenIM Configuration Guide](https://docs.openim.io/configurations/prometheus-integration). -2. **Node Exporter**: - + **Container Deployment**: Deploy the `quay.io/prometheus/node-exporter` container for node monitoring. - + **Get Dashboard**: Access the [Node Exporter Full Feature Dashboard](https://grafana.com/grafana/dashboards/1860-node-exporter-full/) and import it using YAML file download or ID import. - + **Deployment Guide**: Refer to the [Node Exporter Deployment Documentation](https://prometheus.io/docs/guides/node-exporter/). -3. **Middleware Metrics**: Each middleware requires specific steps and configurations to enable monitoring. Here is a list of common middleware and links to their respective setup guides: - + MySQL: - + **Configuration**: Ensure MySQL has performance monitoring enabled. - + **Link**: Refer to the [MySQL Monitoring Configuration Guide](https://grafana.com/docs/grafana/latest/datasources/mysql/). - + Redis: - + **Configuration**: Configure Redis to allow monitoring data export. - + **Link**: Refer to the [Redis Monitoring Guide](https://grafana.com/docs/grafana/latest/datasources/redis/). - + MongoDB: - + **Configuration**: Set up monitoring metrics for MongoDB. - + **Link**: Refer to the [MongoDB Monitoring Guide](https://grafana.com/grafana/plugins/grafana-mongodb-datasource/). - + Kafka: - + **Configuration**: Integrate Kafka with Prometheus monitoring. - + **Link**: Refer to the [Kafka Monitoring Guide](https://grafana.com/grafana/plugins/grafana-kafka-datasource/). - + Zookeeper: - + **Configuration**: Ensure Zookeeper can be monitored by Prometheus. - + **Link**: Refer to the [Zookeeper Monitoring Configuration](https://grafana.com/docs/grafana/latest/datasources/zookeeper/). - - +**OpenIM Metrics (`prometheus-dashboard.yaml`)**: + +- **Configuration File Path**: Find this at `config/prometheus-dashboard.yaml`. +- **Enabling Monitoring**: Activate Prometheus monitoring by setting the environment variable: `export PROMETHEUS_ENABLE=true`. +- **More Information**: For detailed instructions, see the [OpenIM Configuration Guide](https://docs.openim.io/configurations/prometheus-integration). + +**Node Exporter**: + +- **Container Deployment**: Use the container `quay.io/prometheus/node-exporter` for effective node monitoring. +- **Access Dashboard**: Visit the [Node Exporter Full Feature Dashboard](https://grafana.com/grafana/dashboards/1860-node-exporter-full/) for dashboard integration either through YAML file download or ID. +- **Deployment Guide**: For deployment steps, consult the [Node Exporter Deployment Documentation](https://prometheus.io/docs/guides/node-exporter/). + +**Middleware Metrics**: Different middlewares require unique steps and configurations for monitoring: + +- MySQL: + - **Configuration**: Make sure MySQL is set up for performance monitoring. + - **Guide**: See the [MySQL Monitoring Configuration Guide](https://grafana.com/docs/grafana/latest/datasources/mysql/). +- Redis: + - **Configuration**: Adjust Redis settings to enable monitoring data export. + - **Guide**: Consult the [Redis Monitoring Guide](https://grafana.com/docs/grafana/latest/datasources/redis/). +- MongoDB: + - **Configuration**: Configure MongoDB for monitoring metrics. + - **Guide**: Visit the [MongoDB Monitoring Guide](https://grafana.com/grafana/plugins/grafana-mongodb-datasource/). +- Kafka: + - **Configuration**: Set up Kafka for Prometheus monitoring integration. + - **Guide**: Refer to the [Kafka Monitoring Guide](https://grafana.com/grafana/plugins/grafana-kafka-datasource/). +- Zookeeper: + - **Configuration**: Ensure Prometheus can monitor Zookeeper. + - **Guide**: Check out the [Zookeeper Monitoring Configuration](https://grafana.com/docs/grafana/latest/datasources/zookeeper/). **Importing Steps**: diff --git a/tools/formitychecker/README.md b/tools/formitychecker/README.md new file mode 100644 index 000000000..7cabf8a66 --- /dev/null +++ b/tools/formitychecker/README.md @@ -0,0 +1,102 @@ +# Development of a Go-Based Conformity Checker for Project File and Directory Naming Standards + +### 1. Project Overview + +#### Project Name + +- `GoConformityChecker` + +#### Functionality Description + +- Checks if the file and subdirectory names in a specified directory adhere to specific naming conventions. +- Supports specific file types (e.g., `.go`, `.yml`, `.yaml`, `.md`, `.sh`, etc.). +- Allows users to specify directories to be checked and directories to be ignored. +- More read https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/code-conventions.md + +#### Naming Conventions + +- Go files: Only underscores are allowed. +- YAML, YML, and Markdown files: Only hyphens are allowed. +- Directories: Only underscores are allowed. + +### 2. File Structure + +- `main.go`: Entry point of the program, handles command-line arguments. +- `checker/checker.go`: Contains the core logic. +- `config/config.go`: Parses and stores configuration information. + +### 3. Core Code Design + +#### main.go + +- Parses command-line arguments, including the directory to be checked and directories to be ignored. +- Calls the `checker` module for checking. + +#### config.go + +- Defines a configuration structure, such as directories to check and ignore. + +#### checker.go + +- Iterates through the specified directory. +- Applies different naming rules based on file types and directory names. +- Records files or directories that do not conform to the standards. + +### 4. Pseudocode Example + +#### main.go + +```go +package main + +import ( + "flag" + "fmt" + "GoConformityChecker/checker" +) + +func main() { + // Parse command-line arguments + var targetDir string + var ignoreDirs string + flag.StringVar(&targetDir, "target", ".", "Directory to check") + flag.StringVar(&ignoreDirs, "ignore", "", "Directories to ignore") + flag.Parse() + + // Call the checker + err := checker.CheckDirectory(targetDir, ignoreDirs) + if err != nil { + fmt.Println("Error:", err) + } +} +``` + +#### checker.go + +```go +package checker + +import ( + // Import necessary packages +) + +func CheckDirectory(targetDir, ignoreDirs string) error { + // Iterate through the directory, applying rules to check file and directory names + // Return any found errors or non-conformities + return nil +} +``` + +### 5. Implementation Details + +- **File and Directory Traversal**: Use Go's `path/filepath` package to traverse directories and subdirectories. +- **Naming Rules Checking**: Apply different regex expressions for naming checks based on file extensions. +- **Error Handling and Reporting**: Record files or directories that do not conform and report to the user. + +### 6. Future Development and Extensions + +- Support more file types and naming rules. +- Provide more detailed error reports, such as showing line numbers and specific naming mistakes. +- Add a graphical or web interface for non-command-line users. + +The above is an overview of the entire project's design. Following this design, specific coding implementation can begin. Note that the actual implementation may need adjustments based on real-world conditions. \ No newline at end of file