jibri: move xmpp config for easier override (#1748)

* jibri: move xmpp config for easier override

* fix order of operations
pull/1761/head
Aaron van Meerten 8 months ago committed by GitHub
parent 452f5ba26c
commit 360361e5ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 80
      jibri/rootfs/defaults/jibri.conf
  2. 77
      jibri/rootfs/defaults/xmpp.conf
  3. 1
      jibri/rootfs/etc/cont-init.d/10-config

@ -1,29 +1,12 @@
{{ $JIBRI_XMPP_USER := .Env.JIBRI_XMPP_USER | default "jibri" -}}
{{ $JIBRI_RECORDER_USER := .Env.JIBRI_RECORDER_USER | default "recorder" -}}
{{ $JIBRI_USAGE_TIMEOUT := .Env.JIBRI_USAGE_TIMEOUT | default "0" -}}
{{ $JIBRI_RECORDING_RESOLUTION := .Env.JIBRI_RECORDING_RESOLUTION | default "1280x720" -}}
{{ $JIBRI_RECORDING_VIDEO_ENCODE_PRESET := .Env.JIBRI_RECORDING_VIDEO_ENCODE_PRESET | default "veryfast" -}}
{{ $JIBRI_RECORDING_CONSTANT_RATE_FACTOR := .Env.JIBRI_RECORDING_CONSTANT_RATE_FACTOR | default 25 -}}
{{ $JIBRI_RECORDING_FRAMERATE := .Env.JIBRI_RECORDING_FRAMERATE | default 30 -}}
{{ $JIBRI_RECORDING_QUEUE_SIZE := .Env.JIBRI_RECORDING_QUEUE_SIZE | default 4096 -}}
{{ $JIBRI_RECORDING_STREAMING_MAX_BITRATE := .Env.JIBRI_RECORDING_STREAMING_MAX_BITRATE | default 2976 -}}
{{ $JIBRI_BREWERY_MUC := .Env.JIBRI_BREWERY_MUC | default "jibribrewery" -}}
{{ $JIBRI_SINGLE_USE_MODE := .Env.JIBRI_SINGLE_USE_MODE | default "false" -}}
{{ $XMPP_AUTH_DOMAIN := .Env.XMPP_AUTH_DOMAIN | default "auth.meet.jitsi" -}}
{{ $XMPP_DOMAIN := .Env.XMPP_DOMAIN | default "meet.jitsi" -}}
{{ $XMPP_INTERNAL_MUC_DOMAIN := .Env.XMPP_INTERNAL_MUC_DOMAIN | default "internal-muc.meet.jitsi" -}}
{{ $XMPP_MUC_DOMAIN := .Env.XMPP_MUC_DOMAIN | default "muc.meet.jitsi" -}}
{{ $XMPP_MUC_DOMAIN_PREFIX := (split "." $XMPP_MUC_DOMAIN)._0 -}}
{{ $JIBRI_STRIP_DOMAIN_JID := .Env.JIBRI_STRIP_DOMAIN_JID | default $XMPP_MUC_DOMAIN_PREFIX -}}
{{ $XMPP_RECORDER_DOMAIN := .Env.XMPP_RECORDER_DOMAIN | default "recorder.meet.jitsi" -}}
{{ $XMPP_TRUST_ALL_CERTS := .Env.XMPP_TRUST_ALL_CERTS | default "true" | toBool -}}
{{ $XMPP_PORT := .Env.XMPP_PORT | default "5222" -}}
{{ $XMPP_SERVER := .Env.XMPP_SERVER | default "xmpp.meet.jitsi" -}}
{{ $XMPP_SERVERS := splitList "," $XMPP_SERVER -}}
{{ $STATSD_HOST := .Env.JIBRI_STATSD_HOST | default "localhost" -}}
{{ $STATSD_PORT := .Env.JIBRI_STATSD_PORT | default "8125" -}}
{{/* assign env from context, preserve during range when . is re-assigned */}}
{{ $ENV := .Env -}}
jibri {
// A unique identifier for this Jibri
@ -45,67 +28,6 @@ jibri {
{{ end -}}
}
{{ end -}}
xmpp {
// See example_xmpp_envs.conf for an example of what is expected here
environments = [
{{ range $index, $element := $XMPP_SERVERS -}}
{{ $SERVER := splitn ":" 2 $element }}
{
// A user-friendly name for this environment
name = "{{ $ENV.XMPP_ENV_NAME }}-{{$index}}"
// A list of XMPP server hosts to which we'll connect
xmpp-server-hosts = [
"{{ $SERVER._0 }}"
]
// The base XMPP domain
xmpp-domain = "{{ $XMPP_DOMAIN }}"
{{ if $ENV.PUBLIC_URL -}}
// An (optional) base url the Jibri will join if it is set
base-url = "{{ $ENV.PUBLIC_URL }}"
{{ end -}}
// The MUC we'll join to announce our presence for
// recording and streaming services
control-muc {
domain = "{{ $XMPP_INTERNAL_MUC_DOMAIN }}"
room-name = "{{ $JIBRI_BREWERY_MUC }}"
nickname = "{{ $ENV.JIBRI_INSTANCE_ID }}"
}
// The login information for the control MUC
control-login {
domain = "{{ $XMPP_AUTH_DOMAIN }}"
port = "{{ $SERVER._1 | default $XMPP_PORT }}"
username = "{{ $JIBRI_XMPP_USER }}"
password = "{{ $ENV.JIBRI_XMPP_PASSWORD }}"
}
// The login information the selenium web client will use
call-login {
domain = "{{ $XMPP_RECORDER_DOMAIN }}"
username = "{{ $JIBRI_RECORDER_USER }}"
password = "{{ $ENV.JIBRI_RECORDER_PASSWORD }}"
}
// The value we'll strip from the room JID domain to derive
// the call URL
strip-from-room-domain = "{{ $JIBRI_STRIP_DOMAIN_JID }}."
// How long Jibri sessions will be allowed to last before
// they are stopped. A value of 0 allows them to go on
// indefinitely
usage-timeout = "{{ $JIBRI_USAGE_TIMEOUT }}"
// Whether or not we'll automatically trust any cert on
// this XMPP domain
trust-all-xmpp-certs = {{ $XMPP_TRUST_ALL_CERTS }}
}
{{ end }}
]
}
}
recording {
recordings-directory = "{{ .Env.JIBRI_RECORDING_DIR | default "/config/recordings" }}"
@ -162,3 +84,5 @@ jibri {
}
{{ end -}}
}
include "xmpp.conf"

@ -0,0 +1,77 @@
{{ $JIBRI_BREWERY_MUC := .Env.JIBRI_BREWERY_MUC | default "jibribrewery" -}}
{{ $XMPP_MUC_DOMAIN := .Env.XMPP_MUC_DOMAIN | default "muc.meet.jitsi" -}}
{{ $XMPP_MUC_DOMAIN_PREFIX := (split "." $XMPP_MUC_DOMAIN)._0 -}}
{{ $JIBRI_STRIP_DOMAIN_JID := .Env.JIBRI_STRIP_DOMAIN_JID | default $XMPP_MUC_DOMAIN_PREFIX -}}
{{ $JIBRI_RECORDER_USER := .Env.JIBRI_RECORDER_USER | default "recorder" -}}
{{ $JIBRI_USAGE_TIMEOUT := .Env.JIBRI_USAGE_TIMEOUT | default "0" -}}
{{ $JIBRI_XMPP_USER := .Env.JIBRI_XMPP_USER | default "jibri" -}}
{{ $XMPP_AUTH_DOMAIN := .Env.XMPP_AUTH_DOMAIN | default "auth.meet.jitsi" -}}
{{ $XMPP_DOMAIN := .Env.XMPP_DOMAIN | default "meet.jitsi" -}}
{{ $XMPP_INTERNAL_MUC_DOMAIN := .Env.XMPP_INTERNAL_MUC_DOMAIN | default "internal-muc.meet.jitsi" -}}
{{ $XMPP_RECORDER_DOMAIN := .Env.XMPP_RECORDER_DOMAIN | default "recorder.meet.jitsi" -}}
{{ $XMPP_TRUST_ALL_CERTS := .Env.XMPP_TRUST_ALL_CERTS | default "true" | toBool -}}
{{ $XMPP_PORT := .Env.XMPP_PORT | default "5222" -}}
{{ $XMPP_SERVER := .Env.XMPP_SERVER | default "xmpp.meet.jitsi" -}}
{{ $XMPP_SERVERS := splitList "," $XMPP_SERVER -}}
{{/* assign env from context, preserve during range when . is re-assigned */}}
{{ $ENV := .Env -}}
jibri.api.xmpp.environments = [
// See example_xmpp_envs.conf for an example of what is expected here
{{ range $index, $element := $XMPP_SERVERS -}}
{{ $SERVER := splitn ":" 2 $element }}
{
// A user-friendly name for this environment
name = "{{ $ENV.XMPP_ENV_NAME }}-{{$index}}"
// A list of XMPP server hosts to which we'll connect
xmpp-server-hosts = [
"{{ $SERVER._0 }}"
]
// The base XMPP domain
xmpp-domain = "{{ $XMPP_DOMAIN }}"
{{ if $ENV.PUBLIC_URL -}}
// An (optional) base url the Jibri will join if it is set
base-url = "{{ $ENV.PUBLIC_URL }}"
{{ end -}}
// The MUC we'll join to announce our presence for
// recording and streaming services
control-muc {
domain = "{{ $XMPP_INTERNAL_MUC_DOMAIN }}"
room-name = "{{ $JIBRI_BREWERY_MUC }}"
nickname = "{{ $ENV.JIBRI_INSTANCE_ID }}"
}
// The login information for the control MUC
control-login {
domain = "{{ $XMPP_AUTH_DOMAIN }}"
port = "{{ $SERVER._1 | default $XMPP_PORT }}"
username = "{{ $JIBRI_XMPP_USER }}"
password = "{{ $ENV.JIBRI_XMPP_PASSWORD }}"
}
// The login information the selenium web client will use
call-login {
domain = "{{ $XMPP_RECORDER_DOMAIN }}"
username = "{{ $JIBRI_RECORDER_USER }}"
password = "{{ $ENV.JIBRI_RECORDER_PASSWORD }}"
}
// The value we'll strip from the room JID domain to derive
// the call URL
strip-from-room-domain = "{{ $JIBRI_STRIP_DOMAIN_JID }}."
// How long Jibri sessions will be allowed to last before
// they are stopped. A value of 0 allows them to go on
// indefinitely
usage-timeout = "{{ $JIBRI_USAGE_TIMEOUT }}"
// Whether or not we'll automatically trust any cert on
// this XMPP domain
trust-all-xmpp-certs = {{ $XMPP_TRUST_ALL_CERTS }}
}
{{ end }}
]

@ -69,6 +69,7 @@ fi
# always recreate configs
tpl /defaults/jibri.conf > /etc/jitsi/jibri/jibri.conf
tpl /defaults/xmpp.conf > /etc/jitsi/jibri/xmpp.conf
tpl /defaults/logging.properties > /etc/jitsi/jibri/logging.properties
tpl /defaults/xorg-video-dummy.conf > /etc/jitsi/jibri/xorg-video-dummy.conf

Loading…
Cancel
Save