-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Builtin TURN Service #1398
base: master
Are you sure you want to change the base?
Builtin TURN Service #1398
Conversation
because openssl and co are statically shipped with eturnal binary
For the debian packages we use by default coturn. I'm not sure we want to have a different one for the docker, but let's also hear @saghul voice here. |
Thanks for your answer.
This could easily adopted by uncommenting this line. This defaults to the list here: I could adapt the PR accordingly. |
This is exactly the list we use for coturn. But you need to test it, as your current configuration maybe expecting to communicate with the bridge over the internal network. Also, you only enable udp turn, which doesn't make much sense as if you have already udp connectivity you will be using the bridge anyway. The point of having the turnserver is to have the TCP connection so you can fallback to it for networks with restricted udp usage. But for the TLS connection, you need valid certificates as you mentioned above. |
thanks for your feedback.
yes, you are right, this needs to be tested. Thats why I did not put it as default immediately. Even with enabling the
yes, of course, therefore there is the Dropping the UDP listener in the configuration was on the list as well for final cleanup. BTW: https://github.com/jitsi/jitsi-meet/blob/master/doc/debian/jitsi-meet-turn/turnserver.conf does also include UDP, right? ;) |
Yep, it does. It just disabled the clear TCP turn in favor of turns. |
cronjob to renew certs is not yet implemented.
Hey @sando38 ! Thanks for putting this PR together! Generally speaking, this setup is a close replica of the stuff we run in production and have experience with. We use coturn as our TURN server currently, so if we are to ship a builtin server, it ought to be that. Users that use this setup will inevitably run into issues and ask for help. We can only help them with what we know, and the reality is we don't know eturnal. This is the one and only reason why we cannot have this PR in its current shape. Would you be open to switching to coturn? If so, read on :-) For starters, the image should be based on either the official image, but it's likely better if we have one using our base image, so all images have a familiar setup. This is important. Next, since no browser sets ALPN properly for TURNS, we are left with using a separate domain and SNI. The straightforward path would be the Let's Encrypt case. Just request a separate domain, and send the connection over to the TURN container if it matches the TURN domain (for TURNS, so we can share the web port). I think the tricky part here might be having the LE certs in both the web and coturn containers, since we don't want to do TLS offloading in nginx, I think. If custom certs are used, we'd need them in both containers too. Generating self-signed certs would probably be a bad idea here. Sidenote:
Wouldn't enabling UDP on port 443 help, ever so slightly, on networks which block all ports other than 80/443, but not the specific protocol? |
including s6 overlay to docker image plus implementing the cronjob to update certs in eturnal turn server. eturnal reloads certificates without interrupting/closing existing sessions.
a2a1458
to
845e38b
Compare
hello @saghul thanks for your reply.
I am glad it generally matches your design. And I can follow your point with having coturn and keeping it due to your experiences. I did not yet use coturn, so I cannot help very much with that. However, since it was only a minor adjustment, I did update this PR to address your design considerations for a builtin TURN service:
Yes, we maintain eturnal TURN server solution on github. I adjusted the Dockerfile in this PR to also have an s6 overlay (also needed for the cronjob cert renewal), so it behaves very similar to your base image (debian-based, glibc, s6-overlay). I adjusted the eturnal
yes, exactly. This is the adjustment I made in the web image
see answer above and... I included an update mechanism into this PR which includes the LE certs into the eturnal container and reloads the service (see
this could be integrated the same way, as above.
that might help. In this case, the easiest way would be to map EDIT (2022-09-11): Included the UDP listener again. In general:
Some considerations for eturnal:
So, I invite you to test eturnal. We can also assist you herewith. In any other cases, feel free to use this PR as a basis for your builtin TURN service. It is good, that coturn is continued to be maintained again. I any cases, if I can help with any other this, just drop in. Cheers, sando |
and include libcap binaries and libraries into the docker image to enable linux capabilities.
Sorry I missed the last reply @sando38 . Thanks for making improvements! I'm afraid my original point still stands, we cannot offer a core container like a TURN server when we don't use it ourselves. I'm not sure this will change in the future, but it's not currently under consideration. You are welcome to maintain this image independently, I could add you to jitsi-contrib if you want to host it there even, and the handbook could mention how to use it. |
hola @saghul, no worries for the late reply.
Let me have a check next week regarding jitsi contributation, so I can see, what I potentially commit myself to ;) Sounds like a good option though. Wishing you a great day, |
hi @saghul, I think it is a good way to contribute the setup in the jitsi contributions. I just wanted to quickly double check some general considerations with you:
If we would like to offer it via port 443, we should think of a PR for the jitsi web container to include a solution similar to the files This way paired with e.g. an environment variable
With a value herewith, Please let me know what you think. Have a great day! |
Hi jitsi team,
here is a proposal/draft for a builtin TURN service. It can be build for linux/amd64 and linux/arm64.
The TURN service is based on eturnal.
I did not test all possible jitsi configurations, but I was able to establish a call while using the TURN service. More tests should be performed to ensure it works properly with different configurations.
Open items:
Currently eturnal does not have any (valid) TLS certificates included. As a workaround, they could be mounted of course into the container. It would be nicer, however, to use the LE acme.sh cronjob to also update the certs for eturnal.
EDIT (2022-09-07): Startup script now copys the certs generated by jitsi web, when mounted into the container, to use TLS. A renewal cronjob or similar is not yet implemented. So the setup works also with TURNS via port 443 now.
EDIT (2022-09-11): Renewal cronjob is implemented together with a s6-overlay init.
What one could also think about is to terminate SSL already at the (new) nginx layer4 load balancer for web as well, herewith eturnal would not need valid certs anymore. I am not sure however, if this would be a behaviour you desire.
...
To offer TURN (plain TCP) also via port 443 next to TLS, I am not sure if nginx could handle this. I know that traefik can do this. Here one could think if traefik would take over the layer4 load balancer role entirely and listens on port 443 instead of jitsi web (including LE cert management, at least for the TURN part).
...
currently they are basically hard-coded.
...
the stream template must be adjusted for that.
Let me know what you think.
Cheers, sando
P.S.
example logs from eturnal TURN service: