Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
skiffer-git committed May 23, 2024
2 parents 0094773 + 1a4af90 commit 1e668ad
Show file tree
Hide file tree
Showing 53 changed files with 303 additions and 339 deletions.
59 changes: 0 additions & 59 deletions .github/dependabot.yml

This file was deleted.

28 changes: 3 additions & 25 deletions .github/workflows/chatci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,7 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Code Typecheck Detector
uses: kubecub/typecheck@main

- name: Run go modules tidy
run: |
sudo make tidy
- name: Run go format
run: |
sudo make format
echo "Run go format successfully"
continue-on-error: true

- name: Generate all necessary files, such as error code files
run: |
make generate
- name: Run unit test and get test coverage
run: |
make cover
continue-on-error: true

- name: Build source code for host platform
- name: init
run: |
sudo make build
echo "Build source code for host platform successfully"
sudo bash bootstrap.sh
echo "init successfully"
File renamed without changes.
50 changes: 8 additions & 42 deletions .github/workflows/scripts-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up environment
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update
# Add other Linux specific setup here
elif [ "$RUNNER_OS" == "macOS" ]; then
# Add macOS specific setup here
brew update
fi
shell: bash

# - name: Install latest Bash (macOS only)
# if: runner.os == 'macOS'
# run: |
Expand All @@ -69,56 +58,33 @@ jobs:
# brew install --cask docker
# open /Applications/Docker.app

- name: Build Chat
run: |
make build
chmod +x ./scripts/build-all-service.sh
./scripts/build-all-service.sh
shell: bash

- name: deploy all services
run: |
git clone https://github.com/openimsdk/open-im-server.git
cd open-im-server
sudo make init
sudo docker compose up -d
sudo sleep 30
sudo make start
sudo make check
sudo bash bootstrap.sh
sudo mage
sudo mage start
sudo mage check
sudo cat _output/logs/chat_$(date '+%Y%m%d').log 2>/dev/null
echo "pwd = $(pwd)"
cd ..
ls -al && pwd
shell: bash
continue-on-error: true

