Skip to content
This repository has been archived by the owner on Dec 27, 2020. It is now read-only.

Feature/all config #4

Merged
merged 14 commits into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,78 @@ ansible-playbook -i jitsi.ini jitsi.yml
ansible-playbook -K -i jitsi.ini jitsi.yml
```

## Configuration

_Jitsi Meet_ can be configured from this Ansible role. To do so, the
file `/etc/jitsi/meet/{{ jitsi_domain }}-config.js` from the upstream package will be replaced by a file managed by this
role.

To enable this behaviour, define the variable: `managed_jitsi_config` and set it to `yes`.

I.e. add the last line of the following example to your `jitsi.ini`:

```ini
# jitsi.ini
[jitsi]
my-jitsi-server.com jitsi_domain=my-jitsi-server.com certbot_admin_email=admin@my-jitsi-server.com
[jitsi:vars]
ansible_user=ubuntu
ansible_become=yes
apt_mirror=http://archive.ubuntu.com/ubuntu # change to the mirror you already use
certbot_enabled=yes
jitsi_nat=no
managed_jitsi_config=yes # manage your jitsi config through this role
```

Then, set all required config variables. The defaults can be found in
file `defaults/main.yml` of the role. All variables must be provided,
not just those that you want to override! Pay attention to empty
variables such as `analytics: {}`: due to the way Jitsi works, this has
to be an empty object, and cannot be null.

All settings, their values, usage and effect are documented
in [jitsi-meet config.js](https://github.com/jitsi/jitsi-meet/blob/stable/jitsi-meet_4101/config.js).

An most minimal example is:
```yaml
jitsi_config:
hosts:
domain: "{{ jitsi_domain }}"
muc: "conference.{{ jitsi_domain }}"
bosh: "//{{ jitsi_domain }}/http-bind"
clientNode: "http://jitsi.org/jitsimeet"
testing:
enableFirefoxMulticast: false
p2pTestMode: false
desktopSharingChromeExtId: null
desktopSharingChromeSources: [ 'screen', 'window', 'tab' ]
desktopSharingChromeMinExtVersion: '0.1'
channelLastN: -1
enableWelcomePage: true
enableUserRolesBasedOnToken: false
p2p:
enabled: true
stunServers:
- urls: 'stun:stun.l.google.com:19302'
- urls: 'stun:stun1.l.google.com:19302'
- urls: 'stun:stun2.l.google.com:19302'
preferH264: true
analytics: {}
deploymentInfo: {}
localRecording: {}
e2eping: {}
deploymentUrls: {}
```

NOTE:
The requirements of `config.js` may change at any moment when updating jitsi-meet, upstream is not very comunnicatative about this.
Check with any CHANGELOG and announcements of the _Jitsi Meet_ project about newly required values before you update.

NOTE:
The structure is case-sensitive and follows the exact variable settings in `config.js`.
So, for example, `webrctIceUdpDisable` is very different to `WebRTCIceUDPDisable`.
Jitsi is inconsistent in its naming of variables (e.g. it mixes `URL` and `Url` at random), so pay attention to the exact name.

## Uninstall

The following commands help you to remove the installation.
Expand Down
130 changes: 130 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,133 @@ jitsi_nat: false

nginx_modify_server_names_hash_bucket_size: true
nginx_server_names_hash_bucket_size: 64

# When true, this role will manage the `config.json` file and use the
# variables as provided below under `jitsi_config`.
managed_jitsi_config: false

# Refer to the online config file for documentation on how to set
# the variables, what they can contain and what they do.
# https://github.com/jitsi/jitsi-meet/blob/stable/jitsi-meet_4101/config.js
jitsi_config:
hosts:
domain: "{{ jitsi_domain }}"
muc: "conference.{{ jitsi_domain }}"
# anonymousdomain: guest.example.com
# authdomain: {{ jitsi_domain }}
# jirecon: jirecon.{{ jitsi_domain }}
# call_control: callcontrol.{{ jitsi_domain}}
# focus: focus.{{ jitsi_domain }}
bosh: "//{{ jitsi_domain }}/http-bind"
clientNode: "http://jitsi.org/jitsimeet"

testing:
enableFirefoxMulticast: false
p2pTestMode: false
# testMode: false
# noAutoPlayVideo: false
# webrtcIceUdpDisable: false
# webrtcIceTcpDisable: false
# disableAudioLevels: false
# startAudioOnly: false
# startAudioMuted: 10
# startWithAudioMuted: false
# startSilent: false
# resolution: 720
# constraints:
# video:
# aspectRatio: 16 / 9
# height:
# ideal: 720
# max: 720
# min: 240
# disableSimulcast: false
# enableLayerSuspension: false
# startVideoMuted: 10
# startWithVideoMuted: false
# preferH264: true
# disableH264: false
desktopSharingChromeExtId: null
desktopSharingChromeSources: [ 'screen', 'window', 'tab' ]
desktopSharingChromeMinExtVersion: '0.1'
# desktopSharingChromeDisabled: false
# desktopSharingFirefoxDisabled: false
# desktopSharingFrameRate:
# min: 5
# max: 5
# startScreenSharing: false

# fileRecordingsEnabled: false
# dropbox:
# appKey: "<APP_KEY>"
# redirectURI: "https://{{ jitsi_domain }}/subfolder/static/oauth.html"
# fileRecordingsServiceEnabled: false
# fileRecordingsServiceSharingEnabled: false

# liveStreamingEnabled: false
# transcribingEnabled: false
# autoCaptionOnRecord: false

channelLastN: -1
# disableRtx: false
# enableTcc: true
# enableRemb: false
# minParticipants: 2
# useStunTurn: true
# useIPv6: true
# openBridgeChannel: true

# useNicks: false
# requireDisplayName: true
enableWelcomePage: true
# enableClosePage: false
# disable1On1Mode: false
# defaultLanguage: 'en'
enableUserRolesBasedOnToken: false
# enableFeaturesBasedOnToken: false
# lockRoomGuestEnabled: false
# roomPasswordNumberOfDigits: 10
# default: roomPasswordNumberOfDigits: false
# noticeMessage: ''
# enableCalendarIntegration: false

# gatherStats: false
# callStatsId: ''
# callStatsSecret: ''
# enableDisplayNameInStats: false
# enableEmailInStats: false

# disableThirdPartyRequests: false
p2p:
enabled: true
# useStunTurn: true
stunServers:
- urls: 'stun:stun.l.google.com:19302'
- urls: 'stun:stun1.l.google.com:19302'
- urls: 'stun:stun2.l.google.com:19302'
# iceTransportPolicy: 'all'
preferH264: true
# disableH264: false
# backToP2PDelay: 5
analytics: {}
# googleAnalyticsTrackingId: 'your-tracking-id-UA-123456-1'
# amplitudeAPPKey: '<APP_KEY>'
# scriptURLs:
# - "libs/analytics-ga.min.js"
# - "https://example.com/my-custom-analytics.js"
deploymentInfo: {}
# shard: "shard1"
# region: "europe"
# userRegion: "asia"
localRecording: {}
# enabled: true
# format: 'flac'
e2eping: {}
# pingInterval: 10000
# analyticsInterval: 60000
# DesktopSharingSourceDevice: 'sample-id-or-label'
# disableDeepLinking: false
# disableLocalVideoFlip: false
deploymentUrls: {}
# userDocumentationURL: 'https:#docs.example.com/video-meetings.html'
# downloadAppsUrl: 'https:#docs.example.com/our-apps.html'
6 changes: 6 additions & 0 deletions tasks/jitsi/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: "Override jitsi config.js"
template:
src: config.js.j2
backup: yes
force: yes
dest: /etc/jitsi/meet/{{ jitsi_domain }}-config.js
4 changes: 4 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
name: Install Jitsi
import_tasks: jitsi/debian.yml

- when: managed_jitsi_config|bool
name: Configure Jitsi
import_tasks: jitsi/config.yml

- when: (certbot_enabled|bool) and (ansible_os_family|lower == 'debian')
name: Update nginx configuration for Certbot
import_tasks: certbot/debian.yml
2 changes: 2 additions & 0 deletions templates/config.js.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* {{ ansible_managed }} */
var config = {{ jitsi_config | to_nice_json }};