Closed ned64 closed 1 week ago
PC 2: Block everything outgoing to my server IP except 80,443 then start Firefox 2, join
How are you blocking it? Are you able from the turn3.example.org machine access UDP port 10000 on video3.example.org? If that is the same machine, are you able from that machine send and receive udp packets to the public IP address of the bridge?
Also, make sure that you have valid certificates for turn3.example.org.
Thanks for the fast response. On PC2 I block like this (copied from commandline history, IP address anonymised):
998 19:23 iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
999 19:23 iptables -A INPUT -m conntrack --ctstate INVALID -j DROP
1000 19:23 iptables -A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
1001 19:23 iptables -A OUTPUT -d 1.2.3.4 -p tcp ! --dport 443 -j DROP
1002 19:24 iptables -A OUTPUT -d 1.2.3.4 -p udp ! --dport 443 -j DROP
1003 19:24 ip6tables -A OUTPUT -d 1:2:3:4::0 -j DROP
The turn3 server cert was indeed not renewed automatically because my port 80 listening section in nginx (copied from the documentation) re-directs 301 to ssl. Will need to check and fix this.
Which is this PC2 where everything is running or the client PC where you access the deployment?
The Jitsi Meet Server is in a data centre and has a fixed IP address. The PC1, PC2 and Android clients are separate machines elsewhere. I blocked the non-{80,443}-ports locally on PC2 only which means that one is the test machine with only {80,443}.
I have changed nginx config files to pass .well-known for turn3 and then renewed coturn's certificates.
Here is coturn
s config. The certificate is accepted by coturn. journalctl -u coturn
has now stopped showing TLS errors.
### /etc/turnserver.conf
# jitsi-meet coturn config. Do not modify this line
use-auth-secret
keep-address-family
static-auth-secret=XXXXXXXXXY
realm=video3.example.org
cert=/etc/pki/coturn/turn3-server-chain.crt
pkey=/etc/pki/coturn/private/turn3-server.key
no-multicast-peers
no-cli
no-loopback-peers
no-tcp-relay
no-tcp
# listening-port=3478
listening-port=5348
#the following option is ignored, tls port is previous port + 1
tls-listening-port=5349
no-tlsv1
no-tlsv1_1
# https://ssl-config.mozilla.org/#server=haproxy&version=2.1&config=intermediate&openssl=1.1.0g&guideline=5.4
cipher-list=ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
# jitsi-meet coturn relay disable config. Do not modify this line
denied-peer-ip=0.0.0.0-0.255.255.255
denied-peer-ip=10.0.0.0-10.255.255.255
denied-peer-ip=100.64.0.0-100.127.255.255
denied-peer-ip=127.0.0.0-127.255.255.255
denied-peer-ip=169.254.0.0-169.254.255.255
denied-peer-ip=127.0.0.0-127.255.255.255
denied-peer-ip=172.16.0.0-172.31.255.255
denied-peer-ip=192.0.0.0-192.0.0.255
denied-peer-ip=192.0.2.0-192.0.2.255
denied-peer-ip=192.88.99.0-192.88.99.255
denied-peer-ip=192.168.0.0-192.168.255.255
denied-peer-ip=198.18.0.0-198.19.255.255
denied-peer-ip=198.51.100.0-198.51.100.255
denied-peer-ip=203.0.113.0-203.0.113.255
denied-peer-ip=240.0.0.0-255.255.255.255
denied-peer-ip=::1
denied-peer-ip=64:ff9b::-64:ff9b::ffff:ffff
denied-peer-ip=::ffff:0.0.0.0-::ffff:255.255.255.255
denied-peer-ip=100::-100::ffff:ffff:ffff:ffff
denied-peer-ip=2001::-2001:1ff:ffff:ffff:ffff:ffff:ffff:ffff
denied-peer-ip=2002::-2002:ffff:ffff:ffff:ffff:ffff:ffff:ffff
denied-peer-ip=fc00::-fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
denied-peer-ip=fe80::-febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff
syslog
Is the realm correctly set in coturn
? video3...
not turn3...
?
The problem persists, though. I have a few errors on offer from logs, like these ones from /var/log/nginx/error.log
:
2024/11/13 00:03:08 [error] 14463#14463: *731 connect() failed (111: Connection refused) while connecting to upstream, client: 20:30:40:50::2, server: [::]:443, upstream: "1.2.3.4:5349", bytes from/to client:0/0, bytes from/to upstream:0/0
(...)
2024/11/13 00:12:03 [error] 14463#14463: *958 recv() failed (104: Connection reset by peer) while proxying and reading from upstream, client: 20:30:40:50::2, server: [::]:443, upstream: "1.2.3.4:5349", bytes from/to client:609/4210, bytes from/to upstream:4210/1288
This (20:30:etc) is the IPv6 address of the Firefox 1 on PC1 (which also has trouble with media but it is not connected with mic/cam).
# ss -tulpan | grep 5349 (interesting lines only)
udp UNCONN 0 0 1.2.3.4:5349 0.0.0.0:* users:(("turnserver",pid=14780,fd=30))
udp UNCONN 0 0 1.2.3.4:5349 0.0.0.0:* users:(("turnserver",pid=14780,fd=29))
udp UNCONN 0 0 1.2.3.4:5349 0.0.0.0:* users:(("turnserver",pid=14780,fd=28))
udp UNCONN 0 0 1.2.3.4:5349 0.0.0.0:* users:(("turnserver",pid=14780,fd=27))
(...)
tcp LISTEN 0 1024 1.2.3.4:5349 0.0.0.0:* users:(("turnserver",pid=14780,fd=83))
tcp LISTEN 0 1024 127.0.0.1:5349 0.0.0.0:* users:(("turnserver",pid=14780,fd=75))
tcp LISTEN 0 1024 [::1]:5349 [::]:* users:(("turnserver",pid=14780,fd=71))
tcp LISTEN 0 1024 1:2:3:4::0:5349 [::]:* users:(("turnserver",pid=14780,fd=91))
So coturn
is listening on all interfaces and IPv* addresses. Why the upstream error to coturn?
Is the realm correctly set in
coturn
?video3...
notturn3...
?
yes. That should be the meet deployment main virtual host. https://github.com/jitsi/jitsi-meet/blob/86d1bd3c7804aa894ecf111a0ae68143fe227281/doc/debian/jitsi-meet-turn/turnserver.conf#L5
{ type = "turns", host = "video3.example.org", port = "443", transport = "tcp" }
Your prosody config is wrong, that should be turn3.example.org.
Whoa, that did it! Here are the corrected config files for prosperity (future me perhaps).
### /etc/turnserver.conf
# jitsi-meet coturn config. Do not modify this line
use-auth-secret
keep-address-family
static-auth-secret=XXXXXXXXXY
realm=video3.example.org
cert=/etc/pki/coturn/turn3-server-chain.crt
pkey=/etc/pki/coturn/private/turn3-server.key
no-multicast-peers
no-cli
no-loopback-peers
no-tcp-relay
no-tcp
# listening-port=3478
listening-port=5348
#the following option is ignored, tls port is previous port + 1
tls-listening-port=5349
no-tlsv1
no-tlsv1_1
# https://ssl-config.mozilla.org/#server=haproxy&version=2.1&config=intermediate&openssl=1.1.0g&guideline=5.4
cipher-list=ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
# jitsi-meet coturn relay disable config. Do not modify this line
denied-peer-ip=0.0.0.0-0.255.255.255
denied-peer-ip=10.0.0.0-10.255.255.255
denied-peer-ip=100.64.0.0-100.127.255.255
denied-peer-ip=127.0.0.0-127.255.255.255
denied-peer-ip=169.254.0.0-169.254.255.255
denied-peer-ip=127.0.0.0-127.255.255.255
denied-peer-ip=172.16.0.0-172.31.255.255
denied-peer-ip=192.0.0.0-192.0.0.255
denied-peer-ip=192.0.2.0-192.0.2.255
denied-peer-ip=192.88.99.0-192.88.99.255
denied-peer-ip=192.168.0.0-192.168.255.255
denied-peer-ip=198.18.0.0-198.19.255.255
denied-peer-ip=198.51.100.0-198.51.100.255
denied-peer-ip=203.0.113.0-203.0.113.255
denied-peer-ip=240.0.0.0-255.255.255.255
denied-peer-ip=::1
denied-peer-ip=64:ff9b::-64:ff9b::ffff:ffff
denied-peer-ip=::ffff:0.0.0.0-::ffff:255.255.255.255
denied-peer-ip=100::-100::ffff:ffff:ffff:ffff
denied-peer-ip=2001::-2001:1ff:ffff:ffff:ffff:ffff:ffff:ffff
denied-peer-ip=2002::-2002:ffff:ffff:ffff:ffff:ffff:ffff:ffff
denied-peer-ip=fc00::-fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
denied-peer-ip=fe80::-febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff
syslog
Nginx main config - not much, most in the other two files:
/etc/nginx/nginx.conf
#user www-data;
user nginx;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65s;
types_hash_max_size 4096;
server_tokens off;
server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
types {
# add support for wasm MIME type, that is required by specification and it is not part of default mime.types file
application/wasm wasm;
}
default_type application/octet-stream;
charset utf-8;
# Settings for the non-TLS server.
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _; # match all
root /srv/nginx/video3.example.org;
# ensure .well-known content is available without redirect (for getssl)
location ~ ^/.well-known/(.*)$
{
add_header 'Access-Control-Allow-Origin' '*';
alias /srv/nginx/video3.example.org/$1/$2;
}
# force TLS/https
return 301 https://$host$request_uri;
} # end server port 80
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
Nginx my web site/jm welcome server:
### /etc/nginx/sites-enabled/video3.example.org
server {
listen 80;
listen [::]:80;
server_name video3.example.org turn3.example.org;
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
root /srv/nginx/video3.example.org;
}
location = /.well-known/acme-challenge/ {
return 404;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 444 ssl;
listen [::]:444 ssl;
server_name video3.example.org;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA256:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EDH+aRSA+AESGCM:EDH+aRSA+SHA256:EDH+aRSA:EECDH:!aNULL:!eNULL:!MEDIUM:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED";
add_header Strict-Transport-Security "max-age=31536000";
ssl_certificate /etc/pki/nginx/video3-server-chain.crt;
ssl_certificate_key /etc/pki/nginx/private/video3-server.key;
root /usr/share/jitsi-meet;
# ssi on with javascript for multidomain variables in config.js
ssi on;
ssi_types application/x-javascript application/javascript;
index index.html index.htm;
error_page 404 /static/404.html;
gzip on;
gzip_types text/plain text/css application/javascript application/json image/x-icon application/octet-stream application/wasm;
gzip_vary on;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 512;
location = /config.js {
alias /etc/jitsi/meet/video3.example.org-config.js;
}
# is this used???
location = interface_config.js {
alias /etc/jitsi/meet/video3.example.org-interface_config.js;
}
location = /external_api.js {
alias /usr/share/jitsi-meet/libs/external_api.min.js;
}
#ensure all static content can always be found first
location ~ ^/(libs|css|static|images|fonts|lang|sounds|connection_optimization|.well-known)/(.*)$
{
add_header 'Access-Control-Allow-Origin' '*';
alias /usr/share/jitsi-meet/$1/$2;
# cache all versioned files
if ($arg_v) {
expires 1y;
}
}
# BOSH
location = /http-bind {
proxy_pass http://localhost:5280/http-bind;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
}
# xmpp websockets
location = /xmpp-websocket {
proxy_pass http://127.0.0.1:5280/xmpp-websocket?prefix=$prefix&$args;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
tcp_nodelay on;
}
# colibri (JVB) websockets for jvb1
location ~ ^/colibri-ws/default-id/(.*) {
proxy_pass http://127.0.0.1:9090/colibri-ws/default-id/$1$is_args$args;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
tcp_nodelay on;
}
location ~ ^/([^/?&:'"]+)$ {
try_files $uri @root_path;
}
location @root_path {
rewrite ^/(.*)$ / break;
}
location ~ ^/([^/?&:'"]+)/config.js$
{
set $subdomain "$1.";
set $subdir "$1/";
alias /etc/jitsi/meet/video3.example.org-config.js;
}
# BOSH for subdomains
location ~ ^/([^/?&:'"]+)/http-bind {
set $subdomain "$1.";
set $subdir "$1/";
set $prefix "$1";
rewrite ^/(.*)$ /http-bind;
}
# websockets for subdomains
location ~ ^/([^/?&:'"]+)/xmpp-websocket {
set $subdomain "$1.";
set $subdir "$1/";
set $prefix "$1";
rewrite ^/(.*)$ /xmpp-websocket;
}
#Anything that didn't match above, and isn't a real file, assume it's a room name and redirect to /
location ~ ^/([^/?&:'"]+)/(.*)$ {
set $subdomain "$1.";
set $subdir "$1/";
rewrite ^/([^/?&:'"]+)/(.*)$ /$2;
}
}
Nginx coturn multiplex for turnserver (split traffic to jm webserver and UDP streaming for firewalled guests):
/etc/nginx/modules-enabled/coturn-multiplex.conf
stream {
map $ssl_preread_server_name $name {
video3.example.org web_backend;
turn3.example.org turn_backend;
}
upstream web_backend {
server 127.0.0.1:444;
}
upstream turn_backend {
server 1.2.3.4:5349;
### server 1.2.3.4:5348;
### server 127.0.0.1:5348;
### server 127.0.0.1:5349;
}
server {
listen 443;
listen [::]:443;
# since 1.11.5
ssl_preread on;
proxy_pass $name;
# Increase buffer to serve video
proxy_buffer_size 20m;
}
}
Please, when you have questions or problems use the community forum before opening new issues, thank you.
OK, I apologise! Thanks again for the help!
What happened?
I have been trying to get a JM server to run so that clients can connect which are behind a firewall blocking everything except ports 80 and 443.
I have set up DNS so that
video3.example.org
andturn3.example.org
both point to my only IPv4 address.I have used https://jitsi.github.io/handbook/docs/devops-guide/turn/ to set up the system. nginx runs as a reverse proxy for both Jitsi Videe Bridge and the Web server, config files below.
Testing: PC 1, Firefox 1: log in and start session PC 1, Chromium: join, stream music and share window Smartphone, Jitsi Meet Android: join. It receieves the music and shows Chromium's screen :-) PC 2: Block everything outgoing to my server IP except 80,443 then start Firefox 2, join
Problem: PC 2 cannot send or receive audio or video, everyone looks muted.
Coturn:
Prodosy:
I enabled bosh here because of nginx/error_log entries complaining about non-existing upstream to port 5280.
Included is the file /etc/prosody/conf.d/video3.example.org which you can see here:
Platform
Browser / app / sdk version
All current, Chromium 130, Firefox 131.
Relevant log output
No response
Reproducibility
More details?
No response