Skip to content

Commit

Permalink
Update Jitsi to build 5142
Browse files Browse the repository at this point in the history
This supersedes/fixes-up this Pull Request:
#719

The Jitsi Web and JVB containers now (in build 5142) always
start by bulding their own default configuration
(`config.js` and `sip-communicator.properties`, respectively).

The fact that we were generating these files ourselves was no longer of use,
because our configuration was thrown away in favor of the one created
by the containers on startup.

With this commit, we're completely redoing things. We no longer
generate these configuration files. We try to pass the proper
environment variables, so that Jitsi services can generate the
configuration files themselves.

Besides that, we try to use the "custom configuration" mechanism
provided by Jitsi Web and Jitsi JVB (`custom-config.js` and
`custom-sip-communicator.properties`, respectively), so that
we and our users can inject additional configuration.

Some configuration options we had are gone now. Others are no longer
controllable via variables and need to be injected using
the `_config_extension` variables that we provide.

The validation logic that is part of the role should take care
to inform people about how to upgrade (if they're using some custom
configuration, which needs special care now). Most users should not
have to do anything special though.
  • Loading branch information
spantaleev committed Nov 27, 2020
1 parent 6e93017 commit fa76128
Show file tree
Hide file tree
Showing 12 changed files with 374 additions and 688 deletions.
43 changes: 16 additions & 27 deletions docs/configuring-playbook-jitsi.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,44 +91,33 @@ matrix_jitsi_jvb_container_extra_arguments:

## (Optional) Fine tune Jitsi

