diff --git a/README.md b/README.md index f7d1802..798e82a 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,7 @@ OPTIONS (install BigBlueButton): -g Install Greenlight version 3 -k Install Keycloak version 20 + -L Install LiveKit for BigBlueButton -t : Install BigBlueButton LTI framework tools and add/update LTI consumer credentials : diff --git a/bbb-install.sh b/bbb-install.sh index 7ac4218..9a04b35 100644 --- a/bbb-install.sh +++ b/bbb-install.sh @@ -28,9 +28,9 @@ # # wget -qO- https://raw.githubusercontent.com/bigbluebutton/bbb-install/v3.0.x-release/bbb-install.sh | bash -s -- -w -v jammy-300 -s bbb.example.com -e info@example.com # -# Install BigBlueButton with SSL + Greenlight +# Install BigBlueButton with SSL + Greenlight + LiveKit # -# wget -qO- https://raw.githubusercontent.com/bigbluebutton/bbb-install/v3.0.x-release/bbb-install.sh | bash -s -- -w -v jammy-300 -s bbb.example.com -e info@example.com -g +# wget -qO- https://raw.githubusercontent.com/bigbluebutton/bbb-install/v3.0.x-release/bbb-install.sh | bash -s -- -w -v jammy-300 -s bbb.example.com -e info@example.com -g -L # usage() { @@ -55,6 +55,7 @@ OPTIONS (install BigBlueButton): -g Install Greenlight version 3 -k Install Keycloak version 20 + -L Install LiveKit for BigBlueButton (optional) -t : Install BigBlueButton LTI framework tools and add/update LTI consumer credentials : @@ -133,7 +134,7 @@ main() { need_x64 - while builtin getopts "hs:r:c:v:e:p:m:t:xgadwjik" opt "${@}"; do + while builtin getopts "hs:r:c:v:e:p:m:t:Lxgadwjik" opt "${@}"; do case $opt in h) @@ -191,6 +192,10 @@ main() { k) INSTALL_KC=true ;; + + L) + INSTALL_LIVEKIT=true + ;; t) LTI_CREDS_STR=$OPTARG @@ -393,6 +398,10 @@ main() { install_greenlight_v3 fi + if [ -n "$INSTALL_LIVEKIT" ]; then + install_livekit + fi + if [ "$OVERWRITE_IMAGE_MAGICK_POLICY" = true ]; then echo "ATTENTION!!" echo "Overwriting ImageMagick policy file (modifying the default configuration to seal security vectors)" @@ -2004,4 +2013,29 @@ HERE fi } +install_livekit() { + apt-get update + need_pkg bbb-livekit + + # Enable LiveKit + yq e -i '.livekit.enabled = true' /etc/bigbluebutton/bbb-webrtc-sfu/production.yml + systemctl restart bbb-webrtc-sfu + + # Get main network interface and add it to LiveKit config. + interface=$(awk '$2 == 00000000 { print $1 }' /proc/net/route | head -1) + yq e -i ".rtc.interfaces.includes = [\"$interface\"]" /etc/bigbluebutton/livekit.yaml + systemctl restart livekit-server + + # Enable LiveKit in bbb-web.properties + props_file=/etc/bigbluebutton/bbb-web.properties + for key in audioBridge cameraBridge screenShareBridge; do + if grep -q "^${key}=" "$props_file"; then + sed -i "s/^${key}=.*/${key}=livekit/" "$props_file" + else + echo "${key}=livekit" >> "$props_file" + fi + done + systemctl restart bbb-web +} + main "$@" || exit 1