Procházet zdrojové kódy

xmpp: add ability to add custom prosody modules

Paul Tiedtke před 6 roky
rodič
revize
95a55915b7

+ 3 - 0
README.md

@@ -153,6 +153,9 @@ Variable | Description | Default value
 `XMPP_MUC_DOMAIN` | XMPP domain for the MUC | muc.meet.jitsi
 `XMPP_INTERNAL_MUC_DOMAIN` | XMPP domain for the internal MUC | internal-muc.meet.jitsi
 `XMPP_GUEST_DOMAIN` | XMPP domain for unauthenticated users | guest.meet.jitsi
+`XMPP_MODULES` | Custom Prosody modules for XMPP_DOMAIN (comma separated) | mod_info,mod_alert
+`XMPP_MUC_MODULES` | Custom Prosody modules for MUC component (comma separated) | mod_info,mod_alert
+`XMPP_INTERNAL_MUC_MODULES` | Custom Prosody modules for internal MUC component (comma separated) | mod_info,mod_alert
 `JICOFO_COMPONENT_SECRET` | XMPP component password for Jicofo | s3cr37
 `JICOFO_AUTH_USER` | XMPP user for Jicofo client connections | focus
 `JICOFO_AUTH_PASSWORD` | XMPP password for Jicofo client connections | passw0rd

+ 3 - 0
docker-compose.yml

@@ -44,6 +44,9 @@ services:
             - XMPP_GUEST_DOMAIN
             - XMPP_MUC_DOMAIN
             - XMPP_INTERNAL_MUC_DOMAIN
+            - XMPP_MODULES
+            - XMPP_MUC_MODULES
+            - XMPP_INTERNAL_MUC_MODULES
             - JICOFO_COMPONENT_SECRET
             - JICOFO_AUTH_USER
             - JICOFO_AUTH_PASSWORD

+ 9 - 0
env.example

@@ -81,6 +81,15 @@ XMPP_INTERNAL_MUC_DOMAIN=internal-muc.meet.jitsi
 # XMPP domain for unauthenticated users.
 XMPP_GUEST_DOMAIN=guest.meet.jitsi
 
+# Custom Prosody modules for XMPP_DOMAIN (comma separated)
+XMPP_MODULES=
+
+# Custom Prosody modules for MUC component (comma separated)
+XMPP_MUC_MODULES=
+
+# Custom Prosody modules for internal MUC component (comma separated)
+XMPP_INTERNAL_MUC_MODULES=
+
 # MUC for the JVB pool.
 JVB_BREWERY_MUC=jvbbrewery
 

+ 1 - 2
prosody/Dockerfile

@@ -10,5 +10,4 @@ COPY rootfs/ /
 
 EXPOSE 5222 5269 5347 5280
 
-VOLUME /config
-
+VOLUME ["/config", "/prosody-plugins-custom"]

+ 15 - 3
prosody/rootfs/defaults/conf.d/jitsi-meet.cfg.lua

@@ -1,4 +1,5 @@
 admins = { "{{ .Env.JICOFO_AUTH_USER }}@{{ .Env.XMPP_AUTH_DOMAIN }}" }
+plugin_paths = { "/prosody-plugins-custom" }
 
 VirtualHost "{{ .Env.XMPP_DOMAIN }}"
     {{ if .Env.ENABLE_AUTH }}
@@ -7,13 +8,16 @@ VirtualHost "{{ .Env.XMPP_DOMAIN }}"
     authentication = "anonymous"
     {{ end }}
     ssl = {
-            key = "/config/certs/{{ .Env.XMPP_DOMAIN }}.key";
-            certificate = "/config/certs/{{ .Env.XMPP_DOMAIN }}.crt";
+        key = "/config/certs/{{ .Env.XMPP_DOMAIN }}.key";
+        certificate = "/config/certs/{{ .Env.XMPP_DOMAIN }}.crt";
     }
     modules_enabled = {
         "bosh";
         "pubsub";
         "ping";
+        {{ if .Env.XMPP_MODULES }}
+        "{{ join "\";\n\"" (splitList "," .Env.XMPP_MODULES) }}";
+        {{ end }}
     }
 
     c2s_require_encryption = false
@@ -33,13 +37,21 @@ VirtualHost "{{ .Env.XMPP_AUTH_DOMAIN }}"
 
 Component "{{ .Env.XMPP_INTERNAL_MUC_DOMAIN }}" "muc"
     modules_enabled = {
-      "ping";
+        "ping";
+        {{ if .Env.XMPP_INTERNAL_MUC_MODULES }}
+        "{{ join "\";\n\"" (splitList "," .Env.XMPP_INTERNAL_MUC_MODULES) }}";
+        {{ end }}
     }
     storage = "internal"
     muc_room_cache_size = 1000
 
 Component "{{ .Env.XMPP_MUC_DOMAIN }}" "muc"
     storage = "internal"
+    modules_enabled = {
+        {{ if .Env.XMPP_MUC_MODULES }}
+        "{{ join "\";\n\"" (splitList "," .Env.XMPP_MUC_MODULES) }}";
+        {{ end }}
+    }
 
 Component "focus.{{ .Env.XMPP_DOMAIN }}"
     component_secret = "{{ .Env.JICOFO_COMPONENT_SECRET }}"