From bb4be6f7bbd362a98c4dedd1385728d435d1e342 Mon Sep 17 00:00:00 2001
From: Bloomingg <1293499952@qq.com>
Date: Sat, 18 May 2024 10:54:18 +0800
Subject: [PATCH] docs: livekit quick start
---
HOW_TO_SETUP_LIVEKIT_SERVER.md | 63 +++++++++++++++-------------------
livekit/livekit.yaml | 9 +++++
2 files changed, 36 insertions(+), 36 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/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