Jitsi-meet
Jitsi 是一组开源项目,可让您轻松构建和部署安全的视频会议解决方案。Jitsi 的核心是 Jitsi Videobridge 和 Jitsi Meet,它们让您可以在互联网上进行会议,而来自社区的其他项目则实现了音频、拨入、录制和同步广播等其他功能。
安装
Jitsi-meet 由几个组件组成
jitsi-meet:用于 web 界面的文件,通过 web 服务器提供的文件访问jitsi-meet-prosody:用于 jitsi 的 prosody 插件jitsi-meet-turnserver:运行 stun/turn 服务器的配置示例jitsi-videobridge:视频桥接服务,为所有参与者提供视频流jicofo:Jitsi 会议焦点,确定谁在发言- Prosody:一个免费的 XMPP 服务器,作为设置的基础
用户界面以及彼此之间的图形概述在上游给出 upstream。
您可以选择使用 git 版本、nightly 版本或 stable 版本。
可以同时安装它们,但是您需要使用单独的端口和 prosody 的多个实例(插件不能按虚拟主机划分范围)。
您需要在 normal 版本或 bin 版本之间进行选择。bin 版本与 normal 版本冲突(即 nightly 和 nightly-bin 不能同时安装,但 stable 和 nightly 可以)。
尽量只坚持使用其中一个
您需要这些可选软件包才能运行独立的服务器
配置
如果您的服务器名称是 example.com,那么您的 jitsi 的常见选择将是 meet.example.com,但您可以自由选择。但是,从安全角度来看,强烈建议将 webapps 托管在它们自己的子域上。您将需要使用您选择的子域的条目更新服务器的 DNS 记录,在上面的示例中为 meet。其余部分假设您已完成此操作。
此外,您应该为您的 meet.example.com 域拥有 SSL/TLS 证书,有关如何获取免费证书,请参阅 certbot。
在下文中,使用以下占位符
JITSIFQDN:您的jitsi-meet域名,例如meet.example.comSECRET_JVB_USER:videobridge 的密码SECRET_FOCUS_USER:身份验证器的密码
密码应以安全的方式获取,例如通过 mktemp -u XXXXXXXX 或通过 pwgen。确保使用不同且安全的密码!
配置文件路径
| 软件包 | 配置文件路径 |
|---|---|
| Stable | |
| jitsi-meetAUR jitsi-meet-binAUR |
/etc/webapps/jitsi-meet
|
| jitsi-meet-prosodyAUR jitsi-meet-prosody-binAUR |
/usr/lib/jitsi-meet-prosody
|
| jitsi-meet-turnserverAUR jitsi-meet-turnserver-binAUR |
/usr/share/doc/jitsi-meet-turnserver
|
| jicofoAUR jicofo-binAUR |
/etc/jicofo
|
| jitsi-videobridgeAUR jitsi-videobridge-binAUR |
/etc/jitsi-videobridge
|
| Nightly | |
| jitsi-meet-nightlyAUR jitsi-meet-nightly-binAUR |
/etc/webapps/jitsi-meet-nightly
|
| jitsi-meet-prosody-nightlyAUR jitsi-meet-prosody-nightly-binAUR |
/usr/lib/jitsi-meet-prosody-nightly
|
| jitsi-meet-turnserver-nightlyAUR jitsi-meet-turnserver-nightly-binAUR |
/usr/share/doc/jitsi-meet-turnserver-nightly
|
| jicofo-nightlyAUR jicofo-nightly-binAUR |
/etc/jicofo-nightly
|
| jitsi-videobridge-nightlyAUR jitsi-videobridge-nightly-binAUR |
/etc/jitsi-videobridge-nightly
|
| Git | |
| jitsi-meet-gitAUR | /etc/webapps/jitsi-meet-git
|
| jitsi-meet-prosody-gitAUR | /usr/lib/jitsi-meet-prosody-git
|
| jitsi-meet-turnserver-gitAUR | /usr/share/doc/jitsi-meet-turnserver-git
|
| jicofo-gitAUR | /etc/jicofo-git
|
| jitsi-videobridge-gitAUR | /etc/jitsi-videobridge-git
|
环回
让 jitsi-meet 组件通过本地 IP 相互访问。即使您的域位于像 Cloudflare 这样的代理之后,并且不返回服务器的真实 IP,它也能工作。
在 /etc/hosts 中
127.0.0.1 JITSIFQDN auth.JITSIFQDN ::1 JITSIFQDN auth.JITSIFQDN
配置 Prosody
prosody 是先决条件,您需要为其 Jitsi 服务添加配置。如果您尚未设置 prosody 服务器,请立即安装 prosody 和 lua52-sec。prosody 配置的其余部分假定您已本地安装 prosody。
软件包 jitsi-meet-prosodyAUR 提供了一个您可以轻松自定义的配置
# cd /etc/prosody # mkdir conf.d # cp /usr/share/doc/jitsi-meet-prosody/prosody.cfg.lua-jvb.example conf.d/jitsi.cfg.lua
然后将其添加到末尾
/etc/prosody/prosody.cfg.lua
Include "conf.d/*.cfg.lua"
自定义您的配置
/etc/prosody/conf.d/jitsi.cfg.lua
-- replace all occurences of jitmeet.example.com by JITSIFQDN
-- replace all occurences of focusUser by focus
-- then add or update those section
VirtualHost "JITSIFQDN"
ssl = {
key = "/etc/prosody/certs/JITSIFQDN.key";
certificate = "/etc/prosody/certs/JITSIFQDN.crt";
}
VirtualHost "auth.JITSIFQDN"
ssl = {
key = "/etc/prosody/certs/auth.JITSIFQDN.key";
certificate = "/etc/prosody/certs/auth.JITSIFQDN.crt";
}
authentication = "internal_hashed"
/etc/prosody/conf.d/jitsi.cfg.lua
-- Proxy to jicofo's user JID, so that it does not have to register as a component.
Component "focus.JITSIFQDN" "client_proxy"
target_address = "focus@auth.JITSIFQDN"
您现在需要为 JITSIFQDN 和 auth.JITSIFQDN 生成证书。
如果您使用 certbot,您可以使用以下命令导入证书
# prosodyctl --root cert import /etc/letsencrypt/live
如果您想使用自生成证书,您可以使用
[prosody]$ prosodyctl cert generate JITSIFQDN
[prosody]$ prosodyctl cert generate auth.JITSIFQDN
# mv /var/lib/prosody/*.{crt,cnf,key} /etc/prosody/certs/
# trust anchor /etc/prosody/certs/JITSIFQDN.crt
# trust anchor /etc/prosody/certs/auth.JITSIFQDN.crt
# update-ca-trust
让我们注册用户 jvb 和 focus
# prosodyctl register jvb auth.JITSIFQDN SECRET_JVB_USER # prosodyctl register focus auth.JITSIFQDN SECRET_FOCUS_USER # prosodyctl mod_roster_command subscribe focus.JITSIFQDN focus@auth.JITSIFQDN
然后 重启 prosody.service(或者如果刚刚安装,则 启动/启用 它)。
配置 jitsi-videobridge
jitsi-videobridge 的配置。对于 nightly 和 git 版本,将 -nightly 或 -git 添加到 /etc/jitsi-videobridge。
对于 MUC_NICKNAME,使用 uuidgen 命令
/etc/jitsi-videobridge/sip-communicator.properties
org.jitsi.videobridge.xmpp.user.shard.DOMAIN=auth.JITSIFQDN org.jitsi.videobridge.xmpp.user.shard.PASSWORD=SECRET_JVB_USER org.jitsi.videobridge.xmpp.user.shard.MUC_JIDS=JvbBrewery@internal.auth.JITSIFQDN org.jitsi.videobridge.xmpp.user.shard.MUC_NICKNAME=UUIDGEN_RESULT
然后 启动/启用 jitsi-videobridge.service。
配置 jicofo
jicofo 的配置。对于 nightly 和 git 版本,将 -nightly 或 -git 添加到 /etc/jitsi-videobridge。
/etc/jicofo/jicofo.conf
jicofo {
xmpp: {
client: {
client-proxy: "focus.JITSIFQDN"
xmpp-domain: "JITSIFQDN"
domain: "auth.JITSIFQDN"
username: "focus"
password: "SECRET_FOCUS_USER"
conference-muc-jid = conference.JITSIFQDN
}
trusted-domains: [ "recorder.JITSIFQDN" ]
}
bridge: {
brewery-jid: "JvbBrewery@internal.auth.JITSIFQDN"
}
}
然后 启动/启用 jicofo.service。
配置 jitsi-meet
jitsi-meet webapps 的配置。对于 nightly 和 git 版本,将 -nightly 或 -git 添加到 /etc/jitsi-videobridge。
/etc/webapps/jitsi-meet/config.js
var config = {
hosts: {
domain: 'JITSIFQDN',
// ...
muc: 'conference.JITSIFQDN'
},
bosh: '//JITSIFQDN/http-bind',
// ...
}
配置 Nginx
按照 nginx#TLS 中的描述配置带有 TLS 的 nginx。
让我们复制提供的示例。
# cd /etc/nginx # mkdir sites # cp /usr/share/doc/jitsi-meet/jitsi-meet.example sites/jitsi.conf
然后将其包含在您的主配置中
/etc/nginx/nginx.conf
http {
// ...
// this should be placed near to the close bracket of the http block
include sites/*.conf;
}
然后使用您的配置更改 jitsi 配置
/etc/nginx/sites/jitsi.conf
server {
# ...
server_name JITSIFQDN;
# ...
# use prosody path directly
ssl_certificate /etc/prosody/certs/JITSIFQDN.crt;
ssl_certificate_key /etc/prosody/certs/JITSIFQDN.key;
# or use letencrypt path
ssl_certificate /etc/letsencrypt/live/JITSIFQDN/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/JITSIFQDN/privkey.pem;
# set the config path
# replace alias /etc/jitsi/meet/jitmeet.example.com-config.js by
location = /config.js {
alias /etc/webapps/jitsi-meet/config.js;
}
# ...
location ~ ^/([^/?&:'"]+)/config.js$
{
set $subdomain "$1.";
set $subdir "$1/";
alias /etc/webapps/jitsi-meet/config.js;
}
}
然后 重启 nginx.service。
技巧与诀窍
在 NAT 后运行服务器
以下端口需要转发到您的服务器
HTTPS
- TCP/443
Jitsi Videobridge
- UDP/10000
Jitsi 网关到 SIP (Jigasi)
要将 Jitsi-meet 会议与传统 SIP 接口连接,请安装 jigasiAUR 或 jigasi-gitAUR 并编辑 prosody 配置
/etc/prosody/prosody.cfg.lua
Component "callcontrol.JITSIFQDN"
component_secret = "SECRET_JIGASI_USER"
填写 SIP 访问凭据 (SIPUSER SIPSERVER 和 SIPPASSWORD)
/opt/jigasi/jigasi-home/sip-communicator.properties
net.java.sip.communicator.impl.protocol.sip.acc1403273890647.ACCOUNT_UID=SIP\:"SIPUSER@SIPSERVER" net.java.sip.communicator.impl.protocol.sip.acc1403273890647.PASSWORD=SIPPASSWORD net.java.sip.communicator.impl.protocol.sip.acc1403273890647.SERVER_ADDRESS=SIPSERVER net.java.sip.communicator.impl.protocol.sip.acc1403273890647.USER_ID=SIPUSER
要更改 SIP 连接到的默认房间名称,请更改上述配置中的 org.jitsi.jigasi.DEFAULT_JVB_ROOM_NAME。
然后编辑 jigasi 配置
/etc/jitsi/jigasi/config
JIGASI_HOST=callcontrol.JITSIFQDN JIGASI_HOSTNAME=jitsi-videobridge.JITSIFQDN JIGASI_SECRET=SECRET_JIGASI_USER JIGASI_OPTS="" LOGFILE=/var/log/jitsi/jigasi.log
/opt/jitsi-meet/config.js
hosts.call_control = 'callcontrol.meet.jit.si'
然后 启动/启用 jigasi.service。
房间创建的访问限制
要将视频会议房间创建限制为经过身份验证的用户,您可以执行以下步骤。请注意,会议参与者仍然未经身份验证!
在 prosody 中为 jitsi 域添加身份验证,并为访客添加新的虚拟主机
/etc/prosody/conf.d/jitsi.cfg.lua
-- change authentification of your domain
VirtualHost "JITSIFQDN"
authentification = "internal_plain"
-- add guest virtual host to allow anonymous user to join your room
VirtualHost "guest.JITSIFQDN"
authentication = "jitsi-anonymous"
c2s_require_encryption = false
modules_enabled = {
-- copy the content of the modules_enabled
-- of the VirtualHost "JITSIFQDN"
-- remove only the module "muc_lobby_rooms" of the list
-- example:
"bosh";
"pubsub";
"ping"; -- Enable mod_ping
"speakerstats";
"external_services";
"conference_duration";
}
编辑 jitsi-meet 的配置文件
/etc/webapps/jitsi-meet/config.js
var config = {
host: {
// anonymous users need to use a dedicated muc without authentication
anonymousdomain: 'guest.JITSIFQDN',
},
}
为 jicofo 添加身份验证
/etc/jicofo/jicofo.conf
jicofo {
authentication {
enabled = true
type = XMPP
login-url = JITSIFQDN
enable-auto-login = true
}
}
然后通过以下命令创建所需的用户
# prosodyctl register <username> JITSIFQDN <password>
仅当您使用 jigasi 时(如果您不知道,则表示您没有使用),请编辑 SIP 接口以不允许匿名身份验证
/etc/jitsi/jigasi/sip-communicator.properties
org.jitsi.jigasi.xmpp.acc.ANONYMOUS_AUTH=false
这些步骤取自 本指南。
使用 JWT 令牌的访问限制
要将视频会议房间创建限制为使用 JWT 令牌(用于身份验证的外部服务)进行身份验证的用户,您可以执行以下步骤。请注意,会议参与者仍然未经身份验证!
安装这些依赖项
在 prosody 中为 jitsi 域添加身份验证,并为访客添加新的虚拟主机
/etc/prosody/conf.d/jitsi.cfg.lua
-- change authentification of your domain
VirtualHost "JITSIFQDN"
authentification = "token"
app_id = "APP_ID"
app_secret = "APP_SECRET"
allow_empty_token = false
modules_enabled = {
-- keep existing modules and add
"presence_identity";
}
c2s_require_encryption = false
-- add guest virtual host to allow anonymous user to join your room
VirtualHost "guest.JITSIFQDN"
authentication = "jitsi-anonymous"
c2s_require_encryption = false
modules_enabled = {
-- copy the content of the modules_enabled
-- of the VirtualHost "JITSIFQDN"
-- remove only the module "muc_lobby_rooms" of the list
-- example:
"bosh";
"pubsub";
"ping"; -- Enable mod_ping
"speakerstats";
"external_services";
"conference_duration";
"presence_identity";
}
Component "conference.JITSIFQDN" "muc"
modules_enabled = {
-- add this to the modules_enabled
"token_verification";
}
编辑 jitsi-meet 的配置文件
/etc/webapps/jitsi-meet/config.js
var config = {
host: {
// anonymous users need to use a dedicated muc without authentication
anonymousdomain: 'guest.JITSIFQDN',
},
}
为 jicofo 添加身份验证
/etc/jicofo/jicofo.conf
jicofo {
authentication {
enabled = true
type = JWT
login-url = JITSIFQDN
enable-auto-login = true
}
}
然后 重启 prosody.service(或者如果刚刚安装,则 启动/启用 它)。并 重启 jicofo.service(或者如果刚刚安装,则 启动/启用 它)。
现在您可以使用 JWT 令牌来验证用户身份。
您可以在此处阅读规范:Jitsi Meet 令牌
这是一个 nodejs 中的快速示例
const jwt = require('jsonwebtoken')
const crypto = require('crypto');
const words = require('random-words')
const yourDomain = "JITSIFQDN"
const appId = "APP_ID"
const appSecret = "APP_SECRET"
const userName = "YOUR_USERNAME"
const userEmail = "YOUR_EMAIL"
function getBody(domain, appId, name, email, room) {
const md5Email = crypto.createHash('md5').update(email).digest("hex");
const id = crypto.createHash('sha1').update(`${name}:${email}`).digest("hex")
return {
context: {
user: {
avatar: `https:/gravatar.com/avatar/${md5Email}`,
name,
email,
id,
},
group: 'users'
},
"aud": "jitsi",
"iss": appId,
"sub": domain,
room,
}
}
const room = process.argv[2] || words({exactly: 3, join: '-'})
const data = getBody(
yourDomain,
appId,
userName,
userEmail,
room,
)
const options = {
algorithm: 'HS256',
expiresIn: '2h',
}
const jwtToken = jwt.sign(data, appSecret, options)
console.log(`https://${yourDomain}/${room}?jwt=${jwtToken}`)
日志评估
对于公开可用的 IP 地址,上述配置会导致公共视频会议服务器。要监控服务器使用情况,可以使用 journalctl 来大致了解使用情况
# journalctl --unit=jicofo.service --grep="created new conference" --output cat
显示所有新聊天室创建事件,以及
# journalctl --unit=jicofo.service --grep="Stopped" --output cat
显示所有聊天室销毁事件。
Grepping 'member' 还可以为您提供有关参与者的(匿名!)信息。
运行自己的 STUN 服务器
默认情况下,Jitsi Meet 使用来自 jitsi.org 的 STUN 服务器。您可以使用 coturn 轻松运行自己的 STUN 服务器,并在 jitsi-meet 的配置中进行设置。
故障排除
检查您的日志
您可以 停止 所有服务单元(即,prosody.service、jitsi-videobridge.service 和 jicofo.service),启动 它们一次一个,并关注每个服务单元的 日志 中的新消息,以查看是否有问题。大多数问题是由于密码或配置问题引起的。
如果您从非常不同的版本升级,或者您搞砸了您的配置,请重新开始。这比试图找出哪个部分出错要快。
在 Matrix 房间寻求帮助
您可以加入 matrix 房间并在那里寻求帮助