docs: Refactor and improve TURN documentation #1740

Merged
Aranjedeath merged 19 commits from stratself/continuwuity:stratself/docs-turn-improvements into main 2026-08-04 18:18:55 +00:00
Member

This PR edits the entire turn.mdx page for better flow and readability. Notably, insecure config options like guest access/password credentials have been deprioritized into the Appendix section. Furthermore, links to guidance for eturnal (another STUN/TURN software) and TURNS-over-443 are added. Lastly, the LiveKit page is also given a polish once-over. See the commit messages and previews below for more.

Current docs: https://continuwuity.org/calls/turn.html, https://continuwuity.org/calls/livekit.html
Preview: https://muc.muoi.me/calls/turn.html, https://muc.muoi.me/calls/livekit.html

I also intend to add some guidance for TURNS-over-443 (in the Appendix), but it would probably go into a future PR.

Pull request checklist:

  • This pull request targets the main branch, and the branch is named something other than
    main.
  • I have written an appropriate pull request title and my description is clear.
  • I understand I am responsible for the contents of this pull request.
  • I have followed the contributing guidelines:
This PR edits the entire turn.mdx page for better flow and readability. Notably, insecure config options like guest access/password credentials have been deprioritized into the Appendix section. Furthermore, links to guidance for eturnal (another STUN/TURN software) and TURNS-over-443 are added. Lastly, the LiveKit page is also given a polish once-over. See the commit messages and previews below for more. Current docs: https://continuwuity.org/calls/turn.html, https://continuwuity.org/calls/livekit.html Preview: https://muc.muoi.me/calls/turn.html, https://muc.muoi.me/calls/livekit.html ~~I also intend to add some guidance for TURNS-over-443 (in the Appendix), but it would probably go into a future PR.~~ <!-- Example: This pull request allows us to warp through time and space ten times faster than before by double-inverting the warp drive with hyperheated jump fluid, both making the drive faster and more efficient. This resolves the common issue where we have to wait more than 10 milliseconds to engage, use, and disengage the warp drive when travelling between galaxies. --> <!-- Closes: #... --> <!-- Fixes: #... --> <!-- Uncomment the above line(s) if your pull request fixes an issue or closes another pull request by superseding it. Replace `#...` with the issue/pr number, such as `#123`. --> **Pull request checklist:** <!-- You need to complete these before your PR can be considered. If you aren't sure about some, feel free to ask for clarification in #dev:continuwuity.org. --> - [x] This pull request targets the `main` branch, and the branch is named something other than `main`. - [x] I have written an appropriate pull request title and my description is clear. - [x] I understand I am responsible for the contents of this pull request. - I have followed the [contributing guidelines][c1]: - [x] My contribution follows the [code style][c2], if applicable. - [x] I ran [pre-commit checks][c1pc] before opening/drafting this pull request. - [x] I have [tested my contribution][c1t] (or proof-read it for documentation-only changes) myself, if applicable. This includes ensuring code compiles. - [x] My commit messages follow the [commit message format][c1cm] and are descriptive. <!-- Notes on these requirements: - While not required, we encourage you to sign your commits with GPG or SSH to attest the authenticity of your changes. - While we allow LLM-assisted contributions, we do not appreciate contributions that are low quality, which is typical of machine-generated contributions that have not had a lot of love and care from a human. Please do not open a PR if all you have done is asked ChatGPT to tidy up the codebase with a +-100,000 diff. - In the case of code style violations, reviewers may leave review comments/change requests indicating what the ideal change would look like. For example, a reviewer may suggest you lower a log level, or use `match` instead of `if/else` etc. - In the case of code style violations, pre-commit check failures, minor things like typos/spelling errors, and in some cases commit format violations, reviewers may modify your branch directly, typically by making changes and adding a commit. Particularly in the latter case, a reviewer may rebase your commits to squash "spammy" ones (like "fix", "fix", "actually fix"), and reword commit messages that don't satisfy the format. - Pull requests MUST pass the `Checks` CI workflows to be capable of being merged. This can only be bypassed in exceptional circumstances. If your CI flakes, let us know in matrix:r/dev:continuwuity.org. - Pull requests have to be based on the latest `main` commit before being merged. If the main branch changes while you're making your changes, you should make sure you rebase on main before opening a PR. Your branch will be rebased on main before it is merged if it has fallen behind. - We typically only do fast-forward merges, so your entire commit log will be included. Once in main, it's difficult to get out cleanly, so put on your best dress, smile for the cameras! --> [c1]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md [c2]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/docs/development/code_style.mdx [c1pc]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#pre-commit-checks [c1t]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#running-tests-locally [c1cm]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#commit-messages
stratself force-pushed stratself/docs-turn-improvements from 4e19a0f5d1
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 8s
Checks / Prek / Check changed files (pull_request) Successful in 34s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m43s
to 02008de778
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 31s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m22s
2026-05-07 06:59:33 +00:00
Compare
stratself changed title from docs: Refactor and improve TURN documentation to WIP: docs: Refactor and improve TURN documentation 2026-05-16 19:09:32 +00:00
stratself force-pushed stratself/docs-turn-improvements from 02008de778
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 31s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m22s
to aea9b66c13
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 9s
Checks / Prek / Check changed files (pull_request) Successful in 32s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 21m1s
2026-05-21 07:52:33 +00:00
Compare
stratself changed title from WIP: docs: Refactor and improve TURN documentation to docs: Refactor and improve TURN documentation 2026-05-21 07:53:43 +00:00
Author
Member

