feat(jigasi): new JIGASI_MODE variable for sip vs transcriber behavior

extended-transcriber-support
Aaron van Meerten 3 months ago
parent f893e497df
commit 4c2f84aea0
  1. 1
      jigasi.yml
  2. 30
      jigasi/rootfs/defaults/sip-communicator.properties
  3. 13
      jigasi/rootfs/etc/cont-init.d/10-config
  4. 67
      transcriber.yml

@ -37,6 +37,7 @@ services:
- JIGASI_JVB_TIMEOUT - JIGASI_JVB_TIMEOUT
- JIGASI_LOCAL_REGION - JIGASI_LOCAL_REGION
- JIGASI_LOG_FILE - JIGASI_LOG_FILE
- JIGASI_MODE="sip"
- JIGASI_SIP_URI - JIGASI_SIP_URI
- JIGASI_SIP_PASSWORD - JIGASI_SIP_PASSWORD
- JIGASI_SIP_SERVER - JIGASI_SIP_SERVER

@ -1,8 +1,10 @@
{{ $ENABLE_TRANSCRIPTIONS := .Env.ENABLE_TRANSCRIPTIONS | default "0" | toBool -}}
{{ $JIGASI_BREWERY_MUC := .Env.JIGASI_BREWERY_MUC | default "jigasibrewery" -}} {{ $JIGASI_BREWERY_MUC := .Env.JIGASI_BREWERY_MUC | default "jigasibrewery" -}}
{{ $JIGASI_XMPP_USER := .Env.JIGASI_XMPP_USER | default "jigasi" -}} {{ $JIGASI_XMPP_USER := .Env.JIGASI_XMPP_USER | default "jigasi" -}}
{{ $JIGASI_JVB_TIMEOUT := .Env.JIGASI_JVB_TIMEOUT | default "30000" -}} {{ $JIGASI_JVB_TIMEOUT := .Env.JIGASI_JVB_TIMEOUT | default "30000" -}}
{{ $JIGASI_MODE := .Env.JIGASI_MODE | default "sip" -}}
{{ $JIGASI_LOCAL_REGION := .Env.JIGASI_LOCAL_REGION | default "" -}} {{ $JIGASI_LOCAL_REGION := .Env.JIGASI_LOCAL_REGION | default "" -}}
{{ $JIGASI_TRANSCRIBER_USER := .Env.JIGASI_TRANSCRIBER_USER | default "transcriber" -}}
{{ $JIGASI_TRANSCRIBER_FILTER_SILENCE = .Env.JIGASI_TRANSCRIBER_FILTER_SILENCE | default "0" | toBool -}}
{{ $BOSH_URL_PATTERN := .Env.BOSH_URL_PATTERN | default "" -}} {{ $BOSH_URL_PATTERN := .Env.BOSH_URL_PATTERN | default "" -}}
{{ $USE_TRANSLATOR_IN_CONFERENCE := .Env.USE_TRANSLATOR_IN_CONFERENCE | default "0" | toBool -}} {{ $USE_TRANSLATOR_IN_CONFERENCE := .Env.USE_TRANSLATOR_IN_CONFERENCE | default "0" | toBool -}}
{{ $XMPP_AUTH_DOMAIN := .Env.XMPP_AUTH_DOMAIN | default "auth.meet.jitsi" -}} {{ $XMPP_AUTH_DOMAIN := .Env.XMPP_AUTH_DOMAIN | default "auth.meet.jitsi" -}}
@ -11,10 +13,10 @@
{{ $XMPP_INTERNAL_MUC_DOMAIN := .Env.XMPP_INTERNAL_MUC_DOMAIN | default "internal-muc.meet.jitsi" -}} {{ $XMPP_INTERNAL_MUC_DOMAIN := .Env.XMPP_INTERNAL_MUC_DOMAIN | default "internal-muc.meet.jitsi" -}}
{{ $XMPP_DOMAIN := .Env.XMPP_DOMAIN | default "meet.jitsi" -}} {{ $XMPP_DOMAIN := .Env.XMPP_DOMAIN | default "meet.jitsi" -}}
{{ $XMPP_PORT := .Env.XMPP_PORT | default "5222" -}} {{ $XMPP_PORT := .Env.XMPP_PORT | default "5222" -}}
{{ $XMPP_RECORDER_DOMAIN := .Env.XMPP_RECORDER_DOMAIN | default "recorder.meet.jitsi" -}}
{{ $XMPP_SERVER := .Env.XMPP_SERVER | default "xmpp.meet.jitsi" -}} {{ $XMPP_SERVER := .Env.XMPP_SERVER | default "xmpp.meet.jitsi" -}}
{{ $XMPP_SERVERS := splitList "," $XMPP_SERVER -}} {{ $XMPP_SERVERS := splitList "," $XMPP_SERVER -}}
{{ $SHUTDOWN_REST_ENABLED := .Env.SHUTDOWN_REST_ENABLED | default "false" | toBool -}} {{ $SHUTDOWN_REST_ENABLED := .Env.SHUTDOWN_REST_ENABLED | default "false" | toBool -}}
{{ $DISABLE_SIP := .Env.JIGASI_DISABLE_SIP | default "false" | toBool -}}
{{/* assign env from context, preserve during range when . is re-assigned */}} {{/* assign env from context, preserve during range when . is re-assigned */}}
{{ $TRUSTED_DOMAIN_LIST := .Env.JIGASI_TRUSTED_DOMAINS | default "" -}} {{ $TRUSTED_DOMAIN_LIST := .Env.JIGASI_TRUSTED_DOMAINS | default "" -}}
{{ $TRUSTED_DOMAINS := splitList "," $TRUSTED_DOMAIN_LIST -}} {{ $TRUSTED_DOMAINS := splitList "," $TRUSTED_DOMAIN_LIST -}}
@ -31,7 +33,7 @@ net.java.sip.communicator.packetlogging.PACKET_LOGGING_ENABLED=false
# Control REST Shutdown # Control REST Shutdown
org.jitsi.jigasi.ENABLE_REST_SHUTDOWN={{ $SHUTDOWN_REST_ENABLED }} org.jitsi.jigasi.ENABLE_REST_SHUTDOWN={{ $SHUTDOWN_REST_ENABLED }}
{{ if not $ENABLE_TRANSCRIPTIONS -}} {{ if eq $JIGASI_MODE "sip" -}}
# SIP account # SIP account
net.java.sip.communicator.impl.protocol.sip.acc1=acc1 net.java.sip.communicator.impl.protocol.sip.acc1=acc1
{{ if .Env.JIGASI_SIP_SERVER }} {{ if .Env.JIGASI_SIP_SERVER }}
@ -134,7 +136,7 @@ net.java.sip.communicator.impl.protocol.jabber.acc{{ $index }}.BREWERY={{ $JIGAS
net.java.sip.communicator.impl.protocol.jabber.acc{{ $index }}.DOMAIN_BASE={{ $XMPP_DOMAIN }} net.java.sip.communicator.impl.protocol.jabber.acc{{ $index }}.DOMAIN_BASE={{ $XMPP_DOMAIN }}
{{ end -}} {{ end -}}
org.jitsi.jigasi.BREWERY_ENABLED=true org.jitsi.jigasi.BREWERY_ENABLED=true
org.jitsi.jigasi.ENABLE_SIP={{ not $DISABLE_SIP }} org.jitsi.jigasi.ENABLE_SIP={{ eq $JIGASI_MODE "sip" }}
org.jitsi.jigasi.HEALTH_CHECK_SIP_URI={{ .Env.JIGASI_HEALTH_CHECK_SIP_URI | default "" }} org.jitsi.jigasi.HEALTH_CHECK_SIP_URI={{ .Env.JIGASI_HEALTH_CHECK_SIP_URI | default "" }}
org.jitsi.jigasi.HEALTH_CHECK_INTERVAL={{ .Env.JIGASI_HEALTH_CHECK_INTERVAL | default "300000" }} org.jitsi.jigasi.HEALTH_CHECK_INTERVAL={{ .Env.JIGASI_HEALTH_CHECK_INTERVAL | default "300000" }}
@ -148,6 +150,12 @@ org.jitsi.jigasi.xmpp.acc.AUTO_DISCOVER_STUN=false
org.jitsi.jigasi.xmpp.acc.IM_DISABLED=true org.jitsi.jigasi.xmpp.acc.IM_DISABLED=true
org.jitsi.jigasi.xmpp.acc.SERVER_STORED_INFO_DISABLED=true org.jitsi.jigasi.xmpp.acc.SERVER_STORED_INFO_DISABLED=true
org.jitsi.jigasi.xmpp.acc.IS_FILE_TRANSFER_DISABLED=true org.jitsi.jigasi.xmpp.acc.IS_FILE_TRANSFER_DISABLED=true
{{ if eq $JIGASI_MODE "transcriber" -}}
org.jitsi.jigasi.xmpp.acc.USER_ID={{ $JIGASI_TRANSCRIBER_USER }}@{{ $XMPP_RECORDER_DOMAIN }}
org.jitsi.jigasi.xmpp.acc.PASS={{ .Env.JIGASI_TRANSCRIBER_PASSWORD }}
org.jitsi.jigasi.xmpp.acc.ANONYMOUS_AUTH=false
org.jitsi.jigasi.xmpp.acc.ALLOW_NON_SECURE=true
{{ else }}
{{ if .Env.ENABLE_AUTH | default "0" | toBool }} {{ if .Env.ENABLE_AUTH | default "0" | toBool }}
{{ if .Env.ENABLE_GUESTS | default "0" | toBool }} {{ if .Env.ENABLE_GUESTS | default "0" | toBool }}
org.jitsi.jigasi.xmpp.acc.USER_ID={{ $JIGASI_XMPP_USER }}@{{ $XMPP_GUEST_DOMAIN }} org.jitsi.jigasi.xmpp.acc.USER_ID={{ $JIGASI_XMPP_USER }}@{{ $XMPP_GUEST_DOMAIN }}
@ -159,13 +167,13 @@ org.jitsi.jigasi.xmpp.acc.ANONYMOUS_AUTH=false
org.jitsi.jigasi.xmpp.acc.PASS={{ .Env.JIGASI_XMPP_PASSWORD }} org.jitsi.jigasi.xmpp.acc.PASS={{ .Env.JIGASI_XMPP_PASSWORD }}
org.jitsi.jigasi.xmpp.acc.ALLOW_NON_SECURE=true org.jitsi.jigasi.xmpp.acc.ALLOW_NON_SECURE=true
{{ end }} {{ end }}
{{ end }}
# Activate this property if you are using self-signed certificates or other # Activate this property if you are using self-signed certificates or other
# type of non-trusted certicates. In this mode your service trust in the # type of non-trusted certicates. In this mode your service trust in the
# remote certificates always. # remote certificates always.
net.java.sip.communicator.service.gui.ALWAYS_TRUST_MODE_ENABLED=true net.java.sip.communicator.service.gui.ALWAYS_TRUST_MODE_ENABLED=true
{{ if $ENABLE_TRANSCRIPTIONS -}} {{ if eq $JIGASI_MODE "transcriber" -}}
# Transcription config # Transcription config
org.jitsi.jigasi.ENABLE_TRANSCRIPTION=true org.jitsi.jigasi.ENABLE_TRANSCRIPTION=true
org.jitsi.jigasi.transcription.ENABLE_TRANSLATION=true org.jitsi.jigasi.transcription.ENABLE_TRANSLATION=true
@ -179,6 +187,16 @@ org.jitsi.jigasi.transcription.SAVE_TXT=true
org.jitsi.jigasi.transcription.SEND_TXT={{ .Env.JIGASI_TRANSCRIBER_SEND_TXT | default "false"}} 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={{ .Env.JIGASI_TRANSCRIBER_RECORD_AUDIO | default "false"}}
org.jitsi.jigasi.transcription.RECORD_AUDIO_FORMAT=wav org.jitsi.jigasi.transcription.RECORD_AUDIO_FORMAT=wav
{{ if .Env.JIGASI_TRANSCRIBER_CUSTOM_SERVICE -}}
org.jitsi.jigasi.transcription.customService={{ .Env.JIGASI_TRANSCRIBER_CUSTOM_SERVICE }}
{{ end -}}
{{ if $JIGASI_TRANSCRIBER_FILTER_SILENCE -}}
org.jitsi.jigasi.transcription.FILTER_SILENCE = true
{{ end -}}
{{ if .Env.JIGASI_TRANSCRIBER_REMOTE_CONFIG_URL -}}
org.jitsi.jigasi.transcription.remoteTranscriptionConfigUrl={{ .Env.JIGASI_TRANSCRIBER_REMOTE_CONFIG_URL }}
{{ end -}}
{{ end -}} {{ end -}}
{{ if .Env.JIGASI_SIP_DEFAULT_ROOM }} {{ if .Env.JIGASI_SIP_DEFAULT_ROOM }}

@ -13,6 +13,17 @@ if [[ "$JIGASI_XMPP_PASSWORD" == "$OLD_JIGASI_XMPP_PASSWORD" ]]; then
exit 1 exit 1
fi fi
[ -z "$JIGASI_MODE" ] && JIGASI_MODE="sip"
if [[ "$(echo $JIGASI_MODE | tr '[:upper:]' '[:lower:]')" == "transcriber" ]]; then
OLD_JIGASI_TRANSCRIBER_PASSWORD=passw0rd
if [[ "$JIGASI_TRANSCRIBER_PASSWORD" == "$OLD_JIGASI_TRANSCRIBER_PASSWORD" ]]; then
echo 'FATAL ERROR: Jigasi transcriber password must be changed, check the README'
exit 1
fi
# set random jigasi nickname for the instance if is not set
[ -z "${JIGASI_INSTANCE_ID}" ] && export JIGASI_INSTANCE_ID="transcriber-$(date +%N)"
fi
# set random jigasi nickname for the instance if is not set # set random jigasi nickname for the instance if is not set
[ -z "${JIGASI_INSTANCE_ID}" ] && export JIGASI_INSTANCE_ID="jigasi-$(date +%N)" [ -z "${JIGASI_INSTANCE_ID}" ] && export JIGASI_INSTANCE_ID="jigasi-$(date +%N)"
@ -56,7 +67,7 @@ mkdir -pm777 /tmp/transcripts
chown jigasi:jitsi /tmp/transcripts chown jigasi:jitsi /tmp/transcripts
# Create Google Cloud Credentials # Create Google Cloud Credentials
if [[ $ENABLE_TRANSCRIPTIONS -eq 1 || $ENABLE_TRANSCRIPTIONS == "true" ]]; then if [[ "$(echo $JIGASI_MODE | tr '[:upper:]' '[:lower:]')" == "transcriber" ]]; then
if [[ -z $GC_PROJECT_ID || -z $GC_PRIVATE_KEY_ID || -z $GC_PRIVATE_KEY || -z $GC_CLIENT_EMAIL || -z $GC_CLIENT_ID || -z $GC_CLIENT_CERT_URL ]]; then if [[ -z $GC_PROJECT_ID || -z $GC_PRIVATE_KEY_ID || -z $GC_PRIVATE_KEY || -z $GC_CLIENT_EMAIL || -z $GC_CLIENT_ID || -z $GC_CLIENT_CERT_URL ]]; then
echo 'Transcriptions: One or more environment variables are undefined' echo 'Transcriptions: One or more environment variables are undefined'
exit 1 exit 1

@ -0,0 +1,67 @@
version: '3.5'
services:
# SIP gateway (audio)
transcriber:
image: jitsi/jigasi:${JITSI_IMAGE_VERSION:-unstable}
restart: ${RESTART_POLICY:-unless-stopped}
volumes:
- ${CONFIG}/transcriber:/config:Z
- ${CONFIG}/transcripts:/tmp/transcripts:Z
environment:
- AUTOSCALER_SIDECAR_KEY_FILE
- AUTOSCALER_SIDECAR_KEY_ID
- AUTOSCALER_SIDECAR_GROUP_NAME
- AUTOSCALER_SIDECAR_HOST_ID
- AUTOSCALER_SIDECAR_INSTANCE_ID
- AUTOSCALER_SIDECAR_PORT
- AUTOSCALER_SIDECAR_REGION
- AUTOSCALER_SIDECAR_SHUTDOWN_POLLING_INTERVAL
- AUTOSCALER_SIDECAR_STATS_POLLING_INTERVAL
- AUTOSCALER_URL
- BOSH_URL_PATTERN
- ENABLE_AUTH
- ENABLE_GUESTS
- XMPP_AUTH_DOMAIN
- XMPP_GUEST_DOMAIN
- XMPP_MUC_DOMAIN
- XMPP_INTERNAL_MUC_DOMAIN
- XMPP_SERVER
- XMPP_PORT
- XMPP_RECORDER_DOMAIN
- XMPP_DOMAIN
- PUBLIC_URL
- JIGASI_CONFIGURATION
- JIGASI_DISABLE_SIP
- JIGASI_JVB_TIMEOUT
- JIGASI_LOCAL_REGION
- JIGASI_LOG_FILE
- JIGASI_MODE="transcriber"
- JIGASI_XMPP_USER
- JIGASI_XMPP_PASSWORD
- JIGASI_BREWERY_MUC
- JIGASI_ENABLE_SDES_SRTP
- JIGASI_TRANSCRIBER_ADVERTISE_URL
- JIGASI_TRANSCRIBER_CUSTOM_SERVICE
- JIGASI_TRANSCRIBER_FILTER_SILENCE
- JIGASI_TRANSCRIBER_PASSWORD
- JIGASI_TRANSCRIBER_RECORD_AUDIO
- JIGASI_TRANSCRIBER_REMOTE_CONFIG_URL
- JIGASI_TRANSCRIBER_SEND_TXT
- JIGASI_TRANSCRIBER_USER
- GC_PROJECT_ID
- GC_PRIVATE_KEY_ID
- GC_PRIVATE_KEY
- GC_CLIENT_EMAIL
- GC_CLIENT_ID
- GC_CLIENT_CERT_URL
- SHUTDOWN_REST_ENABLED
- SENTRY_DSN="${JIGASI_SENTRY_DSN:-0}"
- SENTRY_ENVIRONMENT
- SENTRY_RELEASE
- TZ
- USE_TRANSLATOR_IN_CONFERENCE
depends_on:
- prosody
networks:
meet.jitsi:
Loading…
Cancel
Save