mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
docs(livekit): Add/correct client discovery paths and extra fixes
* Use de facto unstasble path instead of the standard one * Document both the unstable and well-known paths as being exposed by Continuwuity when set * Make curling said path one of the Testing steps * Removing confusing console `~$` prefix symbols, move commands and response into separate code blocks * Number the MSCs
This commit is contained in:
+35
-7
@@ -91,7 +91,7 @@ You will need to allow ports `7881/tcp` and `50100:50200/udp` through your firew
|
|||||||
|
|
||||||
To tell clients where to find LiveKit, you need to add the address of your `lk-jwt-service` to the `[global.matrix_rtc]` config section using the `foci` option.
|
To tell clients where to find LiveKit, you need to add the address of your `lk-jwt-service` to the `[global.matrix_rtc]` config section using the `foci` option.
|
||||||
|
|
||||||
The variable should be a list of servers serving as MatrixRTC endpoints. Clients discover these via the `/_matrix/client/v1/rtc/transports` endpoint (MSC4143).
|
The variable should be a list of servers serving as MatrixRTC endpoints. Replace the URL with the address you are deploying your instance of lk-jwt-service to:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[global.matrix_rtc]
|
[global.matrix_rtc]
|
||||||
@@ -100,7 +100,10 @@ foci = [
|
|||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
Remember to replace the URL with the address you are deploying your instance of lk-jwt-service to.
|
This will expose LiveKit information on the following endpoints for clients to discover:
|
||||||
|
|
||||||
|
- `/_matrix/client/unstable/org.matrix.msc4143/rtc/transports` (MSC4143 unstable, behind auth)
|
||||||
|
- `/.well-known/matrix/client` (fallback, not behind auth. Only enabled if `[global.well_known].client` is set)
|
||||||
|
|
||||||
### 4. Configure your Reverse Proxy
|
### 4. Configure your Reverse Proxy
|
||||||
|
|
||||||
@@ -114,6 +117,7 @@ All paths should be forwarded to LiveKit by default, with the exception of the f
|
|||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Example caddy config</summary>
|
<summary>Example caddy config</summary>
|
||||||
|
|
||||||
```
|
```
|
||||||
livekit.example.com {
|
livekit.example.com {
|
||||||
|
|
||||||
@@ -127,10 +131,12 @@ All paths should be forwarded to LiveKit by default, with the exception of the f
|
|||||||
reverse_proxy 127.0.0.1:7880
|
reverse_proxy 127.0.0.1:7880
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Example nginx config</summary>
|
<summary>Example nginx config</summary>
|
||||||
|
|
||||||
```
|
```
|
||||||
server {
|
server {
|
||||||
server_name livekit.example.com;
|
server_name livekit.example.com;
|
||||||
@@ -167,16 +173,19 @@ All paths should be forwarded to LiveKit by default, with the exception of the f
|
|||||||
'' close;
|
'' close;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Example traefik router</summary>
|
<summary>Example traefik router</summary>
|
||||||
|
|
||||||
```
|
```
|
||||||
# on LiveKit itself
|
# on LiveKit itself
|
||||||
traefik.http.routers.livekit.rule=Host(`livekit.example.com`)
|
traefik.http.routers.livekit.rule=Host(`livekit.example.com`)
|
||||||
# on the JWT service
|
# on the JWT service
|
||||||
traefik.http.routers.livekit-jwt.rule=Host(`livekit.example.com`) && (PathPrefix(`/sfu/get`) || PathPrefix(`/healthz`) || PathPrefix(`/get_token`))
|
traefik.http.routers.livekit-jwt.rule=Host(`livekit.example.com`) && (PathPrefix(`/sfu/get`) || PathPrefix(`/healthz`) || PathPrefix(`/get_token`))
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
||||||
@@ -257,11 +266,25 @@ To test that LiveKit is successfully integrated with Continuwuity, you will need
|
|||||||
|
|
||||||
First, you will need an access token for your current login session. These can be found in your client's settings or obtained via [this website](https://timedout.uk/mxtoken.html).
|
First, you will need an access token for your current login session. These can be found in your client's settings or obtained via [this website](https://timedout.uk/mxtoken.html).
|
||||||
|
|
||||||
Then, using that token, request another OpenID token for use with the lk-jwt-service:
|
Then, using that token, fetch the discovery endpoints for MatrixRTC services
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
~$ curl -X POST -H "Authorization: Bearer <session-access-token>" \
|
curl -X POST -H "Authorization: Bearer <session-access-token>" \
|
||||||
|
https://matrix.example.com/_matrix/client/unstable/org.matrix.msc4143/rtc/transports
|
||||||
|
```
|
||||||
|
|
||||||
|
In the output, you should see the LiveKit URL matching the one [configured above](#3-telling-clients-where-to-find-livekit).
|
||||||
|
|
||||||
|
With the same token, request another OpenID token for use with the lk-jwt-service:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X POST -H "Authorization: Bearer <session-access-token>" \
|
||||||
https://matrix.example.com/_matrix/client/v3/user/@user:example.com/openid/request_token
|
https://matrix.example.com/_matrix/client/v3/user/@user:example.com/openid/request_token
|
||||||
|
```
|
||||||
|
|
||||||
|
You will see a response as below:
|
||||||
|
|
||||||
|
```json
|
||||||
{"access_token":"<openid_access_token>","token_type":"Bearer","matrix_server_name":"example.com","expires_in":3600}
|
{"access_token":"<openid_access_token>","token_type":"Bearer","matrix_server_name":"example.com","expires_in":3600}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -296,10 +319,15 @@ You can then send this payload to the lk-jwt-service:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
~$ curl -X POST -d @payload.json https://livekit.example.com/get_token
|
~$ curl -X POST -d @payload.json https://livekit.example.com/get_token
|
||||||
|
```
|
||||||
|
|
||||||
|
The lk-jwt-service will, after checking against Continuwuity, answer with a `jwt` token to create a LiveKit media room:
|
||||||
|
|
||||||
|
```json
|
||||||
{"url":"wss://livekit.example.com","jwt":"a_really_really_long_string"}
|
{"url":"wss://livekit.example.com","jwt":"a_really_really_long_string"}
|
||||||
```
|
```
|
||||||
|
|
||||||
The lk-jwt-service will, after checking against Continuwuity, answer with a `jwt` token to create a LiveKit media room. Use this token to test at the [LiveKit Connection Tester](https://livekit.io/connection-test). If everything works there, then you have set up LiveKit successfully!
|
Use this token to test at the [LiveKit Connection Tester](https://livekit.io/connection-test). If everything works there, then you have set up LiveKit successfully!
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
@@ -363,8 +391,8 @@ Guides:
|
|||||||
|
|
||||||
Specifications:
|
Specifications:
|
||||||
|
|
||||||
- [MatrixRTC proposal](https://github.com/matrix-org/matrix-spec-proposals/pull/4143)
|
- [MSC4143 - MatrixRTC proposal](https://github.com/matrix-org/matrix-spec-proposals/pull/4143)
|
||||||
- [LiveKit proposal](https://github.com/matrix-org/matrix-spec-proposals/pull/4195)
|
- [MSC4195 - LiveKit proposal](https://github.com/matrix-org/matrix-spec-proposals/pull/4195)
|
||||||
|
|
||||||
Source code:
|
Source code:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user