Skip to content

Commit

Permalink
🎨 implement remaining change requests from jitsi#1343
Browse files Browse the repository at this point in the history
  • Loading branch information
M4GNV5 authored and zobadaniel committed Jul 30, 2024
1 parent 35cad4b commit 79e7b5a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
6 changes: 3 additions & 3 deletions jigasi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ version: '3.5'
services:
# SIP gateway (audio)
jigasi:
image: jitsi/jigasi:${JITSI_IMAGE_VERSION:-unstable}
#image: jitsi/jigasi:${JITSI_IMAGE_VERSION:-unstable}
build: ./jigasi
restart: ${RESTART_POLICY:-unless-stopped}
ports:
- '${JIGASI_PORT_MIN:-20000}-${JIGASI_PORT_MAX:-20050}:${JIGASI_PORT_MIN:-20000}-${JIGASI_PORT_MAX:-20050}/udp'
Expand All @@ -23,8 +24,6 @@ services:
- AUTOSCALER_URL
- BOSH_URL_PATTERN
- ENABLE_AUTH
- ENABLE_GCLOUD_TRANSCRIPTION
- ENABLE_VOSK_TRANSCRIPTION
- ENABLE_GUESTS
- XMPP_AUTH_DOMAIN
- XMPP_GUEST_DOMAIN
Expand Down Expand Up @@ -55,6 +54,7 @@ services:
- JIGASI_SIP_KEEP_ALIVE_METHOD
- JIGASI_ENABLE_SDES_SRTP
- ENABLE_TRANSCRIPTIONS
- JIGASI_TRANSCRIBER_BACKEND
- JIGASI_TRANSCRIBER_ADVERTISE_URL
- JIGASI_TRANSCRIBER_RECORD_AUDIO
- JIGASI_TRANSCRIBER_SEND_TXT
Expand Down
8 changes: 3 additions & 5 deletions jigasi/rootfs/defaults/sip-communicator.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{ $ENABLE_TRANSCRIPTIONS := .Env.ENABLE_TRANSCRIPTIONS | default "0" | toBool -}}
{{ $JIGASI_TRANSCRIBER_BACKEND := .Env.JIGASI_TRANSCRIBER_BACKEND | default "google" -}}
{{ $JIGASI_BREWERY_MUC := .Env.JIGASI_BREWERY_MUC | default "jigasibrewery" -}}
{{ $JIGASI_XMPP_USER := .Env.JIGASI_XMPP_USER | default "jigasi" -}}
{{ $JIGASI_JVB_TIMEOUT := .Env.JIGASI_JVB_TIMEOUT | default "30000" -}}
Expand All @@ -15,9 +16,6 @@
{{ $XMPP_SERVERS := splitList "," $XMPP_SERVER -}}
{{ $SHUTDOWN_REST_ENABLED := .Env.SHUTDOWN_REST_ENABLED | default "false" | toBool -}}
{{ $DISABLE_SIP := .Env.JIGASI_DISABLE_SIP | default "false" | toBool -}}
{{ $ENABLE_VOSK_TRANSCRIPTION := .Env.ENABLE_VOSK_TRANSCRIPTION | default "false" | toBool -}}
{{ $ENABLE_GCLOUD_TRANSCRIPTION := .Env.ENABLE_GCLOUD_TRANSCRIPTION | default "false" | toBool -}}
{{ $VOSK_SERVER := .Env.VOSK_SERVER}}
{{/* assign env from context, preserve during range when . is re-assigned */}}
{{ $TRUSTED_DOMAIN_LIST := .Env.JIGASI_TRUSTED_DOMAINS | default "" -}}
{{ $TRUSTED_DOMAINS := splitList "," $TRUSTED_DOMAIN_LIST -}}
Expand Down Expand Up @@ -182,13 +180,13 @@ 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 -}}

{{ if $ENABLE_VOSK_TRANSCRIPTION }}
{{ if eq $JIGASI_TRANSCRIBER_BACKEND "vosk" }}
#VOSK transcription config
org.jitsi.jigasi.transcription.customService=org.jitsi.jigasi.transcription.VoskTranscriptionService
org.jitsi.jigasi.transcription.vosk.websocket_url={{ .Env.VOSK_SERVER }}
{{ end }}
{{ end -}}

{{ if .Env.JIGASI_SIP_DEFAULT_ROOM }}
org.jitsi.jigasi.DEFAULT_JVB_ROOM_NAME={{ .Env.JIGASI_SIP_DEFAULT_ROOM }}
Expand Down
8 changes: 3 additions & 5 deletions jigasi/rootfs/etc/cont-init.d/10-config
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,10 @@ mkdir -pm777 /tmp/transcripts
chown jigasi:jitsi /tmp/transcripts

# Create Google Cloud Credentials
if [[ $ENABLE_TRANSCRIPTIONS -eq 1 || $ENABLE_TRANSCRIPTIONS == "true" ]]; then
if [[ ($ENABLE_TRANSCRIPTIONS -eq 1 || $ENABLE_TRANSCRIPTIONS == "true") && (-z $JIGASI_TRANSCRIBER_BACKEND || $JIGASI_TRANSCRIBER_BACKEND == "google") ]]; 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 [[ $ENABLE_VOSK_TRANSCRIPTION -eq 0 || $ENABLE_VOSK_TRANSCRIPTION == "false" ]]; then
echo 'Transcriptions: One or more environment variables are undefined'
exit 1
fi
echo 'Transcriptions: One or more google cloud environment variables are undefined'
exit 1
fi

jq -n \
Expand Down
2 changes: 1 addition & 1 deletion jigasi/rootfs/etc/services.d/jigasi/run
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/with-contenv bash
if [[ -f /config/key.json ]]; then
if [[ -z $JIGASI_TRANSCRIBER_BACKEND || $JIGASI_TRANSCRIBER_BACKEND == "google" ]]; then
export GOOGLE_APPLICATION_CREDENTIALS=/config/key.json
fi

Expand Down

0 comments on commit 79e7b5a

Please sign in to comment.