Browse Source

Activates multidomain by default when installing with nginx.

master
damencho 5 years ago
parent
commit
ebfc5a95ff

+ 2
- 0
debian/jitsi-meet-web-config.postinst View File

99
         JITSI_MEET_CONFIG="/etc/jitsi/meet/$JVB_HOSTNAME-config.js"
99
         JITSI_MEET_CONFIG="/etc/jitsi/meet/$JVB_HOSTNAME-config.js"
100
         if [ ! -f $JITSI_MEET_CONFIG ] ; then
100
         if [ ! -f $JITSI_MEET_CONFIG ] ; then
101
             cp /usr/share/jitsi-meet-web-config/config.js $JITSI_MEET_CONFIG
101
             cp /usr/share/jitsi-meet-web-config/config.js $JITSI_MEET_CONFIG
102
+            # replaces needed config for multidomain as it works only with nginx
103
+            sed -i "s/conference.jitsi-meet.example.com/conference.<\!--# echo var=\"subdomain\" default=\"\" -->jitsi-meet.example.com/g" $JITSI_MEET_CONFIG
102
             sed -i "s/jitsi-meet.example.com/$JVB_HOSTNAME/g" $JITSI_MEET_CONFIG
104
             sed -i "s/jitsi-meet.example.com/$JVB_HOSTNAME/g" $JITSI_MEET_CONFIG
103
         fi
105
         fi
104
 
106
 

+ 4
- 0
doc/debian/jitsi-meet-prosody/prosody.cfg.lua-jvb.example View File

1
 plugin_paths = { "/usr/share/jitsi-meet/prosody-plugins/" }
1
 plugin_paths = { "/usr/share/jitsi-meet/prosody-plugins/" }
2
 
2
 
3
+-- domain mapper options, must at least have domain base set to use the mapper
4
+muc_mapper_domain_base = "jitmeet.example.com";
5
+
3
 VirtualHost "jitmeet.example.com"
6
 VirtualHost "jitmeet.example.com"
4
         -- enabled = false -- Remove this line to enable this host
7
         -- enabled = false -- Remove this line to enable this host
5
         authentication = "anonymous"
8
         authentication = "anonymous"
28
     storage = "null"
31
     storage = "null"
29
     modules_enabled = {
32
     modules_enabled = {
30
         "muc_meeting_id";
33
         "muc_meeting_id";
34
+        "muc_domain_mapper";
31
         -- "token_verification";
35
         -- "token_verification";
32
     }
36
     }
33
 admins = { "focusUser@auth.jitmeet.example.com" }
37
 admins = { "focusUser@auth.jitmeet.example.com" }

+ 28
- 0
doc/debian/jitsi-meet/jitsi-meet.example View File

19
     ssl_certificate_key /etc/jitsi/meet/jitsi-meet.example.com.key;
19
     ssl_certificate_key /etc/jitsi/meet/jitsi-meet.example.com.key;
20
 
20
 
21
     root /usr/share/jitsi-meet;
21
     root /usr/share/jitsi-meet;
22
+
23
+    # ssi on with javascript for multidomain variables in config.js
22
     ssi on;
24
     ssi on;
25
+    ssi_types application/x-javascript application/javascript;
26
+
23
     index index.html index.htm;
27
     index index.html index.htm;
24
     error_page 404 /static/404.html;
28
     error_page 404 /static/404.html;
25
 
29
 
52
     location @root_path {
56
     location @root_path {
53
         rewrite ^/(.*)$ / break;
57
         rewrite ^/(.*)$ / break;
54
     }
58
     }