Un-WIP and ready. I was wondering if LiveKit's TURN docs could be deprioritized, but can deal with it later.

Un-WIP and ready. I was wondering if LiveKit's TURN docs could be deprioritized, but can deal with it later.
stratself force-pushed stratself/docs-turn-improvements from 1bac3968f1
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Check changed files (pull_request) Successful in 7s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m30s
to 4d043e27db
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Check changed files (pull_request) Successful in 7s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m26s
2026-06-08 16:40:29 +00:00
Compare
@ -215,0 +394,4 @@
By default, TURN credentials require client authentication. To allow unauthenticated access:
```toml
turn_allow_guests = true
Owner

This config option no longer exists in main.

This config option no longer exists in `main`.
Author
Member

Removed

Removed
stratself marked this conversation as resolved
stratself force-pushed stratself/docs-turn-improvements from 4d043e27db
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Check changed files (pull_request) Successful in 7s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m26s
to 57d99044cd
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m10s
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 1m17s
2026-06-17 06:51:22 +00:00
Compare
stratself force-pushed stratself/docs-turn-improvements from 57d99044cd
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m10s
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 1m17s
to dfcb5ade99
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 9s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 1m9s
2026-06-21 04:50:39 +00:00
Compare
@ -215,0 +302,4 @@
```
{
servers {
Owner

I'm assuming you have tested these setups 😓

I'm assuming you *have* tested these setups 😓
Author
Member

I've tested that TURN-over-TLS-over-443 works against Trickle ICE, but not legacy calls, probably due to my complex IP setup.

I hope this could be merged after I fix some other stuff and remove the WIP, and I'll test further along as I have time, thanks.

I've tested that TURN-over-TLS-over-443 works against Trickle ICE, but not legacy calls, probably due to my complex IP setup. I hope this could be merged after I fix some other stuff and remove the WIP, and I'll test further along as I have time, thanks.
Author
Member

I've successfully tested all scenarios with livekit and coturn using host networking mode (which is what we recommend anyways). This should be good to do

I've successfully tested all scenarios with livekit and coturn using host networking mode (which is what we recommend anyways). This should be good to do
stratself marked this conversation as resolved
stratself changed title from docs: Refactor and improve TURN documentation to WIP: docs: Refactor and improve TURN documentation 2026-07-06 16:15:21 +00:00
stratself force-pushed stratself/docs-turn-improvements from 8005a48571
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Changelog / Check changelog is added (pull_request_target) Failing after 1s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m13s
Checks / Prek / Check changed files (pull_request) Successful in 7s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
to 1d4fb59216
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Has been cancelled
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Check changed files (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Update flake hashes / update-flake-hashes (pull_request) Has been cancelled
2026-07-09 19:20:39 +00:00
Compare
stratself force-pushed stratself/docs-turn-improvements from 1d4fb59216
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Has been cancelled
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Check changed files (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Update flake hashes / update-flake-hashes (pull_request) Has been cancelled
to cd9b581251
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Has been cancelled
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Check changed files (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m37s
2026-07-09 19:22:38 +00:00
Compare
stratself force-pushed stratself/docs-turn-improvements from cd9b581251
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Has been cancelled
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Check changed files (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m37s
to 9ab0ec6e4d
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 50s
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
2026-07-09 19:34:20 +00:00
Compare
stratself changed title from WIP: docs: Refactor and improve TURN documentation to docs: Refactor and improve TURN documentation 2026-07-09 19:34:23 +00:00
stratself changed title from docs: Refactor and improve TURN documentation to WIP: docs: Refactor and improve TURN documentation 2026-07-13 08:58:03 +00:00
stratself force-pushed stratself/docs-turn-improvements from 9ab0ec6e4d
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 50s
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
to 74b86d3afd
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Checks / Prek / Check changed files (pull_request) Successful in 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m7s
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 2m4s
Deploy Element Web / 🏗️ Build and Deploy (pull_request) Failing after 6m35s
2026-07-23 09:25:33 +00:00
Compare
stratself changed title from WIP: docs: Refactor and improve TURN documentation to docs: Refactor and improve TURN documentation 2026-07-23 09:59:31 +00:00
stratself force-pushed stratself/docs-turn-improvements from 838bc76af7
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Checks / Prek / Check changed files (pull_request) Successful in 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 51s
to e269cdbae1
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Checks / Prek / Check changed files (pull_request) Successful in 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 51s
2026-07-23 14:15:35 +00:00
Compare
stratself force-pushed stratself/docs-turn-improvements from e269cdbae1
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Checks / Prek / Check changed files (pull_request) Successful in 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 51s
to 9842680195
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Check changed files (pull_request) Successful in 5s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m11s
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 2m4s
Deploy Element Web / 🏗️ Build and Deploy (pull_request) Failing after 6m15s
2026-07-31 06:30:34 +00:00
Compare
stratself force-pushed stratself/docs-turn-improvements from cd0403139c
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Check changed files (pull_request) Successful in 5s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 1m5s
to 7011d353f1
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m11s
2026-07-31 11:58:52 +00:00
Compare
stratself force-pushed stratself/docs-turn-improvements from 7011d353f1
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m11s
to f2567e1408
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 1m4s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m7s
2026-08-04 15:52:36 +00:00
Compare
stratself force-pushed stratself/docs-turn-improvements from f2567e1408
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 1m4s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m7s
to 5ea980b943
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Check changed files (pull_request) Successful in 4s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m7s
2026-08-04 16:40:04 +00:00
Compare
@ -90,3 +96,3 @@
### 3. Telling clients where to find LiveKit
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 your `lk-jwt-service`'s address to the `[global.matrix_rtc] > foci` field of your Continuwuity config file.
Member
To tell clients where to find LiveKit, you need to add your `lk-jwt-service`'s address to the `foci` field of the `[global.matrix_rtc]` section of your Continuwuity config file.
``` To tell clients where to find LiveKit, you need to add your `lk-jwt-service`'s address to the `foci` field of the `[global.matrix_rtc]` section of your Continuwuity config file. ```
@ -100,6 +106,12 @@ foci = [
]
```
If you configure Continuwuity via environment variables, use the following:
Member

Is this not already covered by the existence of the environment variables documentation?

Is this not already covered by the existence of the environment variables documentation?
Author
Member

This is provided as a convenience for most users

This is provided as a convenience for most users
stratself marked this conversation as resolved
@ -134,1 +146,4 @@
**Note**: if you run Caddy inside a container (e.g. by following the example [here](../deploying/docker.mdx#caddy-using-caddyfile)) instead of on the host, then:
- Put these containers on the same bridge network as caddy (by defining `networks: [ caddy ]` in each of the services), and
Member

Inconsistent capitalisation of Caddy.

Inconsistent capitalisation of Caddy.
@ -135,0 +147,4 @@
**Note**: if you run Caddy inside a container (e.g. by following the example [here](../deploying/docker.mdx#caddy-using-caddyfile)) instead of on the host, then:
- Put these containers on the same bridge network as caddy (by defining `networks: [ caddy ]` in each of the services), and
- Use appropriate container hostnames (`lk-jwt-service` and `livekit`) instead of `127.0.0.1` in the Caddyfile
Member

This is not technically necessary, and does require additional configuration to work (i.e. having hostname resolution on the network)

This is not technically necessary, and does require additional configuration to work (i.e. having hostname resolution on the network)
Author
Member

Aren't hostname resolutions on by default?

Aren't hostname resolutions on by default?
@ -442,1 +396,4 @@
### Incorrect IP address for LiveKit
By default, LiveKit auto-discovers its public IP address(es), which is reflected in the "Establishing WebRTC connection" section of the connection test page. If these IPs are incorrect, you may want to hardcode your own IP by doing the following:
Member

Autodiscover is a standardised term. It should either be unhyphenated or avoided here. Try:

LiveKit automatically finds its public IP address(es) by default, as seen in the "Establishing WebRTC connection" section of the connection test page.

This should also link to the connection test page in question.

Autodiscover is a standardised term. It should either be unhyphenated or avoided here. Try: ``` LiveKit automatically finds its public IP address(es) by default, as seen in the "Establishing WebRTC connection" section of the connection test page. ``` This should also link to the connection test page in question.
stratself marked this conversation as resolved
@ -475,0 +457,4 @@
Other:
- [Matrix VOIP and LiveKit][sspaeth-matrix-voip] - Community member deep dive on current VOIP solutions on Matrix
Member

"VoIP"
It may also be courteous to attribute authors, rather than "community member"

"VoIP" It may also be courteous to attribute authors, rather than "community member"
Author
Member

I (or you) can attribute all "community member" authors in future PR(s)

I (or you) can attribute all "community member" authors in future PR(s)
@ -475,0 +464,4 @@
## Appendix
### Additional TURNS-over-443 configuration
Member

I can't select the line above for some reason, but "TURNS-over-443" should be "TURNS over TCP/443"

I can't select the line above for some reason, but "TURNS-over-443" should be "TURNS over TCP/443"
Author
Member

there is no TURNS over UDP but I can be pedantic

there is no TURNS over UDP but I can be pedantic
@ -475,0 +465,4 @@
### Additional TURNS-over-443 configuration
Most of the time, LiveKit [**does not need TURN**][sspaeth-matrix-voip-turn] to function. However, there are situations where clients are in very restrictive networks that disallows non-standard ports and UDP. In these cases, a TURN-over-TLS server on port :443 could be employed to relay traffic for them.
Member

Try:

Most of the time, LiveKit [**does not need TURN**][sspaeth-matrix-voip-turn] to function. However, there are situations where clients may be unable to use nonstandard ports or UDP connections, such as in restrictive networks. In such cases, a TURN-over-TLS server on port 443 could relay traffic for the clients.

Also, does this necessitate TURNS, or would an ordinary TURN server running on TCP/443 suffice? It is unclear from this section whether TLS is a necessity.

Try: ``` Most of the time, LiveKit [**does not need TURN**][sspaeth-matrix-voip-turn] to function. However, there are situations where clients may be unable to use nonstandard ports or UDP connections, such as in restrictive networks. In such cases, a TURN-over-TLS server on port 443 could relay traffic for the clients. ``` Also, does this necessitate TURNS, or would an ordinary TURN server running on TCP/443 suffice? It is unclear from this section whether TLS is a necessity.
Author
Member
TLS is likely a necessity - https://docs.livekit.io/transport/self-hosting/deployment/#turn-tls
stratself marked this conversation as resolved
@ -475,0 +482,4 @@
turn:
enabled: true
# note: the TLS port will always be advertised as :443
Member

"as 443"

"as 443"
@ -462,2 +428,2 @@
- [Community guide with overview of LiveKit's mechanisms](https://tomfos.tr/matrix/livekit/)
- [Community guide using systemd](https://blog.kimiblock.top/2024/12/24/hosting-element-call/)
- [Element Call self-hosting documentation from element-hq][element-call-selfhosting]
- [Community guide with overview of LiveKit's mechanisms][tom-livekit-guide]
Member

"an overview"

"an overview"
@ -475,0 +485,4 @@
# note: the TLS port will always be advertised as :443
tls_port: 5349
# optional: configure an extra UDP port on :3478
Member

The documentation should probably make it clear which circumstances I would want to do this in. Also, same note about port numbers.

The documentation should probably make it clear which circumstances I would want to do this in. Also, same note about port numbers.
@ -475,0 +507,4 @@
# "3478:3478/udp" # (optional UDP port)
```
Recreate the LiveKit container (with `docker-compose up -d livekit`) to apply these changes. Remember to allow the new `50300:50400/udp` ports through your firewall.
Member

This has not been correct for several versions of docker compose, to my knowledge. It should just be docker compose. The syntax used here is also invalid for a port range.

This has not been correct for several versions of docker compose, to my knowledge. It should just be `docker compose`. The syntax used here is also invalid for a port range.
stratself marked this conversation as resolved
@ -467,2 +442,2 @@
- [MSC4143 - MatrixRTC proposal](https://github.com/matrix-org/matrix-spec-proposals/pull/4143)
- [MSC4195 - LiveKit proposal](https://github.com/matrix-org/matrix-spec-proposals/pull/4195)
- [MSC4143 - MatrixRTC proposal][MSC4143]
- [MSC4195 - LiveKit proposal][MSC4195]
Member

While we're here, these should probably use the correct titles of the proposals.

While we're here, these should probably use the correct titles of the proposals.
stratself marked this conversation as resolved
@ -475,0 +499,4 @@
```
```yaml
### add these ports to livekit's docker-compose ###
Member

What's with the variance in number of #s? Is that standardised throughout Continuwuity's documentation? If it is, it's quite jarring.

What's with the variance in number of #s? Is that standardised throughout Continuwuity's documentation? If it is, it's quite jarring.
stratself marked this conversation as resolved
@ -475,0 +509,4 @@
Recreate the LiveKit container (with `docker-compose up -d livekit`) to apply these changes. Remember to allow the new `50300:50400/udp` ports through your firewall.
Then, we will configure a route from port 443 of the host back to our `livekit-turn.example.com` service on port 5349. To both **multiplex** this and LiveKit's websocket on the same port, we will use a layer-4 reverse proxy with **SNI routing** capabilities, such as [caddy-l4][caddy-l4] on the host system.
Member
Then, configure a route from port 443 on the host back to the `livekit-turn.example.com` service on port 5349. To multiplex the service and LiveKit's websocket on the same port, use a layer 4 reverse proxy with SNI routing capabilities, such as [caddy-l4], on the host system.
``` Then, configure a route from port 443 on the host back to the `livekit-turn.example.com` service on port 5349. To multiplex the service and LiveKit's websocket on the same port, use a layer 4 reverse proxy with SNI routing capabilities, such as [caddy-l4], on the host system. ```
stratself marked this conversation as resolved
@ -475,0 +532,4 @@
}
# livekit stuff
https://livekit.example.com {
Member

Drop # livekit stuff, and the https:// is unnecessary here.

Drop `# livekit stuff`, and the `https://` is unnecessary here.
stratself marked this conversation as resolved
@ -475,0 +548,4 @@
<details>
<summary>Using an external TURN server (coturn)</summary>
Before continuing, make sure coturn's `min-port` and `max-port` do not overlap with LiveKit's port range:
Member

Try "First, make sure"

Try "First, make sure"
stratself marked this conversation as resolved
@ -475,0 +556,4 @@
max-port=65535
```
Then, 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 LiveKit to use.
Member
Then, generate a secret for LiveKit, and set it as the `static-auth-secret` option in your coturn configuration. You can add as many secrets as you want, so set a different one for LiveKit to use.

This would be my suggested wording, but you already mention generating a secret for LiveKit in the first sentence, so I am not sure what you mean by the second.

``` Then, generate a secret for LiveKit, and set it as the `static-auth-secret` option in your coturn configuration. You can add as many secrets as you want, so set a different one for LiveKit to use. ``` This would be my suggested wording, but you already mention generating a secret for LiveKit in the first sentence, so I am not sure what you mean by the second.
Author
Member

This is the TURN secret

This is the TURN secret
stratself marked this conversation as resolved
@ -475,0 +558,4 @@
Then, 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 LiveKit to use.
After that, refer to the following [**TURN instructions**](./turn#turns-over-443) to set up coturn with TLS, as well as multiplexing with LiveKit's websocket on port 443.
Member

These TURN instructions need not be bold, nor are they following. Also, if there's already a TURNS over 443 section in another file, perhaps they should be merged?

These TURN instructions need not be bold, nor are they following. Also, if there's already a TURNS over 443 section in another file, perhaps they should be merged?
Author
Member

This section's main purpose is to generate a new TURN secret just for LiveKit. The rest should follow the real TURN documentation.

This section's main purpose is to generate a new TURN secret just for LiveKit. The rest should follow the real TURN documentation.
stratself marked this conversation as resolved
@ -475,0 +573,4 @@
secret: "COTURN_SECRET"
```
Restart LiveKit, coturn, and Caddy-l4 to apply these changes.
Member

When I was researching caddy-l4's intended capitalisation, I discovered it has a different official name, which may be worth noting: https://github.com/mholt/caddy-l4#project-conncept-a-tcpudp-app-for-caddy

When I was researching caddy-l4's intended capitalisation, I discovered it has a different official name, which may be worth noting: https://github.com/mholt/caddy-l4#project-conncept-a-tcpudp-app-for-caddy
Author
Member

Nobody calls it that way

Nobody calls it that way
stratself marked this conversation as resolved
@ -475,0 +577,4 @@
</details>
After finishing configuration, you can run the Testing steps again to check that TURN-over-TLS is working. In the LiveKit connection test page, there should be a green tick saying "Can connect to TURN".
Member
After you finish configuring the services, you should run the Testing steps again to check that TURN over TLS is working. There should be a green tick the LiveKit connection page with "Can connect to TURN" to confirm this.

Also, link to Testing. I would additionally highlight that the TURN over TLS / TURNS over 443 thing is still inconsistent.

``` After you finish configuring the services, you should run the Testing steps again to check that TURN over TLS is working. There should be a green tick the LiveKit connection page with "Can connect to TURN" to confirm this. ``` Also, link to Testing. I would additionally highlight that the TURN over TLS / TURNS over 443 thing is still inconsistent.
stratself marked this conversation as resolved
@ -1,36 +1,95 @@
# Setting up TURN/STUN
[TURN](https://en.wikipedia.org/wiki/Traversal_Using_Relays_around_NAT) and [STUN](https://en.wikipedia.org/wiki/STUN) are used as a component in many calling systems. Matrix uses them directly for legacy calls and indirectly for MatrixRTC via Livekit.
[TURN][turn] and [STUN][stun] are used as a component in many calling systems. Matrix uses them directly for legacy calls and indirectly for MatrixRTC via Livekit.
Member

This should be "are used as components", and I strongly suspect "or" rather than "and".

This should be "are used as components", and I strongly suspect "or" rather than "and".
Author
Member

Most use cases combine them into one component.

Most use cases combine them into one component.
@ -4,2 +3,3 @@
[TURN][turn] and [STUN][stun] are used as a component in many calling systems. Matrix uses them directly for legacy calls and indirectly for MatrixRTC via Livekit.
Continuwuity recommends using [Coturn](https://github.com/coturn/coturn) as your TURN/STUN server, which is available as a Docker image or a distro package.
Continuwuity recommends using [Coturn][coturn] as your TURN/STUN server, which is available as a Docker image or a distro package. This guide assumes that you are using docker compose for deployment.
Member

Inconsistent capitalisation of coturn.

Inconsistent capitalisation of coturn.
stratself marked this conversation as resolved
@ -7,3 +15,3 @@
## Installing Coturn
### Configuration
### 1. Domain
Member

These headings should be consistent with the LiveKit documentation.

These headings should be consistent with the LiveKit documentation.
stratself marked this conversation as resolved
@ -24,3 +35,3 @@
:::
#### Port Configuration
If you want to enable TURN-over-TLS (TURNS), add the appropriate cert/key paths to your `coturn.conf` by adding the following lines:
Member

"cert/key" -> "certificate and key"

"cert/key" -> "certificate and key"
stratself marked this conversation as resolved
@ -27,0 +41,4 @@
pkey=/etc/letsencrypt/coturn.example.com.key
```
The cert and key must be encoded in PEM format and are readable by the coturn user.
Member

"and be readable" although I'd honestly prefer "and the coturn user must be able to read them."

"and be readable" although I'd honestly prefer "and the coturn user must be able to read them."
stratself marked this conversation as resolved
@ -27,0 +43,4 @@
The cert and key must be encoded in PEM format and are readable by the coturn user.
Check out the [`turnserver.conf`][turnserver-conf] example for all coturn options.
Member

This is phrased rather directly for a reminder. "Make sure you [...]" would be friendlier

This is phrased rather directly for a reminder. "Make sure you [...]" would be friendlier
Author
Member

This is not a reminder, but linking to a reference

This is not a reminder, but linking to a reference
stratself marked this conversation as resolved
@ -27,0 +49,4 @@
### 3. Running the coturn container
Next, we will start the Coturn container with the [official image][coturn-image]. **Host networking mode** will be used, as it is better for performance and reduces configuration complexity (see [Coturn Docker docs][coturn-docker-docs] for rationale).
Member

Good citation, but:

Host networking mode is used here for better performance and reduced configuration complexity (see the [Coturn Docker docs][coturn-docker-docs] for rationale).
Good citation, but: ``` Host networking mode is used here for better performance and reduced configuration complexity (see the [Coturn Docker docs][coturn-docker-docs] for rationale). ```
stratself marked this conversation as resolved
@ -27,0 +57,4 @@
Create a `docker-compose.yml` file as follows and run `docker compose up -d`:
```yaml
version: '3'
Member

The version key of the compose format is obsolete.

The version key of the compose format is obsolete.
stratself marked this conversation as resolved
@ -31,3 +78,3 @@
- `49152-65535` (UDP): Media relay ports
If you're also running LiveKit, you'll need to avoid port conflicts. Configure non-overlapping port ranges:
You will need to allow them through your firewall. If you use UFW, the commands are:
Member

The other guide does not presume a specific firewall. I do not see why this guide should either. If it were up to me, I wouldn't mention this at all, but if it's going to be there, this is too much.

The other guide does not presume a specific firewall. I do not see why this guide should either. If it were up to me, I wouldn't mention this at all, but if it's going to be there, this is too much.
Author
Member
It does - https://continuwuity.org/calls/livekit#firewall-hints
stratself marked this conversation as resolved
@ -34,0 +87,4 @@
ufw allow 49152-65535/udp
```
::: tip For LiveKit users
Member

This tip appears improperly formatted compared to the tip earlier in the file.

This tip appears improperly formatted compared to the tip earlier in the file.
stratself marked this conversation as resolved
@ -39,2 +98,4 @@
```
```bash
# With ufw
Member

Again, this should be removed.

Again, this should be removed.
stratself marked this conversation as resolved
@ -74,2 +109,3 @@
### 5. Security Recommendations
For security best practices, see Synapse's [Coturn documentation](https://element-hq.github.io/synapse/latest/turn-howto.html), which includes important firewall and access control recommendations.
For Coturn hardening and security best practices, see Synapse's [Coturn documentation][synapse-coturn-guide],
Member

This is the first place where hard wrapping has been used.

This is the first place where hard wrapping has been used.
stratself marked this conversation as resolved
@ -146,3 +143,3 @@
### Testing Credentials
Verify that Continuwuity is correctly serving TURN credentials to clients:
Get 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).
Member

According to @nex's own site, this should not be used. It does link to https://starstruck.systems/matrix/tools/mxtoken2 though, which may be a suitable alternative.

According to @nex's own site, this should not be used. It does link to https://starstruck.systems/matrix/tools/mxtoken2 though, which may be a suitable alternative.
stratself marked this conversation as resolved
@ -182,1 +173,3 @@
4. Look for successful `relay` candidates in the results
1. Copy the URIs and credentials from the response above
2. Paste them into the Trickle ICE testing tool, and click on "Add server"
3. When finished adding all URIs and credentials, click "Gather candidates"
Member

This should read "Once all the URIs and credentials have been added,"

This should read "Once all the URIs and credentials have been added,"
stratself marked this conversation as resolved
@ -186,3 +181,3 @@
## Troubleshooting
### Clients can't connect to TURN server
To gather debug logs while troubleshooting Coturn, add `verbose` to your `coturn.conf`. You can then view these logs with `docker-compose logs --follow coturn`.
Member

docker compose

`docker compose`
stratself marked this conversation as resolved
@ -196,0 +192,4 @@
- Ensure your `turn_secret` matches coturn's `static-auth-secret`
- Ensure the credentials you obtained from the Testing steps has not expired yet. You can adjust `turn_ttl` in your Continuwuity configuration to increase this, or simply re-request a new one
- Wrong IP address advertised
- This may be caused by coturn not recognizing its public-facing IP correctly, due to particular network setups. You can configure `external-ip=<desired-public-ip>` to fix this issue.
Member

"due to particular network setups" is broadly unhelpful

"due to particular network setups" is broadly unhelpful
stratself marked this conversation as resolved
@ -215,0 +225,4 @@
### TURNS-over-443
Normally, TURN would work on their default setups. However, there are situations where clients are in very restrictive networks that disallows non-standard ports and UDP. In these cases, a TURN-over-TLS server on port :443 could be employed to relay traffic for them.
Member

Mirrored feedback here from the other document. Also, given that these seem to touch on a very similar topic, they should probably both live in a single section in a single document.

Mirrored feedback here from the other document. Also, given that these seem to touch on a very similar topic, they should probably both live in a single section in a single document.
stratself marked this conversation as resolved
@ -29,19 +29,12 @@ we can't cross-build static binaries - contributions are welcome here.
Member

The changes in this file are not TURN related.

The changes in this file are not TURN related.
stratself marked this conversation as resolved
Sign in to join this conversation.
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity!1740
No description provided.