[jitsi] Jitsi Scale additions -- connection monitoring, start/stop for JVB servers

This commit is contained in:
Bernhard "bero" Rosenkränzer (Boggins) 2024-11-18 22:22:42 +01:00
parent bd35871fcb
commit 379daec85a

View File

@ -17,6 +17,14 @@ config_jitsi() {
# chmod 644 /federated/apps/jitsi/data/config/keys/*.pem
fi
grep -q JITSI_SCALE /etc/federated && sed -i -e '/JITSI_SCALE/d' /etc/federated
if [ -n "$JITSI_SCALE" ]; then
cat >>/etc/federated <<EOF
# JITSI_SCALE: not set = use local jvb, client = jitsi only, server = jvb only
JITSI_SCALE=$JITSI_SCALE
EOF
fi
# Extract Jitsi's gen-password.sh into /federated/apps/jitsi
install -c -m 755 /federated/lib/files/jitsi/gen-passwords.sh /federated/apps/jitsi/
@ -354,6 +362,17 @@ if [ "$JITSI_SCALE" != "client" ]; then
ports:
- '\${JVB_PORT:-10000}:\${JVB_PORT:-10000}/udp'
- '127.0.0.1:\${JVB_COLIBRI_PORT:-9090}:9090'
EOF
if [ "$JITSI_SCALE" = "server" ]; then
# 8080 is the PRIVATE interface, giving access to
# endpoints like /colibri/stats - useful for JVB
# servers to see whether or not there are any
# active connections
cat >> /federated/apps/jitsi/docker-compose.yml <<EOF
- '127.0.0.1:8080:8080'
EOF
fi
cat >> /federated/apps/jitsi/docker-compose.yml <<EOF
volumes:
- \${CONFIG}/jvb:/config:Z
environment:
@ -483,6 +502,11 @@ if [ "$JITSI_SCALE" = "server" ]; then
# XMPP password for JVB client connections
JVB_AUTH_PASSWORD=
# Enable Colibri (statistics/monitoring) so we can check for activity
COLIBRI_REST_ENABLED=1
SHUTDOWN_REST_ENABLED=1
ENABLE_COLIBRI_WEBSOCKET=1
EOF
else
@ -810,7 +834,11 @@ uninstall_jitsi() {
}
start_jitsi() {
# Start service with command to make sure it's up before proceeding
start_service "jitsi" "nc -z 192.168.0.25 443 &> /dev/null" "8"
if [ "$JITSI_SCALE" = "server" ]; then
start_service "jitsi" "nc -z 192.168.0.28 8080 &> /dev/null" "8"
else
start_service "jitsi" "nc -z 192.168.0.25 443 &> /dev/null" "8"
fi
# Allow multiple JVBs to connect
if [ "$JITSI_SCALE" = "client" ]; then
for i in $(seq 1 10); do