diff --git a/type/__jitsi_meet/files/prosody.cfg.lua.sh b/type/__jitsi_meet/files/prosody.cfg.lua.sh new file mode 120000 index 0000000..93678b9 --- /dev/null +++ b/type/__jitsi_meet/files/prosody.cfg.lua.sh @@ -0,0 +1 @@ +../../__jitsi_meet_domain/files/prosody.cfg.lua.sh \ No newline at end of file diff --git a/type/__jitsi_meet/gencode-remote b/type/__jitsi_meet/gencode-remote index 7d181b7..670c7be 100755 --- a/type/__jitsi_meet/gencode-remote +++ b/type/__jitsi_meet/gencode-remote @@ -4,8 +4,7 @@ if grep -qE "^__file/etc/nginx" "${__messages_in}"; then echo "service nginx reload" fi -JITSI_HOST="${__object_id}" -if grep -qE "^(__line/jitsi_jicofo_secured_domains|__file/etc/prosody/conf.d/${JITSI_HOST}.zauth.cfg.lua|__file/etc/jitsi/jicofo/jicofo.conf)" "${__messages_in}"; then +if grep -qE "^(__line/jitsi_jicofo_secured_domains|(__file|__link)/etc/prosody/conf.d/|__file/etc/jitsi/jicofo/jicofo.conf)" "${__messages_in}"; then echo "systemctl restart prosody" echo "systemctl restart jicofo" echo "systemctl restart jitsi-videobridge2" diff --git a/type/__jitsi_meet/manifest b/type/__jitsi_meet/manifest index e9ed5c6..02716a0 100755 --- a/type/__jitsi_meet/manifest +++ b/type/__jitsi_meet/manifest @@ -161,18 +161,22 @@ else SECURED_DOMAINS_STATE='absent' fi -__file "/etc/prosody/conf.d/${JITSI_HOST}.zauth.cfg.lua" \ - --owner prosody --group prosody --mode 0440 \ - --state ${SECURED_DOMAINS_STATE} \ - --source - <. - // authdomain: '${JITSI_HOST}', + // NOTE [cdist]: if we use '${DOMAIN}', jicofo won't start the meeting + authdomain: '${JITSI_HOST}', // Focus component domain. Defaults to focus.. - // focus: 'focus.${JITSI_HOST}', + focus: 'focus.${JITSI_HOST}', // XMPP MUC domain. FIXME: use XEP-0030 to discover it. - muc: 'conference.${JITSI_HOST}' + muc: 'conference.${DOMAIN}' }, // BOSH URL. FIXME: use XEP-0156 to discover it. @@ -31,12 +32,12 @@ var config = { bosh: '///http-bind', // Websocket URL - // websocket: 'wss://${JITSI_HOST}/xmpp-websocket', + // websocket: 'wss://${DOMAIN}/xmpp-websocket', // The real JID of focus participant - can be overridden here // Do not change username - FIXME: Make focus username configurable // https://github.com/jitsi/jitsi-meet/issues/7376 - // focusUserJid: 'focus@auth.${JITSI_HOST}', + focusUserJid: 'focus@auth.${JITSI_HOST}', // Testing / experimental features. @@ -270,9 +271,9 @@ $(if [ -n "${VIDEO_CONSTRAINTS}" ]; then echo "${VIDEO_CONSTRAINTS},"; fi) // appKey: '' // Specify your app key here. // // A URL to redirect the user to, after authenticating // // by default uses: - // // 'https://${JITSI_HOST}/static/oauth.html' + // // 'https://${DOMAIN}/static/oauth.html' // redirectURI: - // 'https://${JITSI_HOST}/subfolder/static/oauth.html' + // 'https://${DOMAIN}/subfolder/static/oauth.html' // }, // When integrations like dropbox are enabled only that will be shown, // by enabling fileRecordingsServiceEnabled, we show both the integrations diff --git a/type/__jitsi_meet_domain/files/nginx.sh b/type/__jitsi_meet_domain/files/nginx.sh index 6e874c1..e678dce 100644 --- a/type/__jitsi_meet_domain/files/nginx.sh +++ b/type/__jitsi_meet_domain/files/nginx.sh @@ -100,7 +100,7 @@ server { proxy_set_header X-Forwarded-For \$remote_addr; # Prevision for 'multi-domain' jitsi instances # https://community.jitsi.org/t/same-jitsi-meet-instance-with-multiple-domain-names/17391 - proxy_set_header Host ${JITSI_HOST}; + proxy_set_header Host ${DOMAIN}; } # xmpp websockets @@ -111,7 +111,7 @@ server { proxy_set_header Connection "upgrade"; # Prevision for 'multi-domain' jitsi instances # https://community.jitsi.org/t/same-jitsi-meet-instance-with-multiple-domain-names/17391 - proxy_set_header Host ${JITSI_HOST}; + proxy_set_header Host ${DOMAIN}; tcp_nodelay on; } diff --git a/type/__jitsi_meet_domain/files/prosody.cfg.lua.sh b/type/__jitsi_meet_domain/files/prosody.cfg.lua.sh new file mode 100644 index 0000000..928ce32 --- /dev/null +++ b/type/__jitsi_meet_domain/files/prosody.cfg.lua.sh @@ -0,0 +1,199 @@ +#!/bin/sh -eu + +# Source: +# https://github.com/jitsi/jitsi-meet/blob/master/doc/debian/jitsi-meet-prosody/prosody.cfg.lua-jvb.example +FOCUS_USER="focus" +JITSI_DOMAIN="${JITSI_DOMAIN:-${JITSI_HOST:?}}" +# PROSODY_MAIN_CONFIG: defined in __jitsi_meet, empty in __jitsi_meet_domain +PROSODY_SECUREDOMAIN_START="--[[" +PROSODY_SECUREDOMAIN_END="--]]" +if [ -n "${PROSODY_MAIN_CONFIG}" ]; then + PROSODY_MAIN_START="" + PROSODY_MAIN_END="" + PROSODY_DOMAIN_START="--[[" + PROSODY_DOMAIN_END="--]]" +else + PROSODY_MAIN_START="--[[" + PROSODY_MAIN_END="--]]" + PROSODY_DOMAIN_START="" + PROSODY_DOMAIN_END="" + if [ -n "${SECURED_DOMAINS}" ]; then + PROSODY_SECUREDOMAIN_START="" + PROSODY_SECUREDOMAIN_END="" + fi +fi +# Websockets haven't been fully tested in this type and don't work reliably +PROSODY_WEBSOCKET="-- " + +# shellcheck disable=SC2034 # This is intended to be included +PROSODY_CONFIG="$(cat <