docs: Add livekit testing + troubleshooting instructions, and other small changes #1429
No reviewers
Labels
No labels
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
Wont fix
old/ci/cd
old/rust
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
continuwuation/continuwuity!1429
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "stratself/continuwuity:stratself/docs-livekit-fixes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pull request adds two new sections for the Livekit page. First, the testing instructions to replicate its token flow against the new
/get_tokenendpoint. Second, the troubleshooting section with commonly-seen issues. It also:Pull request checklist:
mainbranch, and the branch is named something other thanmain.myself, if applicable. This includes ensuring code compiles.
lgtm, just a few copyedits
@ -262,0 +237,4 @@To improve LiveKit's reliability, you can configure it to use your coturn server.Generate a long random secret for LiveKit, and add it to your coturn config under the `static-auth-secret` option. You can add as many secrets as you want - so set a different one for each thing using your TURN server.that should probably be a comma, not a hyphen
@ -239,3 +208,1 @@## LiveKit's built in TURN serverLivekit includes a built in TURN server which can be used in place of an external option. This TURN server will only work with Livekit, so you can't use it for legacy Matrix calling - or anything else.Livekit includes a built in TURN server which can be used in place of an external option. This TURN server will only work with Livekit, so you can't use it for legacy Matrix calling or anything else.inconsistent capitalization of LiveKit
@ -262,0 +239,4 @@Generate a long random secret for LiveKit, and add it to your coturn config under the `static-auth-secret` option. You can add as many secrets as you want - so set a different one for each thing using your TURN server.Then configure livekit, making sure to replace `COTURN_SECRET` with the ones you generated:inconsistent capitalization of LiveKit
@ -262,0 +261,4 @@## TestingTo test that Livekit is successfully integrated with Continuwuity, you will need to replicate its [Token Exchange Flow](https://github.com/element-hq/lk-jwt-service?tab=readme-ov-file#%EF%B8%8F-how-it-works--token-exchange-flow). First, request an OpenID token from your Matrix server:inconsistent capitalization of LiveKit
@ -262,0 +268,4 @@https://matrix.example.com/_matrix/client/v3/user/@user:example.com/openid/request_token```Your `<session-access-token>` can be found in your client device, or via [this website](https://timedout.uk/mxtoken.html). The step above will respond with an `access_token` for use with the lk-jwt-service.s/client device/client's settings
@ -262,0 +303,4 @@curl -X POST -d @payload.json https://livekit.example.com/get_token```The JWT service will respond with a `jwt` token. 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!inconsistent capitalization of LiveKit
I've applied the corrections
Added a reference to #1440. Could be removed later
2f1d4ecdbcaa1fcade9d@ -241,0 +276,4 @@```The JWT service will respond with a `jwt` token. 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!<<<<<<< HEADUh did you forget to resolve a merge conflict?
Just because this
<<<<<<< HEADI think is not intended.@ -241,0 +293,4 @@Guides:- [Element Call self-hosting documentation](https://github.com/element-hq/element-call/blob/livekit/docs/self-hosting.md)<<<<<<< HEADSame here.
I have resolved the conflicts in a new commit.
docs: Add livekit testing instructions, prioritize Livekit's inbuilt TURN instructions, and small changesto docs: Add livekit testing + troubleshooting instructions, and other small changes@ -25,0 +28,4 @@~$ docker run --rm livekit/livekit-server:latest generate-keysAPI Key: APIUxUnMnSkuFWVAPI Secret: t93ZVjPeoEdyx7Wbet3kG4L3NGZIZVEFvqe0UuiVc22AShould there be a newline here?
I'd like to get this newline removed, if it's not intentional, but the rest LGTM now!
This still stands, I think.
I see the issue now, fixed
@ -241,0 +242,4 @@## TestingTo test that LiveKit is successfully integrated with Continuwuity, you will need to replicate its [Token Exchange Flow](https://github.com/element-hq/lk-jwt-service?tab=readme-ov-file#%EF%B8%8F-how-it-works--token-exchange-flow). First, request an OpenID token from your Matrix server:This one doesn't really matter but you can shorten this a little: https://github.com/element-hq/lk-jwt-service#%EF%B8%8F-how-it-works--token-exchange-flow
@ -241,0 +249,4 @@https://matrix.example.com/_matrix/client/v3/user/@user:example.com/openid/request_token```Your `<session-access-token>` can be found in your client's settings, or via [this website](https://timedout.uk/mxtoken.html). The step above will respond with an `access_token` for use with the lk-jwt-service.Should this maybe be the first step instead? (Fetching an access token)
And then the fetching OpenID can be second step?
Might be more intuitive, when reading this it kind of jumps in order.
You're right, lumping it in this order can be confusing, especially when they're all unhelpfully named
access_tokenI have rewritten the testing steps to be more procedural. If you have time to spend, please kindly check the newly-written Troubleshooting section :)
@ -241,0 +343,4 @@- [MatrixRTC proposal](https://github.com/matrix-org/matrix-spec-proposals/pull/4143)- [LiveKit proposal](https://github.com/matrix-org/matrix-spec-proposals/pull/4195)Source codes:s/codes/code
@ -241,0 +317,4 @@- Also use `network_mode: host` for `lk-jwt-service`- (**untested, use as your own risk**) Implement an iptables firewall workaround as shown [here](https://forums.docker.com/t/unable-to-connect-to-host-service-from-inside-docker-container/145749/6).s/as/at
98a6559c977f585a11c6LGTM
@ -241,0 +308,4 @@To alleviate this, you can try one of the following workarounds:- Also use `network_mode: host` for `lk-jwt-service`I don't love this line. The "Also" feels awkward since you weren't talking about it too recently. It's also not particularly descriptive. Could say something more like use network mode host in lk-jwt-service's docker compose or something
22f01e5478a8872454a9You'll want to fix the trailing whitespace that prek complains about
This has merge conflicts with main, although Forgejo isn't showing them for some reason. Once those are resolved this should be good to merge.
@ -11,3 +11,3 @@- For legacy calls to work, you need to set up a TURN/STUN server. [Read the TURN guide for tips on how to set up coturn](./calls/turn.mdx)- For MatrixRTC / Element Call to work, you have to set up the LiveKit backend (foci). LiveKit also uses TURN/STUN to increase reliability, so you might want to configure your TURN server first. [Read the LiveKit guide](./calls/livekit.mdx)- For MatrixRTC / Element Call to work, you have to set up the LiveKit backend (foci). LiveKit also uses TURN/STUN to increase reliability - you can setup its inbuilt TURN server, or integrate with an existing one. [Read the LiveKit guide](./calls/livekit.mdx)This should read "you can set up its built-in TURN server".
@ -96,3 +105,3 @@Reverse proxies can be configured in many different ways - so we can't provide a step by step for this.By default, all routes should be forwarded to Livekit with the exception of the following path prefixes, which should be forwarded to the JWT/Authentication service:By default, all routes should be forwarded to LiveKit with the exception of the following path prefixes, which should be forwarded to the JWT/Authentication service:The clauses here are a little messy. I might suggest something like "All routes should be forwarded to LiveKit by default, except for the following path prefixes, which should be forwarded to the JWT/Authentication service:"
@ -177,2 +185,3 @@## Additional TURN configuration### TURN Integration### Using LiveKit's built in TURN serverSubstitute "built-in" for "built in" wherever it appears as a phrasal adjective.
@ -211,3 +189,1 @@## LiveKit's built in TURN serverLivekit includes a built in TURN server which can be used in place of an external option. This TURN server will only work with Livekit, so you can't use it for legacy Matrix calling - or anything else.LiveKit includes a built in TURN server which can be used in place of an external option. This TURN server will only work with LiveKit, so you can't use it for legacy Matrix calling or anything else.Maybe "solution" instead of "option"? Incredibly minor nitpick, it just reads strangely.
@ -241,0 +221,4 @@To improve LiveKit's reliability, you can configure it to use your coturn server.Generate a long random secret for LiveKit, and add it to your coturn config under the `static-auth-secret` option. You can add as many secrets as you want, so set a different one for each thing using your TURN server.Perhaps "service" instead of "thing", depending on how formal you want to be
@ -241,0 +223,4 @@Generate a long random secret for LiveKit, and add it to your coturn config under the `static-auth-secret` option. You can add as many secrets as you want, so set a different one for each thing using your TURN server.Then configure LiveKit, making sure to replace `COTURN_SECRET` with the ones you generated:Substitute "replace" with "replace each instance of"
The intent is to use one
COTURN_SECRETfor all of them. Fixed wording to match that@ -241,0 +333,4 @@### Workaround for non-federating serversWhen deploying on servers with disabled federation (`enable_registration = false`), LiveKit will fail as it can't fetch the required [OpenID endpoint](https://spec.matrix.org/v1.17/server-server-api/#get_matrixfederationv1openiduserinfo) via federation paths. You can find a workaround for this limitation [here](https://forgejo.ellis.link/continuwuation/continuwuity/issues/1440).You mention "disabled federation" and then give
enable_registrationas your clarification. Is this intentional?Great catch 🤯. Willfix
Thank you very much for spotting this out
No worries :) You may also wish to replace it with "non-federated servers" for brevity, or at least "federation disabled"
90b019e36be22c88ddea8a6591627e44094a9c2eRebased to latest main to address #1361 being merged, and newsfragment written
After these I think this is good to go. Great work.
@ -11,3 +11,3 @@- For legacy calls to work, you need to set up a TURN/STUN server. [Read the TURN guide for tips on how to set up coturn](./calls/turn.mdx)- For MatrixRTC / Element Call to work, you have to set up the LiveKit backend (foci). LiveKit also uses TURN/STUN to increase reliability, so you might want to configure your TURN server first. [Read the LiveKit guide](./calls/livekit.mdx)- For MatrixRTC / Element Call to work, you have to set up the LiveKit backend (foci). LiveKit also uses TURN/STUN to increase reliability - you can setup its built-in TURN server, or integrate with an existing one. [Read the LiveKit guide](./calls/livekit.mdx)s/setup/set up/
@ -241,0 +333,4 @@### Workaround for non-federating serversWhen deploying on servers with federation disabled (`allow_federation = false`), LiveKit will fail as it can't fetch the required [OpenID endpoint](https://spec.matrix.org/v1.17/server-server-api/#get_matrixfederationv1openiduserinfo) via federation paths. You can find a workaround for this limitation [here](https://forgejo.ellis.link/continuwuation/continuwuity/issues/1440).Not sure how I glossed over this last time, but personally I would prefer you documented the workaround in question here instead of just leaving a link to it. That's up to you, though.
I have documented the workaround there, and also linked back to the Forgejo issue in case Cloudflare Pages inevitably go down (it will)
3b1464712383a55a70f483a55a70f4bbe7abcbe2@ -240,1 +215,3 @@- [Community guide](https://blog.kimiblock.top/2024/12/24/hosting-element-call/)### Integration with an external TURN serverIf you've already set up coturn, there may be a port clash between the two services. To fix this, make sure coturn's `min-port` and `max-port` do not overlap with LiveKit's range:this could be a
:::tipDone.