From 6b1e50f7b5ae8f534089bf16c0b25738954094ac Mon Sep 17 00:00:00 2001 From: Ark74 Date: Fri, 30 Aug 2024 00:51:27 +0000 Subject: [PATCH] jigasi: update jigasi configuration. (#115) Reviewed-on: https://forge.switnet.net/switnet/quick-jibri-installer/pulls/115 Co-authored-by: Ark74 Co-committed-by: Ark74 --- jigasi-vosk-backend.sh | 26 +++++++++---------- ...fig.patch => 001-jigasi-meet-config.patch} | 6 ++--- ....patch => 002-jigasi-sip-properties.patch} | 0 3 files changed, 16 insertions(+), 16 deletions(-) rename patches/jigasi/{jigasi-meet-config.patch => 001-jigasi-meet-config.patch} (92%) rename patches/jigasi/{jigasi-sip-properties.patch => 002-jigasi-sip-properties.patch} (100%) diff --git a/jigasi-vosk-backend.sh b/jigasi-vosk-backend.sh index a143a1e..293bb25 100644 --- a/jigasi-vosk-backend.sh +++ b/jigasi-vosk-backend.sh @@ -27,17 +27,15 @@ echo '' exit_if_not_installed jitsi-meet -export DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)" -export JIG_TRANSC_PASWD="$(tr -dc "a-zA-Z0-9#*=" < /dev/urandom | fold -w 16 | head -n1)" -JIGASI_CONFIG="/etc/jitsi/jigasi/config" -MEET_CONF="/etc/jitsi/meet/${DOMAIN}-config.js" -JIG_SIP_CONF="/etc/jitsi/jigasi/config" +DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)" +JIG_TRANSC_PASWD="$(tr -dc "a-zA-Z0-9#*=" < /dev/urandom | fold -w 16 | head -n1)" JIG_SIP_PROP="/etc/jitsi/jigasi/sip-communicator.properties" -#JIG_TRANSC_PASWD_B64="$(echo -n "$JIG_TRANSC_PASWD" | base64)" +export DOMAIN +export JIG_TRANSC_PASWD apt-get -q2 update -# Disbale +# Disable SIP account prompt by default echo "jigasi jigasi/sip-account string ''" | debconf-set-selections echo "jigasi jigasi/sip-password password ''" | debconf-set-selections @@ -54,7 +52,7 @@ echo "6) Japanese" echo "7) Russian" echo "8) Spanish" -read -p "Enter the number corresponding to your language choice: " lang_choice +read -p "Enter the number corresponding to your language choice: " -r lang_choice case $lang_choice in 1) @@ -95,20 +93,22 @@ case $lang_choice in esac # Running selected VOSK docker model. -docker run -d -p 2700:2700 ${VOSK_DOCKER_MODEL}:latest +docker run -d --restart always -p 2700:2700 ${VOSK_DOCKER_MODEL}:latest echo "Setting up Jigasi transcript with current platform..." # Jitsi Meet echo "> Patching Jitsi Meet's config.js for Transcription support." -echo " Read more at patches/jigasi/jigasi-meet-config.patch file" -envsubst < patches/jigasi/jigasi-meet-config.patch | patch --no-backup-if-mismatch -d / -p1 +echo " Read more at patches/jigasi/001-jigasi-meet-config.patch file" +envsubst < patches/jigasi/001-jigasi-meet-config.patch | \ + patch --no-backup-if-mismatch -d / -p1 # Jigasi echo "> Patching jigasi's sip-communicator.properties configuration." -echo " Read more at patches/jigasi/jigasi-sip-properties.patch file" +echo " Read more at patches/jigasi/002-jigasi-sip-properties.patch file" cp "$JIG_SIP_PROP" ${JIG_SIP_PROP}-dpkg-file -envsubst < patches/jigasi/jigasi-sip-properties.patch | patch --no-backup-if-mismatch -d / -p1 +envsubst < patches/jigasi/002-jigasi-sip-properties.patch | \ + patch --no-backup-if-mismatch -d / -p1 # Create transcribe user on hidden domain. prosodyctl register transcriber recorder."$DOMAIN" "$JIG_TRANSC_PASWD" diff --git a/patches/jigasi/jigasi-meet-config.patch b/patches/jigasi/001-jigasi-meet-config.patch similarity index 92% rename from patches/jigasi/jigasi-meet-config.patch rename to patches/jigasi/001-jigasi-meet-config.patch index f7ac5ac..41f5b8f 100644 --- a/patches/jigasi/jigasi-meet-config.patch +++ b/patches/jigasi/001-jigasi-meet-config.patch @@ -8,7 +8,7 @@ diff --git a/etc/jitsi/meet/${DOMAIN}-config.js b/etc/jitsi/meet/${DOMAIN}-confi index f412891..f704157 100644 --- a/etc/jitsi/meet/${DOMAIN}-config.js +++ b/etc/jitsi/meet/${DOMAIN}-config.js -@@ -407,9 +407,9 @@ var config = { +@@ -426,9 +426,9 @@ var config = { // autoCaptionOnRecord: false, // Transcription options. @@ -20,7 +20,7 @@ index f412891..f704157 100644 // // Translation languages. // // Available languages can be found in -@@ -424,7 +424,7 @@ var config = { +@@ -443,7 +443,7 @@ var config = { // // detected based on the environment, e.g. if the app is opened in a chrome instance which // // is using french as its default language then transcriptions for that participant will be in french. // // Defaults to true. @@ -29,7 +29,7 @@ index f412891..f704157 100644 // // Transcriber language. This settings will only work if "useAppLanguage" // // is explicitly set to false. -@@ -434,7 +434,7 @@ var config = { +@@ -453,7 +453,7 @@ var config = { // // Enables automatic turning on transcribing when recording is started // autoTranscribeOnRecord: false, diff --git a/patches/jigasi/jigasi-sip-properties.patch b/patches/jigasi/002-jigasi-sip-properties.patch similarity index 100% rename from patches/jigasi/jigasi-sip-properties.patch rename to patches/jigasi/002-jigasi-sip-properties.patch