summaryrefslogtreecommitdiff
path: root/roles/apps/jitsi
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-07-14 01:16:07 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-07-14 01:16:07 +0200
commiteb148a3408331b71284c01c6cea52938de6cc5ea (patch)
tree2622b516fdbf7529a705ad42fa77e6f5400813de /roles/apps/jitsi
parentadd testhosts for elevate obs workstations (diff)
jitsi/meet: add support for stream-ui from datacop
Diffstat (limited to 'roles/apps/jitsi')
-rw-r--r--roles/apps/jitsi/meet/defaults/main.yml5
-rw-r--r--roles/apps/jitsi/meet/tasks/main.yml80
-rw-r--r--roles/apps/jitsi/meet/templates/pod-spec.yml.j227
3 files changed, 101 insertions, 11 deletions
diff --git a/roles/apps/jitsi/meet/defaults/main.yml b/roles/apps/jitsi/meet/defaults/main.yml
index 9f249f0e..2580fe15 100644
--- a/roles/apps/jitsi/meet/defaults/main.yml
+++ b/roles/apps/jitsi/meet/defaults/main.yml
@@ -17,8 +17,13 @@ jitsi_meet_timezone: Europe/Vienna
# jicofo_component_secret: "" ### only needed for versions older than stable-5765-1
# jicofo_auth_password: ""
# jvb_auth_password: ""
+# streamuidisplay_auth_password: "" ### only needed if streamui is enabled
# jitsi_meet_auth:
# enable_guests: true
# users:
# foo: secret
+
+# jitsi_meet_streamui:
+# http_port: "{{ jitsi_meet_http_port + 1 }}"
+# image_tag: latest
diff --git a/roles/apps/jitsi/meet/tasks/main.yml b/roles/apps/jitsi/meet/tasks/main.yml
index b433a900..e83c789e 100644
--- a/roles/apps/jitsi/meet/tasks/main.yml
+++ b/roles/apps/jitsi/meet/tasks/main.yml
@@ -9,7 +9,37 @@
path: "{{ jitsi_meet_base_path }}/{{ jitsi_meet_inst_name }}/scripts/{{ item }}"
state: directory
-- name: generate prosody cont-init.d script
+- name: generate stream-ui specific cont-init scripts
+ when: jitsi_meet_streamui is defined
+ block:
+ - name: generate stream-ui specific cont-init scripts for prosody
+ copy:
+ content: |
+ #!/usr/bin/with-contenv bash
+ cat << EOF > /config/conf.d/stream-ui.cfg.lua
+ VirtualHost "stream-ui.meet.jitsi"
+ modules_enabled = {
+ "ping";
+ }
+ authentication = "internal_hashed"
+ EOF
+ prosodyctl --config "/config/prosody.cfg.lua" register display stream-ui.meet.jitsi "{{ jitsi_meet_secrets.streamuidisplay_auth_password }}"
+ dest: "{{ jitsi_meet_base_path }}/{{ jitsi_meet_inst_name }}/scripts/prosody/streamui.sh"
+ mode: 0750
+
+ - name: generate stream-ui specific cont-init scripts for web
+ copy:
+ content: |
+ #!/usr/bin/with-contenv bash
+ cat << EOF >> /config/config.js
+
+ // Hide Stream-UI Displays
+ config.hiddenDomain = 'stream-ui.meet.jitsi';
+ EOF
+ dest: "{{ jitsi_meet_base_path }}/{{ jitsi_meet_inst_name }}/scripts/web/streamui.sh"
+ mode: 0755
+
+- name: generate generic prosody cont-init script
copy:
content: |
#!/usr/bin/with-contenv bash
@@ -25,20 +55,52 @@
dest: "{{ jitsi_meet_base_path }}/{{ jitsi_meet_inst_name }}/scripts/prosody/cont-init.sh"
mode: 0750
+
+- name: configure base pod config hash items
+ set_fact:
+ kubernetes_standalone_pod_config_hash_items_base:
+ - path: "{{ jitsi_meet_base_path }}/{{ jitsi_meet_inst_name }}/scripts/prosody/cont-init.sh"
+ properties:
+ - checksum
+ kubernetes_standalone_pod_config_hash_items_streamui: []
+
+- name: configure stream-ui pod config hash items
+ when: jitsi_meet_streamui is defined
+ set_fact:
+ kubernetes_standalone_pod_config_hash_items_streamui:
+ - path: "{{ jitsi_meet_base_path }}/{{ jitsi_meet_inst_name }}/scripts/prosody/streamui.sh"
+ properties:
+ - checksum
+ - path: "{{ jitsi_meet_base_path }}/{{ jitsi_meet_inst_name }}/scripts/prosody/streamui.sh"
+ properties:
+ - checksum
+
- name: install pod manifest
vars:
kubernetes_standalone_pod:
name: "jitsi-meet-{{ jitsi_meet_inst_name }}"
spec: "{{ lookup('template', 'pod-spec.yml.j2') }}"
mode: "0600"
- config_hash_items:
- - path: "{{ jitsi_meet_base_path }}/{{ jitsi_meet_inst_name }}/scripts/prosody/cont-init.sh"
- properties:
- - checksum
+ config_hash_items: "{{ kubernetes_standalone_pod_config_hash_items_base + kubernetes_standalone_pod_config_hash_items_streamui }}"
include_role:
name: kubernetes/standalone/pod
-## TODO: https://github.com/jitsi/jitsi-meet/blob/master/doc/turn.md
+
+- name: configure base http proxy locations
+ set_fact:
+ nginx_vhost_locations_base:
+ '/':
+ proxy_pass: "http://127.0.0.1:{{ jitsi_meet_http_port }}"
+ extra_directives: |-
+ client_max_body_size 0;
+ nginx_vhost_locations_streamui: {}
+
+- name: configure stream-ui http proxy locations
+ when: jitsi_meet_streamui is defined
+ set_fact:
+ nginx_vhost_locations_streamui:
+ '/stream-ui/':
+ proxy_pass: "http://127.0.0.1:{{ jitsi_meet_streamui.http_port }}/"
- name: configure nginx vhost
vars:
@@ -48,10 +110,6 @@
acme: true
hostnames:
- "{{ jitsi_meet_hostname }}"
- locations:
- '/':
- proxy_pass: "http://127.0.0.1:{{ jitsi_meet_http_port }}"
- extra_directives: |-
- client_max_body_size 0;
+ locations: "{{ nginx_vhost_locations_base | combine(nginx_vhost_locations_streamui) }}"
include_role:
name: nginx/vhost
diff --git a/roles/apps/jitsi/meet/templates/pod-spec.yml.j2 b/roles/apps/jitsi/meet/templates/pod-spec.yml.j2
index 0d6905a0..95f49982 100644
--- a/roles/apps/jitsi/meet/templates/pod-spec.yml.j2
+++ b/roles/apps/jitsi/meet/templates/pod-spec.yml.j2
@@ -67,6 +67,12 @@ containers:
subPath: prosody/cont-init.sh
mountPath: /etc/cont-init.d/99-k8s
readOnly: yes
+{% if jitsi_meet_streamui is defined %}
+ - name: scripts
+ subPath: prosody/streamui.sh
+ mountPath: /etc/cont-init.d/90-streamui
+ readOnly: yes
+{% endif %}
- name: config
subPath: prosody
mountPath: /config
@@ -128,6 +134,12 @@ containers:
hostPort: {{ jitsi_meet_http_port }}
hostIP: 127.0.0.1
volumeMounts:
+{% if jitsi_meet_streamui is defined %}
+ - name: scripts
+ subPath: web/streamui.sh
+ mountPath: /etc/cont-init.d/90-streamui
+ readOnly: yes
+{% endif %}
- name: config
subPath: web
mountPath: /config
@@ -210,6 +222,21 @@ containers:
- name: TZ
value: {{ jitsi_meet_timezone }}
+{% if jitsi_meet_streamui is defined %}
+- name: stream-ui
+ image: "get.more.failed.systems/public_projects/jitsi-stream-ui:{{ jitsi_meet_streamui.image_tag }}"
+ resources:
+ requests:
+ memory: "256Mi"
+ limits:
+ memory: "1Gi"
+ ports:
+ - protocol: TCP
+ containerPort: 3000
+ hostPort: {{ jitsi_meet_streamui.http_port }}
+ hostIP: 127.0.0.1
+
+{% endif %}
volumes:
- name: scripts
hostPath: