From e48bf46f7cf627f39e9000d5731b04f699109e1d Mon Sep 17 00:00:00 2001 From: netaskd Date: Thu, 7 Feb 2019 14:45:36 +0300 Subject: [PATCH] jigasi,web: add transcription options --- README.md | 15 +++++++++++++ docker-compose.yml | 3 +++ env.example | 21 +++++++++++++++++++ jigasi.yml | 7 +++++++ .../defaults/sip-communicator.properties | 16 ++++++++++++++ jigasi/rootfs/etc/cont-init.d/10-config | 3 +++ web/rootfs/etc/cont-init.d/10-config | 15 +++++++++++++ 7 files changed, 80 insertions(+) diff --git a/README.md b/README.md index d27f3b2..e019be4 100644 --- a/README.md +++ b/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 diff --git a/docker-compose.yml b/docker-compose.yml index 7092ad8..23c7235 100644 --- a/docker-compose.yml +++ b/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 diff --git a/env.example b/env.example index 32c5ec1..77a8286 100644 --- a/env.example +++ b/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 diff --git a/jigasi.yml b/jigasi.yml index ae0f288..46f1584 100644 --- a/jigasi.yml +++ b/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 diff --git a/jigasi/rootfs/defaults/sip-communicator.properties b/jigasi/rootfs/defaults/sip-communicator.properties index 4162070..3e70206 100644 --- a/jigasi/rootfs/defaults/sip-communicator.properties +++ b/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}} diff --git a/jigasi/rootfs/etc/cont-init.d/10-config b/jigasi/rootfs/etc/cont-init.d/10-config index 23bf808..bf9d0c6 100644 --- a/jigasi/rootfs/etc/cont-init.d/10-config +++ b/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 diff --git a/web/rootfs/etc/cont-init.d/10-config b/web/rootfs/etc/cont-init.d/10-config index 26053e0..d7a1a57 100644 --- a/web/rootfs/etc/cont-init.d/10-config +++ b/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