2
0
Эх сурвалжийг харах

jigasi,web: add transcription options

netaskd 6 жил өмнө
parent
commit
e48bf46f7c

+ 15 - 0
README.md

@@ -93,6 +93,7 @@ Variable | Description | Example
 `HTTP_PORT` | Exposed port for HTTP traffic | 8000
 `HTTPS_PORT` | Exposed port for HTTPS traffic | 8443
 `DOCKER_HOST_ADDRESS` | IP address of the Docker host, needed for LAN environments | 192.168.1.1
+`PUBLIC_URL` | Public url for the web service | https://meet.example.com
 
 **NOTE**: The mobile apps won't work with self-signed certificates (the default)
 see below for instructions on how to obtain a proper certificate with Let's Encrypt.
@@ -214,6 +215,17 @@ Variable | Description | Example
 --- | --- | ---
 `ETHERPAD_URL_BASE` | Set etherpad-lite URL | http://etherpad.meet.jitsi:9001
 
+### Transcription configuration
+
+If you want to enable the Transcribing function, these options are required:
+
+Variable | Description | Example
+--- | --- | ---
+`ENABLE_TRANSCRIPTIONS` | Enable Jigasi transcription in a conference | 1
+`GOOGLE_APPLICATION_CREDENTIALS` | Credentials for connect to Cloud Google API from Jigasi. Path located inside the container | /config/key.json
+
+For setting `GOOGLE_APPLICATION_CREDENTIALS` please read https://cloud.google.com/text-to-speech/docs/quickstart-protocol section "Before you begin" from 1 to 5 paragraph.
+
 ### Advanced configuration
 
 These configuration options are already set and generally don't need to be changed.
@@ -250,6 +262,9 @@ Variable | Description | Default value
 `JIGASI_SIP_KEEP_ALIVE_METHOD` | Keepalive method | OPTIONS
 `JIGASI_HEALTH_CHECK_SIP_URI` | Health-check extension. Jigasi will call it for healthcheck | keepalive
 `JIGASI_HEALTH_CHECK_INTERVAL` | Interval of healthcheck in milliseconds | 300000
+`JIGASI_TRANSCRIBER_RECORD_AUDIO` | Jigasi will recordord an audio when transcriber is on | true
+`JIGASI_TRANSCRIBER_SEND_TXT` | Jigasi will send transcribed text to the chat when transcriber is on | true
+`JIGASI_TRANSCRIBER_ADVERTISE_URL` | Jigasi post to the chat an url with transcription file | true
 `DISABLE_HTTPS` | Disable HTTPS, this can be useful if TLS connections are going to be handled outside of this setup | 1
 `ENABLE_HTTP_REDIRECT` | Redirects HTTP traffic to HTTPS | 1
 

+ 3 - 0
docker-compose.yml

@@ -10,15 +10,18 @@ services:
         volumes:
             - ${CONFIG}/web:/config
             - ${CONFIG}/web/letsencrypt:/etc/letsencrypt
+            - ${CONFIG}/transcripts:/usr/share/jitsi-meet/transcripts
         environment:
             - ENABLE_AUTH
             - ENABLE_GUESTS
             - ENABLE_LETSENCRYPT
             - ENABLE_HTTP_REDIRECT
+            - ENABLE_TRANSCRIPTIONS
             - DISABLE_HTTPS
             - JICOFO_AUTH_USER
             - LETSENCRYPT_DOMAIN
             - LETSENCRYPT_EMAIL
+            - PUBLIC_URL
             - XMPP_DOMAIN
             - XMPP_AUTH_DOMAIN
             - XMPP_BOSH_URL_BASE

+ 21 - 0
env.example

@@ -14,6 +14,9 @@ HTTPS_PORT=8443
 # System time zone.
 TZ=Europe/Amsterdam
 
+# Public URL for the web service.
+#PUBLIC_URL="https://meet.example.com"
+
 # IP address of the Docker host. See the "Running on a LAN environment" section
 # in the README.
 #DOCKER_HOST_ADDRESS=192.168.1.1
@@ -224,6 +227,24 @@ JIGASI_PORT_MAX=20050
 
 # Health-check interval
 #JIGASI_HEALTH_CHECK_INTERVAL=300000
+#
+# Enable Jigasi transcription.
+#ENABLE_TRANSCRIPTIONS=1
+
+# Jigasi will recordord an audio when transcriber is on. Default false.
+#JIGASI_TRANSCRIBER_RECORD_AUDIO=true
+
+# Jigasi will send transcribed text to the chat when transcriber is on. Default false.
+#JIGASI_TRANSCRIBER_SEND_TXT=true
+
+# Jigasi post to the chat an url with transcription file. Default false.
+#JIGASI_TRANSCRIBER_ADVERTISE_URL=true
+
+# Credentials for connect to Cloud Google API from Jigasi. Path located inside the container.
+# Please read https://cloud.google.com/text-to-speech/docs/quickstart-protocol
+# section "Before you begin" from 1 to 5 paragraph. Copy the key on
+# the docker host to ${CONFIG}/jigasi/key.json and to enable this setting:
+#GOOGLE_APPLICATION_CREDENTIALS=/config/key.json
 
 # Disable HTTPS. This can be useful if TLS connections are going to be handled outside of this setup.
 #DISABLE_HTTPS=1

