Fixed jitsi for merge
This commit is contained in:
parent
5d5e949f92
commit
8f72fe6390
84
lib/jitsi.sh
84
lib/jitsi.sh
@ -6,7 +6,7 @@ PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sb
|
|||||||
get_appvars
|
get_appvars
|
||||||
|
|
||||||
config_jitsi() {
|
config_jitsi() {
|
||||||
echo -ne "* Configuring jitsi container.."
|
echo -ne "\n* Configuring /federated/apps/jitsi container.."
|
||||||
|
|
||||||
if [ ! -d "/federated/apps/jitsi" ]; then
|
if [ ! -d "/federated/apps/jitsi" ]; then
|
||||||
mkdir -p /federated/apps/jitsi
|
mkdir -p /federated/apps/jitsi
|
||||||
@ -429,12 +429,19 @@ cat > /federated/apps/jitsi/.env <<EOF
|
|||||||
# Directory where all configuration will be stored
|
# Directory where all configuration will be stored
|
||||||
CONFIG=/federated/apps/jitsi/data/config
|
CONFIG=/federated/apps/jitsi/data/config
|
||||||
|
|
||||||
|
EOF
|
||||||
|
if [ "$JITSI_SCALE" != "server" ]; then
|
||||||
|
cat >> /federated/apps/jitsi/.env <<EOF
|
||||||
# Exposed HTTP port
|
# Exposed HTTP port
|
||||||
HTTP_PORT=9000
|
HTTP_PORT=9000
|
||||||
|
|
||||||
# Exposed HTTPS port
|
# Exposed HTTPS port
|
||||||
HTTPS_PORT=9443
|
HTTPS_PORT=9443
|
||||||
|
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat >> /federated/apps/jitsi/.env <<EOF
|
||||||
# System time zone
|
# System time zone
|
||||||
TZ=UTC
|
TZ=UTC
|
||||||
|
|
||||||
@ -444,21 +451,45 @@ EOF
|
|||||||
|
|
||||||
if [ "$JITSI_SCALE" = "server" ]; then
|
if [ "$JITSI_SCALE" = "server" ]; then
|
||||||
cat >> /federated/apps/jitsi/.env <<EOF
|
cat >> /federated/apps/jitsi/.env <<EOF
|
||||||
XMPP_AUTH_DOMAIN=auth.jitsitest.federatedcomputer.cloud
|
XMPP_SERVER=xmpp.jitsitest.federatedcomputer.cloud,xmpp.jitsitest2.fedcom.net
|
||||||
XMPP_SERVER=xmpp.jitsitest.federatedcomputer.cloud
|
EOF
|
||||||
XMPP_INTERNAL_MUC_DOMAIN=internal-muc.jitsitest.federatedcomputer.cloud
|
else
|
||||||
|
cat >> /federated/apps/jitsi/.env <<EOF
|
||||||
|
XMPP_SERVER=xmpp.$DOMAIN
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$JITSI_SCALE" ]; then
|
||||||
|
# XMPP_AUTH_DOMAIN and XMPP_INTERNAL_MUC_DOMAIN don't
|
||||||
|
# need to resolve - they just need to be identical across
|
||||||
|
# the involved Jitsi components.
|
||||||
|
# So it is safe to use a common (even if nonexistant)
|
||||||
|
# domain across all Jitsi Scale clients so the JVB can
|
||||||
|
# use the same information for every Prosody instance
|
||||||
|
# it connects to.
|
||||||
|
cat >> /federated/apps/jitsi/.env <<EOF
|
||||||
|
XMPP_AUTH_DOMAIN=auth.jitsiscale.federated.computer
|
||||||
|
XMPP_INTERNAL_MUC_DOMAIN=internal-muc.jitsiscale.federated.computer
|
||||||
|
EOF
|
||||||
|
else
|
||||||
|
cat >> /federated/apps/jitsi/.env <<EOF
|
||||||
|
XMPP_AUTH_DOMAIN=auth.$DOMAIN
|
||||||
|
XMPP_INTERNAL_MUC_DOMAIN=internal-muc.$DOMAIN
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$JITSI_SCALE" = "server" ]; then
|
||||||
|
cat >> /federated/apps/jitsi/.env <<EOF
|
||||||
|
|
||||||
# XMPP password for JVB client connections
|
# XMPP password for JVB client connections
|
||||||
JVB_AUTH_PASSWORD=
|
JVB_AUTH_PASSWORD=
|
||||||
EOF
|
EOF
|
||||||
else
|
else
|
||||||
|
|
||||||
cat >> /federated/apps/jitsi/.env <<EOF
|
cat >> /federated/apps/jitsi/.env <<EOF
|
||||||
XMPP_DOMAIN=$DOMAIN
|
XMPP_DOMAIN=$DOMAIN
|
||||||
XMPP_AUTH_DOMAIN=auth.$DOMAIN
|
|
||||||
XMPP_SERVER=xmpp.$DOMAIN
|
|
||||||
XMPP_BOSH_URL_BASE=http://xmpp.$DOMAIN:5280
|
XMPP_BOSH_URL_BASE=http://xmpp.$DOMAIN:5280
|
||||||
XMPP_MUC_DOMAIN=muc.$DOMAIN
|
XMPP_MUC_DOMAIN=muc.$DOMAIN
|
||||||
XMPP_INTERNAL_MUC_DOMAIN=internal-muc.$DOMAIN
|
|
||||||
XMPP_GUEST_DOMAIN=guest.$DOMAIN
|
XMPP_GUEST_DOMAIN=guest.$DOMAIN
|
||||||
XMPP_RECORDER_DOMAIN=recorder.$DOMAIN
|
XMPP_RECORDER_DOMAIN=recorder.$DOMAIN
|
||||||
|
|
||||||
@ -665,10 +696,12 @@ mkdir -p /federated/apps/jitsi/data/config/{web,transcripts,prosody/config,proso
|
|||||||
/federated/apps/jitsi/gen-passwords.sh
|
/federated/apps/jitsi/gen-passwords.sh
|
||||||
[ $? -ne 0 ] && fail "Couldn't run /federated/apps/jitsi/gen-passwords.sh"
|
[ $? -ne 0 ] && fail "Couldn't run /federated/apps/jitsi/gen-passwords.sh"
|
||||||
|
|
||||||
echo -ne "done.\n"
|
echo -ne "done."
|
||||||
}
|
}
|
||||||
email_jitsi() {
|
email_jitsi() {
|
||||||
echo -ne "* Sending email to customer.."
|
echo -ne "* Sending email to customer.."
|
||||||
|
spin &
|
||||||
|
SPINPID=$!
|
||||||
|
|
||||||
cat > /federated/apps/mail/data/root/certs/mailfile <<EOF
|
cat > /federated/apps/mail/data/root/certs/mailfile <<EOF
|
||||||
<html>
|
<html>
|
||||||
@ -740,13 +773,16 @@ EOF
|
|||||||
docker exec mail bash -c "mail -r admin@$DOMAIN -a \"Content-type: text/html\" -s \"Application installed on $DOMAIN\" $EMAIL < /root/certs/mailfile"
|
docker exec mail bash -c "mail -r admin@$DOMAIN -a \"Content-type: text/html\" -s \"Application installed on $DOMAIN\" $EMAIL < /root/certs/mailfile"
|
||||||
rm /federated/apps/mail/data/root/certs/mailfile
|
rm /federated/apps/mail/data/root/certs/mailfile
|
||||||
|
|
||||||
|
kill -9 $SPINPID &> /dev/null
|
||||||
echo -ne "done.\n"
|
echo -ne "done.\n"
|
||||||
}
|
}
|
||||||
uninstall_jitsi() {
|
uninstall_jitsi() {
|
||||||
echo -ne "* Uninstalling jitsi container.."
|
echo -ne "* Uninstalling jitsi container.."
|
||||||
|
spin &
|
||||||
|
SPINPID=$!
|
||||||
|
|
||||||
# First stop the service
|
# First stop the service
|
||||||
cd /federated/apps/jitsi && docker-compose -f docker-compose.yml -p jitsi down &> /dev/null
|
cd /federated/apps/jitsi && docker compose -f docker-compose.yml -p jitsi down &> /dev/null
|
||||||
|
|
||||||
# Delete the app directory
|
# Delete the app directory
|
||||||
rm -rf /federated/apps/jitsi
|
rm -rf /federated/apps/jitsi
|
||||||
@ -764,27 +800,31 @@ uninstall_jitsi() {
|
|||||||
if [[ $(grep "### Jitsi" /federated/apps/authelia/data/config/idproviders.yml 2>/dev/null) ]]; then
|
if [[ $(grep "### Jitsi" /federated/apps/authelia/data/config/idproviders.yml 2>/dev/null) ]]; then
|
||||||
sed -i '/### Jitsi/,/### /{/### PowerDNS/!{/### /!d}}' /federated/apps/authelia/data/config/idproviders.yml
|
sed -i '/### Jitsi/,/### /{/### PowerDNS/!{/### /!d}}' /federated/apps/authelia/data/config/idproviders.yml
|
||||||
sed -i '/### Jitsi/d' /federated/apps/authelia/data/config/idproviders.yml
|
sed -i '/### Jitsi/d' /federated/apps/authelia/data/config/idproviders.yml
|
||||||
run_command "/federated/bin/stop authelia"
|
/federated/bin/stop authelia
|
||||||
run_command "/federated/bin/start authelia"
|
/federated/bin/start authelia
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -d "/federated/apps/jitsiopenid" ]]; then
|
if [[ -d "/federated/apps/jitsiopenid" ]]; then
|
||||||
cd /federated/apps/jitsiopenid && docker-compose -f docker-compose.yml -p jitsiopenid down &> /dev/null
|
cd /federated/apps/jitsiopenid && docker compose -f docker-compose.yml -p jitsiopenid down &> /dev/null
|
||||||
rm -rf /federated/apps/jitsiopenid
|
rm -rf /federated/apps/jitsiopenid
|
||||||
docker image rm mod242/jitsi-go-openid:latest &> /dev/null
|
docker image rm mod242/jitsi-go-openid:latest &> /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
kill -9 $SPINPID &> /dev/null
|
||||||
echo -ne "done.\n"
|
echo -ne "done.\n"
|
||||||
}
|
}
|
||||||
start_jitsi() {
|
start_jitsi() {
|
||||||
# Start service with command to make sure it's up before proceeding
|
# 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"
|
start_service "jitsi" "nc -z 192.168.0.25 443 &> /dev/null" "8"
|
||||||
|
# Allow multiple JVBs to connect
|
||||||
echo -ne "done.\n"
|
if [ "$JITSI_SCALE" = "client" ]; then
|
||||||
|
for i in $(seq 1 10); do
|
||||||
|
docker exec -ti jitsi-prosody-1 prosodyctl --config /config/prosody.cfg.lua register jvb$i auth.jitsiscale.federated.computer J17515cAl3-jvb
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
echo -ne "done."
|
||||||
}
|
}
|
||||||
configsso_jitsi() {
|
configsso_jitsi() {
|
||||||
echo -ne "* Configuring jitsi container with SSO.."
|
|
||||||
|
|
||||||
[ ! -d "/federated/apps/authelia" ] && failcheck "Authelia is not installed. You need this first before continuing."
|
[ ! -d "/federated/apps/authelia" ] && failcheck "Authelia is not installed. You need this first before continuing."
|
||||||
[ ! -f "/federated/apps/authelia/data/config/idproviders.yml" ] && failcheck "Authelia idproviders.yml is missing."
|
[ ! -f "/federated/apps/authelia/data/config/idproviders.yml" ] && failcheck "Authelia idproviders.yml is missing."
|
||||||
[[ $(grep "### Jitsi" /federated/apps/authelia/data/config/idproviders.yml 2>/dev/null) ]] && failcheck "Authelia already has a Jitsi configuration."
|
[[ $(grep "### Jitsi" /federated/apps/authelia/data/config/idproviders.yml 2>/dev/null) ]] && failcheck "Authelia already has a Jitsi configuration."
|
||||||
@ -814,8 +854,8 @@ cat >> /federated/apps/authelia/data/config/idproviders.yml <<EOF
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Restart Authelia for changes to take the above configuration
|
# Restart Authelia for changes to take the above configuration
|
||||||
run_command "/federated/bin/stop authelia"
|
/federated/bin/stop authelia
|
||||||
run_command "/federated/bin/start authelia"
|
/federated/bin/start authelia
|
||||||
|
|
||||||
sed -i "s/AUTH_TYPE=.*/AUTH_TYPE=jwt/g" /federated/apps/jitsi/.env
|
sed -i "s/AUTH_TYPE=.*/AUTH_TYPE=jwt/g" /federated/apps/jitsi/.env
|
||||||
sed -i "s/#JWT_APP_ID=.*/JWT_APP_ID=jitsi.$DOMAIN/g" /federated/apps/jitsi/.env
|
sed -i "s/#JWT_APP_ID=.*/JWT_APP_ID=jitsi.$DOMAIN/g" /federated/apps/jitsi/.env
|
||||||
@ -874,9 +914,7 @@ NAME_KEY=name
|
|||||||
EOF
|
EOF
|
||||||
chmod 600 /federated/apps/jitsiopenid/.env
|
chmod 600 /federated/apps/jitsiopenid/.env
|
||||||
|
|
||||||
run_command "/federated/bin/stop jitsi"
|
/federated/bin/stop jitsi
|
||||||
run_command "/federated/bin/start jitsi"
|
/federated/bin/start jitsi
|
||||||
run_command "/federated/bin/start jitsiopenid"
|
/federated/bin/start jitsiopenid
|
||||||
|
|
||||||
echo -ne "done.\n"
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user