From 1a4af90da7c8b1b0dfc9cfdbe9a7b1257917f61f Mon Sep 17 00:00:00 2001 From: blooming <37789413+Bloomingg@users.noreply.github.com> Date: Mon, 20 May 2024 10:49:55 +0800 Subject: [PATCH] docs: livekit quick start (#543) * docs: livekit quick start * Update CODEOWNERS --- HOW_TO_SETUP_LIVEKIT_SERVER.md | 63 +++++++++++++++------------------- docs/CODEOWNERS | 2 +- livekit/livekit.yaml | 9 +++++ 3 files changed, 37 insertions(+), 37 deletions(-) create mode 100644 livekit/livekit.yaml diff --git a/HOW_TO_SETUP_LIVEKIT_SERVER.md b/HOW_TO_SETUP_LIVEKIT_SERVER.md index cf4c8c85a..c8c6dd23e 100644 --- a/HOW_TO_SETUP_LIVEKIT_SERVER.md +++ b/HOW_TO_SETUP_LIVEKIT_SERVER.md @@ -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 key and secret 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/). diff --git a/docs/CODEOWNERS b/docs/CODEOWNERS index f3a3a550d..015466d02 100644 --- a/docs/CODEOWNERS +++ b/docs/CODEOWNERS @@ -1 +1 @@ -* @openimsdk/go-code-review @skiffer-git @withchao +* @Bloomingg @FGadvancer @skiffer-git @withchao diff --git a/livekit/livekit.yaml b/livekit/livekit.yaml new file mode 100644 index 000000000..5d1f955f4 --- /dev/null +++ b/livekit/livekit.yaml @@ -0,0 +1,9 @@ +port: 7880 +rtc: + tcp_port: 7881 + port_range_start: 50000 + port_range_end: 60000 + use_external_ip: true + enable_loopback_candidate: false +keys: + APIftrpEkL9x2pa: 23ztfSqsfQ8hKkHzHTl3Z4bvaxro0snjk5jwbp5p6Q3 \ No newline at end of file