cimnine.jitsi_meet
jitsi_meet
一个用于安装 Jitsi Meet 的 Ansible 角色。
简介
这是一个 Ansible 角色,使用 nginx 作为 TLS 终止代理 (并可选使用 Let's Encrypt 证书,通过 certbot)在 Ubuntu Bionic (18.04) 上安装 Jitsi Meet。
要求
- 一个域名必须指向你的服务器以使用 Let's Encrypt
- 你的防火墙必须允许端口 80/tcp, 443/tcp, 4443/tcp, 10000/udp
- 如果你的服务器在 NAT 后面,请确保转发这些端口。
角色变量
apt_mirror
: 在 Ubuntu 上,必须启用 _universe_。此变量应指示你的系统镜像。默认值为http://archive.ubuntu.com/ubuntu
jitsi_domain
: Jitsi 将通过哪个域名访问。如果你打算使用 Let's Encrypt,必须是域名。否则可以是 IP 地址。默认值为{{ inventory_hostname }}
。certbot_enabled
: 是否安装 certbot 并为{{ jitsi_domain }}
请求证书。默认值为false
。certbot_admin_email
: 注册 Let's Encrypt 的电子邮件地址。如果certbot_enabled=true
,这是必需的。该邮件地址必须存在。没有默认值。jitsi_nat
: 你是否在 NAT 后面运行 _jitsi meet_。默认值为false
。如果启用,必须设置jitsi_nat_local_ip
和jitsi_nat_public_ip
。jitsi_nat_public_ip
: 你的 jitsi meet 主机的公共 IP 地址。默认值为 ipify 报告的 IPv4。jitsi_nat_private_ip
: 你的 jitsi meet 主机的私有 IP 地址。默认值为 Ansible 认为的主机默认 IPv4。nginx_server_names_hash_bucket_size
: nginx 的server_names_hash_bucket_size
。如果nginx_modify_server_names_hash_bucket_size
设置为true
,将在全局nginx.conf
中声明。默认值为64
。nginx_modify_server_names_hash_bucket_size
: 是否更改全局nginx.conf
文件中的server_names_hash_bucket_size
值。默认值为true
。
有关与 certbot 相关的其他配置设置,请查看 geerlingguy/ansible-role-certbot/.../defaults/main.yml。
依赖关系
依赖于 geerlingguy.certbot
Ansible 角色 进行 Let's Encrypt / certbot 任务:
ansible-galaxy install geerlingguy.certbot
快速入门
# 在 macOS 上使用 Homebrew
brew install ansible
# 在 Debian 上
sudo apt update
sudo apt install software-properties-common
sudo apt-add-repository --yes --update ppa:ansible/ansible
sudo apt install ansible
# 或者通过 Python / pip
sudo python3 -m pip install ansible
使用 Ubuntu 18.04 设置新服务器,或在 Digital Ocean、Vultr、Hetzner Cloud、Cloudscale、Azure、Google Cloud、AWS 等平台获取。
确保你可以通过 SSH 密钥登录:
ssh-copy-id [email protected]
ssh [email protected]
创建一个清单文件:
# jitsi.ini
[jitsi]
my-jitsi-server.com jitsi_domain=my-jitsi-server.com [email protected]
[jitsi:vars]
ansible_user=ubuntu
ansible_become=yes # 如果你通过 root 登录,设置为 `no`
apt_mirror=http://archive.ubuntu.com/ubuntu # 更改为你使用的镜像
certbot_enabled=yes
jitsi_nat=no # 如果你的服务器在 NAT 后面,请开启。
创建一个播放书文件:
# jitsi.yml
- hosts: jitsi
roles:
- cimnine.jitsi_meet
安装所需的依赖关系:
ansible-galaxy install cimnine.jitsi_meet
ansible-galaxy install geerlingguy.certbot
在清单上运行播放书文件:
# 如果服务器上的 `sudo` 不需要密码:
ansible-playbook -i jitsi.ini jitsi.yml
# 或者如果服务器上的 `sudo` 需要密码:
ansible-playbook -K -i jitsi.ini jitsi.yml
配置
Jitsi Meet 可以通过这个 Ansible 角色进行配置。为此,来自上游包的文件 /etc/jitsi/meet/{{ jitsi_domain }}-config.js
将被该角色管理的文件替换。
要启用此行为,请定义变量: managed_jitsi_config
并将其设置为 yes
。
例如,将以下示例的最后一行添加到你的 jitsi.ini
文件中:
# jitsi.ini
[jitsi]
my-jitsi-server.com jitsi_domain=my-jitsi-server.com [email protected]
[jitsi:vars]
ansible_user=ubuntu
ansible_become=yes
apt_mirror=http://archive.ubuntu.com/ubuntu # 更改为你使用的镜像
certbot_enabled=yes
jitsi_nat=no
managed_jitsi_config=yes # 通过此角色管理你的 Jitsi 配置
然后,设置所有必需的配置变量。默认值可以在该角色的 defaults/main.yml
文件中找到。必须提供所有变量,而不仅仅是你想要覆盖的!请注意像 analytics: {}
这样的空变量:由于 Jitsi 的工作方式,这必须是一个空对象,而不能是 null。
所有设置、它们的值、使用和效果的文档记录在 jitsi-meet config.js 中。
一个最小示例是:
jitsi_config:
hosts:
domain: "{{ jitsi_domain }}"
muc: "conference.{{ jitsi_domain }}"
bosh: "//{{ jitsi_domain }}/http-bind"
clientNode: "http://jitsi.org/jitsimeet"
testing:
enableFirefoxMulticast: false
p2pTestMode: false
desktopSharingChromeExtId: null
desktopSharingChromeSources: [ 'screen', 'window', 'tab' ]
desktopSharingChromeMinExtVersion: '0.1'
channelLastN: -1
enableWelcomePage: true
enableUserRolesBasedOnToken: false
p2p:
enabled: true
stunServers:
- urls: 'stun:stun.l.google.com:19302'
- urls: 'stun:stun1.l.google.com:19302'
- urls: 'stun:stun2.l.google.com:19302'
preferH264: true
analytics: {}
deploymentInfo: {}
localRecording: {}
e2eping: {}
deploymentUrls: {}
注意:
config.js
的要求可能在更新 jitsi-meet 时随时改变,上游对此没有太多沟通。在更新之前,请查看 Jitsi Meet 项目的 CHANGELOG 和公告以了解新要求的值。
注意:
结构区分大小写,并遵循 config.js
中的确切变量设置。因此,例如,webrctIceUdpDisable
与 WebRTCIceUDPDisable
是截然不同的。Jitsi 在变量命名上并不一致(例如,它随机混合使用 URL
和 Url
),因此请注意确切的名称。
卸载
以下命令可以帮助你移除安装。 它们可能无法完全删除所有文件,但足够让你重新开始,以防你搞砸了一些东西。
systemctl stop jitsi-videobridge
systemctl disable jitsi-videobridge
apt-get purge -y jigasi jitsi-meet jitsi-meet-web-config jitsi-meet-prosody jitsi-meet-web jicofo jitsi-videobridge
systemctl stop nginx
systemctl disable nginx
apt-get purge -y nginx nginx-common nginx-full
apt purge certbot
rm -rf /etc/jitsi /etc/nginx /etc/letsencrypt
crontab -e -u root
reboot
许可证
MIT
Install jitsi-meet with nginx and (optionally) certbot
ansible-galaxy install cimnine.jitsi_meet