- name: start all services
run: |
sudo make init && \
sudo make start || \
(echo "An error occurred, printing logs:" && sudo cat ./_output/logs/* 2>/dev/null)
shell: bash

- name: Check all services
- name: Build Chat
run: |
sudo make check || \
(echo "An error occurred, printing logs:" && sudo cat ./_output/logs/* 2>/dev/null)
sudo bash bootstrap.sh
sudo mage
sudo mage start
shell: bash

- name: Stop chat
run: |
sudo make stop
- name: Reinstall chat
run: |
sudo make install
- name: Print chat_$(date '+%Y%m%d').log
run: |
ls -al && echo "pwd = $(pwd)"
sudo cat ./_output/logs/* 2>/dev/null
sudo cat ./_output/logs/* 2>/dev/null >> "$GITHUB_OUTPUT"
shell: bash
continue-on-error: true
63 changes: 27 additions & 36 deletions HOW_TO_SETUP_LIVEKIT_SERVER.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,45 @@
# How to setup LiveKit server
# Setting Up LiveKit Server for OpenIM Chat

OpenIM Chat uses LiveKit server as the media server to support video call and video meeting services.
OpenIM Chat uses the LiveKit server as the media server to support video calls and video meeting services.

## About LiveKit

## Something about LiveKit
[LiveKit](https://github.com/livekit/livekit-server) is an open-source WebRTC SFU written in Go, built on top of the excellent [Pion](https://github.com/pion) project. For more information, visit the [LiveKit website](https://livekit.io/).

[Livekit](https://github.com/livekit/livekit-server) is an open source WebRTC SFU written in go, built on top of the excellent [Pion](https://github.com/pion) project. You can get more information about it on its website [livekit.io](https://livekit.io/).
## Quick Start


## Setup LiveKit server on Linux

Please follow the following instructions to setup a LiveKit server to work with OpenIM Chat and OpenIM server on Linux server.

### Docker installation

For self hosting user, we suggest you install LiveKit server by docker pull. You can get a server ready for use in a short time.
To self-host LiveKit, start the server with the following Docker command:

```bash
sudo docker pull livekit/livekit-server
docker run -d \
-p 7880:7880 \
-p 7881:7881 \
-p 7882:7882/udp \
-v $PWD/livekit/livekit.yaml:/livekit.yaml \
livekit/livekit-server \
--config /livekit.yaml \
--bind 0.0.0.0
```

For cloud deployment, you may follow the [Deploy to a VM](https://docs.livekit.io/realtime/self-hosting/vm/#Deploy-to-a-VM) on [livekit.io](https://docs.livekit.io/).

### Generate configuration
## Viewing Logs

To generate configuration file for LiveKit server, please refer to [Generate configuration](https://docs.livekit.io/realtime/self-hosting/vm/#Generate-configuration).
To check the server logs and ensure everything is running correctly, use the following command:

The keys section of the generated .yaml file is the "apiKey: apiSecret" pair. This key pair should be set to the LiveKit section as the value of <font color="#FF8000">key</font> and <font color="#FF8000">secret</font> arguments.

### Generate access token for video call participant

Please refer to [Generating tokens](https://docs.livekit.io/realtime/server/generating-tokens/) on [livekit.io](https://docs.livekit.io/).
```bash
docker logs livekit/livekit-server
```

### Run it
## Configuring the LiveKit Address in OpenIM Chat

For self hosting user, you may start LiveKit with:
Update the `config/chat-rpc-chat.yml` file to configure the LiveKit server address:

```bash
docker run --rm \
-p 7880:7880 \
-p 7881:7881 \
-p 7882:7882/udp \
-v $PWD/livekit.yaml:/livekit.yaml \
livekit/livekit-server \
--config /livekit.yaml \
--bind 0.0.0.0
```yaml
liveKit:
url: "ws://127.0.0.1:7880" # LIVEKIT_URL, LiveKit server address and port
```
For cloud deployment user, you may follow the [Deploy to a VM](https://docs.livekit.io/realtime/self-hosting/vm/#Deploy-to-a-VM) on [livekit.io](https://docs.livekit.io/).
By following these steps, you can set up and configure the LiveKit server for use with OpenIM Chat.
## More about Deploying LiveKit
## More about Deploying LiveKi
Please refer to the self hosting [Deploying LiveKit](https://docs.livekit.io/realtime/self-hosting/deployment/) documentation.
For detailed instructions on deploying LiveKit, refer to the self-hosting [deployment documentation](https://docs.livekit.io/realtime/self-hosting/deployment/).
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@ You may use the OpenIM source code to create compiled versions not originally pr
## :busts_in_silhouette: Community

+ 💬 [Follow our Twitter account](https://twitter.com/founder_im63606)
+ 👫 [Join our Reddit](https://www.reddit.com/r/OpenIMessaging)
+ 🚀 [Join our Slack community](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q)
+ 🚀 [Join our Slack community](https://join.slack.com/t/openimsdk/shared_invite/zt-2hljfom5u-9ZuzP3NfEKW~BJKbpLm0Hw)
+ :eyes: [Join our WeChat group](https://openim-1253691595.cos.ap-nanjing.myqcloud.com/WechatIMG20.jpeg)
+ 📚 [OpenIM Community](https://github.com/openimsdk/community)
+ 💕 [OpenIM Interest Groups](https://github.com/Openim-sigs)

## 🛫 Quick Start

Expand Down
5 changes: 1 addition & 4 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@
## :busts_in_silhouette: 社区

+ 💬 [关注我们的 Twitter 账户](https://twitter.com/founder_im63606)
+ 👫 [加入我们的 Reddit](https://www.reddit.com/r/OpenIMessaging)
+ 🚀 [加入我们的 Slack 社区](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q)
+ 🚀 [加入我们的 Slack 社区](https://join.slack.com/t/openimsdk/shared_invite/zt-2hljfom5u-9ZuzP3NfEKW~BJKbpLm0Hw)
+ :eyes: [加入我们的微信群](https://openim-1253691595.cos.ap-nanjing.myqcloud.com/WechatIMG20.jpeg)
+ 📚 [OpenIM 社区](https://github.com/openimsdk/community)
+ 💕 [OpenIM 兴趣小组](https://github.com/Openim-sigs)

## 🛫 快速开始

Expand Down
2 changes: 2 additions & 0 deletions config/chat-api-admin.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
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
ports: [ 10009 ]

2 changes: 2 additions & 0 deletions config/chat-api-chat.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
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
ports: [ 10008 ]

3 changes: 3 additions & 0 deletions config/chat-rpc-admin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
rpc:
# The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP
registerIP: ''
# IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP
listenIP: 0.0.0.0
# List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances.
ports: [ 30200 ]

tokenPolicy:
Expand Down
3 changes: 3 additions & 0 deletions config/chat-rpc-chat.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
rpc:
# The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP
registerIP: ''
# IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP
listenIP: 0.0.0.0
# List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances.
ports: [ 30300 ]

verifyCode:
Expand Down
13 changes: 13 additions & 0 deletions config/discovery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
enable: "etcd"
etcd:
rootDirectory: openim
address: [ localhost:12379 ]
username: ''
password: ''

zookeeper:
schema: openim
address: [ localhost:12181 ]
username: ''
password: ''

7 changes: 6 additions & 1 deletion config/log.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# 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
withStack: false
9 changes: 8 additions & 1 deletion config/mongodb.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# URI for database connection, leave empty if using address and credential settings directly
uri: ''
# List of MongoDB server addresses
address: [ localhost:37017 ]
# Name of the database
database: openim_v3
# Username for database authentication
username: openIM
# Password for database authentication
password: openIM123
# Maximum number of connections in the connection pool
maxPoolSize: 100
maxRetry: 10
# Maximum number of retry attempts for a failed database connection
maxRetry: 10
9 changes: 8 additions & 1 deletion config/redis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# List of Redis server addresses
address: [ localhost:16379 ]
# Username for Redis authentication (leave blank if not used)
username: ''
# Password for Redis authentication
password: openIM123
# Enable or disable pipeline processing
enablePipeline: false
# Enable or disable cluster mode
clusterMode: false
# Database index to be used
db: 0
maxRetry: 10
# Maximum number of retry attempts for a failed connection
maxRetry: 10
Loading

0 comments on commit 1e668ad

Please sign in to comment.