+ 7 - 0
jigasi.yml

@@ -8,12 +8,14 @@ services:
             - '${JIGASI_PORT_MIN}-${JIGASI_PORT_MAX}:${JIGASI_PORT_MIN}-${JIGASI_PORT_MAX}/udp'
         volumes:
             - ${CONFIG}/jigasi:/config
+            - ${CONFIG}/transcripts:/tmp/transcripts
         environment:
             - ENABLE_AUTH
             - XMPP_AUTH_DOMAIN
             - XMPP_INTERNAL_MUC_DOMAIN
             - XMPP_SERVER
             - XMPP_DOMAIN
+            - PUBLIC_URL
             - JIGASI_SIP_URI
             - JIGASI_SIP_PASSWORD
             - JIGASI_SIP_SERVER
@@ -28,6 +30,11 @@ services:
             - JIGASI_HEALTH_CHECK_INTERVAL
             - JIGASI_SIP_KEEP_ALIVE_METHOD
             - JIGASI_ENABLE_SDES_SRTP
+            - ENABLE_TRANSCRIPTIONS
+            - JIGASI_TRANSCRIBER_ADVERTISE_URL
+            - JIGASI_TRANSCRIBER_RECORD_AUDIO
+            - JIGASI_TRANSCRIBER_SEND_TXT
+            - GOOGLE_APPLICATION_CREDENTIALS
             - TZ
         depends_on:
             - prosody

+ 16 - 0
jigasi/rootfs/defaults/sip-communicator.properties

@@ -120,3 +120,19 @@ org.jitsi.jigasi.xmpp.acc.ALLOW_NON_SECURE=true
 # type of non-trusted certicates. In this mode your service trust in the
 # remote certificates always.
 net.java.sip.communicator.service.gui.ALWAYS_TRUST_MODE_ENABLED=true
+
+{{ if .Env.ENABLE_TRANSCRIPTIONS | default "0" | toBool }}
+# Transcription config
+org.jitsi.jigasi.ENABLE_TRANSCRIPTION=true
+org.jitsi.jigasi.transcription.ENABLE_TRANSLATION=true
+org.jitsi.jigasi.transcription.DIRECTORY=/tmp/transcripts
+org.jitsi.jigasi.transcription.BASE_URL={{ .Env.PUBLIC_URL }}/transcripts
+org.jitsi.jigasi.transcription.jetty.port=-1
+org.jitsi.jigasi.transcription.ADVERTISE_URL={{ .Env.JIGASI_TRANSCRIBER_ADVERTISE_URL | default "false"}}
+org.jitsi.jigasi.transcription.SAVE_JSON=false
+org.jitsi.jigasi.transcription.SEND_JSON=true
+org.jitsi.jigasi.transcription.SAVE_TXT=true
+org.jitsi.jigasi.transcription.SEND_TXT={{ .Env.JIGASI_TRANSCRIBER_SEND_TXT | default "false"}}
+org.jitsi.jigasi.transcription.RECORD_AUDIO={{ .Env.JIGASI_TRANSCRIBER_RECORD_AUDIO | default "false"}}
+org.jitsi.jigasi.transcription.RECORD_AUDIO_FORMAT=wav
+{{end}}

+ 3 - 0
jigasi/rootfs/etc/cont-init.d/10-config

@@ -7,3 +7,6 @@ fi
 if [[ ! -f /config/logging.properties ]]; then
     cp /defaults/logging.properties /config
 fi
+
+mkdir -pm777 /tmp/transcripts
+chown jigasi:jitsi /tmp/transcripts

+ 15 - 0
web/rootfs/etc/cont-init.d/10-config

@@ -78,9 +78,24 @@ if [[ ! -f /config/config.js ]]; then
             -e "/enableWelcomePage/a\    etherpad_base: '/etherpad/p/'," \
             /config/config.js
     fi
+
+    if [[ $ENABLE_TRANSCRIPTIONS -eq 1 || "$ENABLE_TRANSCRIPTIONS" == "true" ]]; then
+        sed -i \
+             -e "s#// transcribingEnabled:.*#transcribingEnabled: true,#" \
+             /config/config.js
+    fi
 fi
 
 if [[ ! -f /config/interface_config.js ]]; then
     cp /defaults/interface_config.js /config/interface_config.js
+
+    # It will remove parameter 'closedcaptions' from TOOLBAR_BUTTONS if ENABLE_TRANSCRIPTIONS is false,
+    # because it enabled by default, but not supported out of the box.
+    if [[ $ENABLE_TRANSCRIPTIONS -ne 1 || "$ENABLE_TRANSCRIPTIONS" != "true" ]]; then
+        sed -i \
+            -e "s#'closedcaptions', ##" \
+            /config/interface_config.js
+    fi
+
 fi