You may want to suspend unused video layers until they are requested again, to save up resources on both server and clients.
Read more on this feature [here](https://jitsi.org/blog/new-off-stage-layer-suppression-feature/)
For this add this line to your `inventory/host_vars/matrix.DOMAIN/vars.yml` configuration:
Sample **additional** `inventory/host_vars/matrix.DOMAIN/vars.yml` configuration to save up resources (explained below):

```yaml
matrix_jitsi_web_config_enableLayerSuspension: true
```
matrix_jitsi_web_custom_config_extension: |
config.enableLayerSuspension = true;
You may wish to disable audio levels to avoid excessive refresh of the client-side page and decrease the CPU consumption involved.
For this add this line to your `inventory/host_vars/matrix.DOMAIN/vars.yml` configuration:
config.disableAudioLevels = true;
```yaml
matrix_jitsi_web_config_disableAudioLevels: true
# Limit the number of video feeds forwarded to each client
config.channelLastN = 4;
matrix_jitsi_web_config_resolution_width_ideal_and_max: 480
matrix_jitsi_web_config_resolution_height_ideal_and_max: 240
```

You may want to limit the number of video feeds forwarded to each client, to save up resources on both server and clients. As clients’ bandwidth and CPU may not bear the load, use this setting to avoid lag and crashes.
This feature is found by default in other webconference applications such as Office 365 Teams (limit is set to 4).
Read how it works [here](https://github.com/jitsi/jitsi-videobridge/blob/master/doc/last-n.md) and performance evaluation on this [study](https://jitsi.org/wp-content/uploads/2016/12/nossdav2015lastn.pdf)
You may want to **suspend unused video layers** until they are requested again, to save up resources on both server and clients.
Read more on this feature [here](https://jitsi.org/blog/new-off-stage-layer-suppression-feature/)
For this add this line to your `inventory/host_vars/matrix.DOMAIN/vars.yml` configuration:

```yaml
matrix_jitsi_web_config_channelLastN: 4
```
You may wish to **disable audio levels** to avoid excessive refresh of the client-side page and decrease the CPU consumption involved.

To enable the variables that allow you to manage the video configuration you must add the following line to your `inventory/host_vars/matrix.DOMAIN/vars.yml` configuration:

```yaml
matrix_jitsi_web_config_constraints_enabled: true
```
You may want to **limit the number of video feeds forwarded to each client**, to save up resources on both server and clients. As clients’ bandwidth and CPU may not bear the load, use this setting to avoid lag and crashes.
This feature is found by default in other webconference applications such as Office 365 Teams (limit is set to 4).
Read how it works [here](https://github.com/jitsi/jitsi-videobridge/blob/master/doc/last-n.md) and performance evaluation on this [study](https://jitsi.org/wp-content/uploads/2016/12/nossdav2015lastn.pdf).

You may want to limit the maximum video resolution, to save up resources on both server and clients.
For example, to set resolution to 480.
For this add this two lines to your `inventory/host_vars/matrix.DOMAIN/vars.yml` configuration:
You may want to **limit the maximum video resolution**, to save up resources on both server and clients.

```yaml
matrix_jitsi_web_config_constraints_video_height_ideal: 480
matrix_jitsi_web_config_constraints_video_height_max: 480
```

## Apply changes

Expand Down
114 changes: 92 additions & 22 deletions roles/matrix-jitsi/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ matrix_jitsi_enable_auth: false
matrix_jitsi_enable_guests: false
matrix_jitsi_enable_recording: true
matrix_jitsi_enable_transcriptions: true
matrix_jitsi_enable_p2p: true

# Authentication type, must be one of internal, jwt or ldap. Currently only
# internal and ldap are supported by this playbook.
Expand Down Expand Up @@ -51,7 +52,7 @@ matrix_jitsi_jibri_recorder_password: ''

matrix_jitsi_enable_lobby: false

matrix_jitsi_container_image_tag: "stable-4857"
matrix_jitsi_container_image_tag: "stable-5142"

matrix_jitsi_web_docker_image: "docker.io/jitsi/web:{{ matrix_jitsi_container_image_tag }}"
matrix_jitsi_web_docker_image_force_pull: "{{ matrix_jitsi_web_docker_image.endswith(':latest') }}"
Expand All @@ -77,42 +78,86 @@ matrix_jitsi_web_container_extra_arguments: []
# List of systemd services that matrix-jitsi-web.service depends on
matrix_jitsi_web_systemd_required_services_list: ['docker.service']

matrix_jitsi_web_config_defaultLanguage: 'en'
matrix_jitsi_web_config_start_with_audio_muted: false
matrix_jitsi_web_config_start_with_video_muted: false
matrix_jitsi_web_config_testing_enableFirefoxSimulcast: false
matrix_jitsi_web_config_testing_p2pTestMode: false

# Some variables controlling the interface of Jitsi Web.
# These get applied to `templates/web/interface_config.js.j2`.
#
# Besides this, you can also use `matrix_jitsi_web_custom_interface_config_extension`
# to define any other configuration option.
matrix_jitsi_web_interface_config_lang_detection: false
matrix_jitsi_web_interface_config_show_jitsi_watermark: true
matrix_jitsi_web_interface_config_jitsi_watermark_link: "https://jitsi.org"
matrix_jitsi_web_interface_config_show_brand_watermark: false
matrix_jitsi_web_interface_config_brand_watermark_link: ""
matrix_jitsi_web_interface_config_show_watermark_for_guests: true
matrix_jitsi_web_interface_config_generate_room_names_on_welcome_page: true
matrix_jitsi_web_interface_config_display_welcome_page_content: true
matrix_jitsi_web_interface_config_app_name: "Jitsi Meet"
matrix_jitsi_web_interface_config_native_app_name: "Jitsi Meet"
matrix_jitsi_web_interface_config_provider_name: "Jitsi"
matrix_jitsi_web_interface_config_invitation_powered_by: true
matrix_jitsi_web_interface_config_show_powered_by: false
matrix_jitsi_web_interface_config_disable_transcription_subtitles: false
matrix_jisti_web_interface_config_show_deep_linking_image: false

# Jitsi_web Fine Tune default values.
# Useful to manage bandwidth and CPU consumption in server and client side
matrix_jitsi_web_config_disableAudioLevels: false
matrix_jitsi_web_config_enableLayerSuspension: false
matrix_jitsi_web_config_channelLastN: -1
# If 'matrix_jitsi_web_config_constraints_enabled: false'
# the video constraints will be disabled and will take the default values of jitsi
matrix_jitsi_web_config_constraints_enabled: false
# This settings work if matrix_jitsi_web_config_constraints_enabled: true
# See their definitions in config.js.j2 (templates / web)
matrix_jitsi_web_config_constraints_video_aspectRatio: 16 / 9
matrix_jitsi_web_config_constraints_video_height_ideal: 720
matrix_jitsi_web_config_constraints_video_height_max: 720
matrix_jitsi_web_config_constraints_video_height_min: 240
# Custom configuration to be injected into `interface_config.js`, passed to Jitsi Web.
# This configuration gets appended to the final interface configuration that Jitsi Web uses.
#
# Note: not to be confused with `matrix_jitsi_web_custom_config_extension`.
#
# For interface configuration, the flow is like this:
# - the contents of `templates/web/interface_config.js.j2` is generated (based on various `matrix_jitsi_web_interface_config_*` variables you see in this file)
# - the contents of `matrix_jitsi_web_custom_interface_config_extension` is appended and can define new settings or override defaults.
#
# Example:
# matrix_jitsi_web_custom_interface_config_extension: |
# interfaceConfig.CONNECTION_INDICATOR_AUTO_HIDE_ENABLED = false;
# interfaceConfig.DISABLE_VIDEO_BACKGROUND = true;
matrix_jitsi_web_custom_interface_config_extension: ''


# Controls after which participant audio will be muted. If not specified, defaults to Jitsi's default value (likely 10)
matrix_jitsi_web_config_start_audio_muted_after_nth_participant: ~
# Controls after which participant video will be muted. If not specified, defaults to Jitsi's default value (likely 10)
matrix_jitsi_web_config_start_video_muted_after_nth_participant: ~

matrix_jitsi_web_config_defaultLanguage: 'en'

# Ideal and also maximum resolution width. If not specified, defaults to Jitsi's default value (likely 1280)
matrix_jitsi_web_config_resolution_width_ideal_and_max: ~
# Minimum resolution width. If not specified, defaults to Jitsi's default value (likely 320)
matrix_jitsi_web_config_resolution_width_min: ~
# Ideal and also maximum resolution height. If not specified, defaults to Jitsi's default value (likely 720)
matrix_jitsi_web_config_resolution_height_ideal_and_max: ~
# Minimum resolution height. If not specified, defaults to Jitsi's default value (likely 180)
matrix_jitsi_web_config_resolution_height_min: ~

# Custom configuration to be injected into `custom-config.js`, passed to Jitsi Web.
# This configuration gets appended to the final configuration that Jitsi Web uses.
#
# Note: not to be confused with `matrix_jitsi_web_custom_interface_config_extension`.
#
# The flow is like this:
# - some default configuration is automatically generated based on the environment variables passed to the Jitsi Web container
# - the contents of `custom-config.js` is appended to it (see `templates/web/custom-config.js.j2`)
# - said `custom-config.js` contains your custom contents specified in `matrix_jitsi_web_custom_config_extension`.
#
# Example:
# matrix_jitsi_web_custom_config_extension: |
# if (!config.hasOwnProperty('testing')) config.testing = {};
# config.testing.p2pTestMode = true
matrix_jitsi_web_custom_config_extension: ''

# Additional environment variables to pass to the Jitsi Web container.
# You can use this to further influence the default configuration generated by the Jitsi Web container on every startup.
# Besides influencing the final configuration by passing environment variables, you can also inject custom configuration
# by using `matrix_jitsi_web_custom_config_extension`.
#
# Example:
# matrix_jitsi_web_environment_variables_extension: |
# ENABLE_FILE_RECORDING_SERVICE=1
# DROPBOX_APPKEY=something
# DROPBOX_REDIRECT_URI=something
matrix_jitsi_web_environment_variables_extension: ''


matrix_jitsi_prosody_docker_image: "docker.io/jitsi/prosody:{{ matrix_jitsi_container_image_tag }}"
matrix_jitsi_prosody_docker_image_force_pull: "{{ matrix_jitsi_prosody_docker_image.endswith(':latest') }}"
Expand Down Expand Up @@ -168,6 +213,31 @@ matrix_jitsi_jvb_brewery_muc: jvbbrewery
matrix_jitsi_jvb_rtp_udp_port: 10000
matrix_jitsi_jvb_rtp_tcp_port: 4443

# Custom configuration to be injected into `custom-sip-communicator.properties`, passed to Jitsi JVB.
# This configuration gets appended to the final configuration that Jitsi JVB uses.
#
# The flow is like this:
# - some default configuration is automatically generated based on the environment variables passed to the Jitsi JVB container
# - the contents of `custom-sip-communicator.properties` is appended to it (see `templates/jvb/custom-sip-communicator.properties.j2`)
# - said `custom-sip-communicator.properties` contains your custom contents specified in `matrix_jitsi_jvb_custom_config_extension`.
#
# Example:
# matrix_jitsi_jvb_custom_config_extension: |
# org.jitsi.videobridge.xmpp.user.shard.DISABLE_CERTIFICATE_VERIFICATION=false
# org.jitsi.videobridge.ENABLE_STATISTICS=false
matrix_jitsi_jvb_custom_config_extension: ''

# Additional environment variables to pass to the Jitsi JVB container.
# You can use this to further influence the default configuration generated by the Jitsi JVB container on every startup.
# Besides influencing the final configuration by passing environment variables, you can also inject custom configuration
# by using `matrix_jitsi_jvb_custom_config_extension`.
#
# Example:
# matrix_jitsi_jvb_environment_variables_extension: |
# SOME_VARIABLE=1
# ANOTHER_VARIABLE=something
matrix_jitsi_jvb_environment_variables_extension: ''

# Controls whether the matrix-jitsi-jvb container exposes its RTP UDP port (udp/10000 in the container).
#
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:10000"), or empty string to not expose.
Expand Down
2 changes: 1 addition & 1 deletion roles/matrix-jitsi/tasks/setup_jitsi_jvb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
dest: "{{ matrix_jitsi_jvb_config_path }}/{{ item }}"
mode: 0644
with_items:
- sip-communicator.properties
- custom-sip-communicator.properties
- logging.properties
when: matrix_jitsi_enabled|bool

Expand Down
2 changes: 1 addition & 1 deletion roles/matrix-jitsi/tasks/setup_jitsi_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
dest: "{{ matrix_jitsi_web_config_path }}/{{ item }}"
mode: 0644
with_items:
- config.js
- custom-config.js
- interface_config.js
when: matrix_jitsi_enabled|bool

Expand Down
21 changes: 21 additions & 0 deletions roles/matrix-jitsi/tasks/validate_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,24 @@
- "matrix_jitsi_jicofo_component_secret"
- "matrix_jitsi_jicofo_auth_password"
- "matrix_jitsi_jvb_auth_password"

- name: (Deprecation) Catch and report renamed settings
fail:
msg: >-
Your configuration contains a variable, which now has a different name.
Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
when: "item.old in vars"
with_items:
- {'old': 'matrix_jitsi_web_config_constraints_enabled', 'new': '<Now unnecessary. Constraints are always applied automatically>'}
- {'old': 'matrix_jitsi_web_config_constraints_video_aspectRatio', 'new': '<Not applicable anymore>'}
- {'old': 'matrix_jitsi_web_config_constraints_video_height_ideal', 'new': 'matrix_jitsi_web_config_resolution_height_ideal_and_max'}
- {'old': 'matrix_jitsi_web_config_constraints_video_height_max', 'new': 'matrix_jitsi_web_config_resolution_height_ideal_and_max'}
- {'old': 'matrix_jitsi_web_config_constraints_video_height_min', 'new': 'matrix_jitsi_web_config_resolution_height_min'}
- {'old': 'matrix_jitsi_web_config_disableAudioLevels', 'new': '<Can be set by using matrix_jitsi_web_custom_config_extension. Example in docs/configuring-playbook-jitsi.md>'}
- {'old': 'matrix_jitsi_web_config_enableLayerSuspension', 'new': '<Can be set by using matrix_jitsi_web_custom_config_extension. Example in docs/configuring-playbook-jitsi.md>'}
- {'old': 'matrix_jitsi_web_config_channelLastN', 'new': '<Can be set by using matrix_jitsi_web_custom_config_extension. Example in docs/configuring-playbook-jitsi.md>'}
- {'old': 'matrix_jitsi_web_config_testing_p2pTestMode', 'new': '<Can be set by using matrix_jitsi_web_custom_config_extension>'}
- {'old': 'matrix_jitsi_web_config_start_with_audio_muted', 'new': '<Superseded by matrix_jitsi_web_config_start_audio_muted_after_nth_participant>'}
- {'old': 'matrix_jitsi_web_config_start_with_video_muted', 'new': '<Superseded by matrix_jitsi_web_config_start_video_muted_after_nth_participant>'}
- {'old': 'matrix_jitsi_web_interface_config_show_watermark_for_guests', 'new': '<Not applicable anymore>'}
- {'old': 'matrix_jitsi_web_interface_config_invitation_powered_by', 'new': '<Not applicable anymore>'}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
org.jitsi.videobridge.xmpp.user.shard.DISABLE_CERTIFICATE_VERIFICATION=true

org.jitsi.videobridge.ENABLE_STATISTICS=true
org.jitsi.videobridge.STATISTICS_TRANSPORT=muc
org.jitsi.videobridge.STATISTICS_INTERVAL=5000

{{ matrix_jitsi_jvb_custom_config_extension }}
19 changes: 19 additions & 0 deletions roles/matrix-jitsi/templates/jvb/env.j2
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
JVB_AUTH_PASSWORD={{ matrix_jitsi_jvb_auth_password }}
JVB_TCP_PORT={{ matrix_jitsi_jvb_rtp_tcp_port }}
JVB_PORT={{ matrix_jitsi_jvb_rtp_udp_port }}
JVB_AUTH_USER={{ matrix_jitsi_jvb_auth_user }}
JVB_AUTH_PASSWORD={{ matrix_jitsi_jvb_auth_password }}
JVB_BREWERY_MUC={{ matrix_jitsi_jvb_brewery_muc }}

XMPP_SERVER={{ matrix_jitsi_xmpp_server }}
XMPP_AUTH_DOMAIN={{ matrix_jitsi_xmpp_auth_domain }}
XMPP_INTERNAL_MUC_DOMAIN={{ matrix_jitsi_xmpp_internal_muc_domain }}

HOSTNAME=matrix-jitsi-jvb

{% if matrix_jitsi_jvb_stun_servers|length > 0 %}
JVB_STUN_SERVERS={{ matrix_jitsi_jvb_stun_servers|join(',') }}
{% endif %}

PUBLIC_URL={{ matrix_jitsi_web_public_url }}

{{ matrix_jitsi_jvb_environment_variables_extension }}
19 changes: 0 additions & 19 deletions roles/matrix-jitsi/templates/jvb/sip-communicator.properties.j2

This file was deleted.

Loading

0 comments on commit fa76128

Please sign in to comment.