59
+
60
+    location ~ ^/([^/?&:'"]+)/config.js$
61
+    {
62
+       set $subdomain "$1.";
63
+       set $subdir "$1/";
64
+
65
+       alias /etc/jitsi/meet/jitsi-meet.example.com-config.js;
66
+    }
67
+
68
+    #Anything that didn't match above, and isn't a real file, assume it's a room name and redirect to /
69
+    location ~ ^/([^/?&:'"]+)/(.*)$ {
70
+        set $subdomain "$1.";
71
+        set $subdir "$1/";
72
+        rewrite ^/([^/?&:'"]+)/(.*)$ /$2;
73
+    }
74
+
75
+    # BOSH for subdomains
76
+    location ~ ^/([^/?&:'"]+)/http-bind {
77
+        set $subdomain "$1.";
78
+        set $subdir "$1/";
79
+        set $prefix "$1";
80
+
81
+        rewrite ^/(.*)$ /http-bind;
82
+    }
55
 }
83
 }

+ 1
- 5
doc/example-config-files/multidomain/jitsi.example.com.multidomain.example View File

36
         rewrite ^/(.*)$ / break;
36
         rewrite ^/(.*)$ / break;
37
     }
37
     }
38
 
38
 
39
-    location / {
40
-        ssi on;
41
-    }
42
-
43
     location ~ ^/([^/?&:'"]+)/config.js$
39
     location ~ ^/([^/?&:'"]+)/config.js$
44
     {
40
     {
45
        set $subdomain "$1.";
41
        set $subdomain "$1.";
64
         rewrite ^/(.*)$ /http-bind;
60
         rewrite ^/(.*)$ /http-bind;
65
     }
61
     }
66
 
62
 
67
-}
63
+}

+ 0
- 2
doc/example-config-files/multidomain/prosody.cfg.multidomain.example View File

83
 		"adhoc";
83
 		"adhoc";
84
 		"websocket";
84
 		"websocket";
85
 		"http_altconnect";
85
 		"http_altconnect";
86
-    -- include domain mapper as global level module
87
-        "muc_domain_mapper";
88
 }
86
 }
89
 
87
 
90
 -- domain mapper options, must at least have domain base set to use the mapper
88
 -- domain mapper options, must at least have domain base set to use the mapper

+ 11
- 9
resources/prosody-plugins/mod_muc_domain_mapper.lua View File

1
 -- Maps MUC JIDs like room1@muc.foo.example.com to JIDs like [foo]room1@muc.example.com
1
 -- Maps MUC JIDs like room1@muc.foo.example.com to JIDs like [foo]room1@muc.example.com
2
 -- Must be loaded on the client host in Prosody
2
 -- Must be loaded on the client host in Prosody
3
 
3
 
4
-module:set_global();
5
-
6
 -- It is recommended to set muc_mapper_domain_base to the main domain being served (example.com)
4
 -- It is recommended to set muc_mapper_domain_base to the main domain being served (example.com)
7
 
5
 
8
 local jid = require "util.jid";
6
 local jid = require "util.jid";
13
 
11
 
14
 local muc_domain_base = module:get_option_string("muc_mapper_domain_base");
12
 local muc_domain_base = module:get_option_string("muc_mapper_domain_base");
15
 if not muc_domain_base then
13
 if not muc_domain_base then
16
-    module:log("warn", "No 'muc_domain_base' option set, disabling muc_mapper plugin inactive");
14
+    module:log("warn", "No 'muc_mapper_domain_base' option set, disabling muc_mapper plugin inactive");
17
     return
15
     return
18
 end
16
 end
19
 
17
 
116
 function module.load()
114
 function module.load()
117
     if module.reloading then
115
     if module.reloading then
118
         module:log("debug", "Reloading MUC mapper!");
116
         module:log("debug", "Reloading MUC mapper!");
119
-    else        
117
+    else
120
         module:log("debug", "First load of MUC mapper!");
118
         module:log("debug", "First load of MUC mapper!");
121
     end
119
     end
122
     filters.add_filter_hook(filter_session);
120
     filters.add_filter_hook(filter_session);
123
 end
121
 end
124
 
122
 
125
 function module.unload()
123
 function module.unload()
126
-    filters.remove_filter_hook(filter_session); 
124
+    filters.remove_filter_hook(filter_session);
127
 end
125
 end
128
 
126
 
129
 
127
 
150
     end
148
     end
151
 end
149
 end
152
 
150
 
153
-
154
-function module.add_host(host_module)
155
-    module:log("info",
156
-               "Loading mod_muc_domain_mapper for host %s!", host_module.host);
151
+function add_host(host)
152
+    module:log("info", "Loading mod_muc_domain_mapper for host %s!", host);
153
+    local host_module = module:context(host);
157
     hook_all_stanzas(incoming_stanza_rewriter, host_module);
154
     hook_all_stanzas(incoming_stanza_rewriter, host_module);
158
     hook_all_stanzas(outgoing_stanza_rewriter, host_module, "pre-");
155
     hook_all_stanzas(outgoing_stanza_rewriter, host_module, "pre-");
159
 end
156
 end
157
+
158
+prosody.events.add_handler("host-activated", add_host);
159
+for host in pairs(prosody.hosts) do
160
+    add_host(host);
161
+end

Loading…
Cancel
Save