102 lines
3.2 KiB
Plaintext
102 lines
3.2 KiB
Plaintext
# ============================================================================
|
|
#
|
|
# Enable authentication for Jitsi
|
|
#
|
|
# Self-hosted Jitsi server with authentication
|
|
# - https://dev.to/noandrea/self-hosted-jitsi-server-with-authentication-ie7
|
|
#
|
|
# see also:
|
|
# - https://github.com/jitsi/jitsi-meet/blob/master/doc/quick-install.md
|
|
#
|
|
# - https://github.com/jitsi/jitsi-meet/blob/master/doc/manual-install.md
|
|
#
|
|
# ============================================================================
|
|
|
|
FQHN_HOSTNAME="jo.oopen.de"
|
|
FQHN_HOSTNAME="meet.oopen.de"
|
|
FQHN_HOSTNAME="meet2.oopen.de"
|
|
FQHN_HOSTNAME="meet.faire-mobilitaet.de"
|
|
FQHN_HOSTNAME="video.faire-mobilitaet.de"
|
|
|
|
cp /etc/jitsi/meet/${FQHN_HOSTNAME}-config.js /etc/jitsi/meet/${FQHN_HOSTNAME}-config.js.ORIG
|
|
cp /etc/prosody/conf.avail/${FQHN_HOSTNAME}.cfg.lua /etc/prosody/conf.avail/${FQHN_HOSTNAME}.cfg.lua.ORIG
|
|
cp /etc/jitsi/jicofo/sip-communicator.properties /etc/jitsi/jicofo/sip-communicator.properties.ORIG
|
|
|
|
|
|
# --
|
|
# file: /etc/jitsi/meet/${FQHN_HOSTNAME}-config.js
|
|
# --
|
|
|
|
# Section 'host'
|
|
#
|
|
# anonymousdomain: 'guest.${FQHN_HOSTNAME},
|
|
#
|
|
if ! $(grep -q -E "^\s*anonymousdomain:\s+'guest.${FQHN_HOSTNAME}'\s*," \
|
|
/etc/jitsi/meet/${FQHN_HOSTNAME}-config.js 2>/dev/null); then
|
|
perl -i -n -p -e "s#^((\s*)// anonymousdomain:.*)#\1\n\2anonymousdomain: 'guest.${FQHN_HOSTNAME}',#" \
|
|
/etc/jitsi/meet/${FQHN_HOSTNAME}-config.js
|
|
fi
|
|
|
|
# Section 'host'
|
|
#
|
|
# authdomain: 'guest.${FQHN_HOSTNAME},
|
|
#
|
|
if ! $(grep -q -E "^\s*authdomain:\s+'${FQHN_HOSTNAME}'\s*," \
|
|
/etc/jitsi/meet/${FQHN_HOSTNAME}-config.js 2>/dev/null); then
|
|
perl -i -n -p -e "s#^((\s*)// authdomain:.*)#\1\n\2authdomain: '${FQHN_HOSTNAME}',#" \
|
|
/etc/jitsi/meet/${FQHN_HOSTNAME}-config.js
|
|
fi
|
|
|
|
|
|
# root Section (var config = {)
|
|
#
|
|
# Enable:
|
|
#
|
|
# requireDisplayName: true,
|
|
#
|
|
if ! $(grep -q -E "^\s*requireDisplayName:\s+true\s*," \
|
|
/etc/jitsi/meet/${FQHN_HOSTNAME}-config.js 2>/dev/null); then
|
|
perl -i -n -p -e "s#^((\s*)// requireDisplayName:.*)#\1\n\2requireDisplayName: true,#" \
|
|
/etc/jitsi/meet/${FQHN_HOSTNAME}-config.js
|
|
fi
|
|
|
|
|
|
# ---
|
|
# file: /etc/prosody/conf.avail/${FQHN_HOSTNAME}.cfg.lua
|
|
# ---
|
|
|
|
|
|
# Root section of 'VirtualHost "${FQHN_HOSTNAME}"'
|
|
#
|
|
# authentication = "internal_plain"
|
|
#
|
|
if $(grep -q -E "^\s*authentication\s+=\s+\"anonymous\"" \
|
|
/etc/prosody/conf.avail/${FQHN_HOSTNAME}.cfg.lua 2>/dev/null); then
|
|
perl -i -n -p -e "s/^(\s*)(authentication\s*=\s*\"anonymous\")/\1--\2\n\1authentication = \"internal_plain\"/" \
|
|
/etc/prosody/conf.avail/${FQHN_HOSTNAME}.cfg.lua
|
|
fi
|
|
|
|
|
|
# Add Section 'VirtualHost "guest.${FQHN_HOSTNAME}""
|
|
#
|
|
if ! $(grep -q -E "^\s*VirtualHost \"guest.${FQHN_HOSTNAME}\"" \
|
|
/etc/prosody/conf.avail/${FQHN_HOSTNAME}.cfg.lua 2>/dev/null); then
|
|
cat <<EOF >> /etc/prosody/conf.avail/${FQHN_HOSTNAME}.cfg.lua
|
|
|
|
VirtualHost "guest.${FQHN_HOSTNAME}"
|
|
authentication = "anonymous"
|
|
c2s_require_encryption = false
|
|
EOF
|
|
fi
|
|
|
|
# ---
|
|
# file: /etc/jitsi/jicofo/sip-communicator.properties
|
|
# ---
|
|
|
|
if ! $(grep -q -E "^\s*org.jitsi.jicofo.auth.URL\s*=\s*XMPP:${FQHN_HOSTNAME}" \
|
|
/etc/jitsi/jicofo/sip-communicator.properties 2>/dev/null); then
|
|
cat <<EOF >> /etc/jitsi/jicofo/sip-communicator.properties
|
|
org.jitsi.jicofo.auth.URL=XMPP:${FQHN_HOSTNAME}
|
|
EOF
|
|
fi
|