Skip to content

Commit 0b019ee

Browse files
committed
feat: Enables tenants/subdomains by default.
1 parent d50df67 commit 0b019ee

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
{{ $TURNS_PORT := .Env.TURNS_PORT | default "443" }}
1717
{{ $XMPP_MUC_DOMAIN_PREFIX := (split "." .Env.XMPP_MUC_DOMAIN)._0 }}
1818
{{ $DISABLE_POLLS := .Env.DISABLE_POLLS | default "false" | toBool -}}
19+
{{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "true" | toBool -}}
1920

2021
admins = {
2122
"{{ .Env.JICOFO_AUTH_USER }}@{{ .Env.XMPP_AUTH_DOMAIN }}",
@@ -216,6 +217,9 @@ Component "{{ .Env.XMPP_MUC_DOMAIN }}" "muc"
216217
{{ if not $DISABLE_POLLS -}}
217218
"polls";
218219
{{ end -}}
220+
{{ if $ENABLE_SUBDOMAINS -}}
221+
"muc_domain_mapper";
222+
{{ end -}}
219223
}
220224
muc_room_cache_size = 1000
221225
muc_room_locking = false
@@ -249,4 +253,10 @@ Component "breakout.{{ .Env.XMPP_DOMAIN }}" "muc"
249253
restrict_room_creation = true
250254
muc_room_locking = false
251255
muc_room_default_public_jids = true
256+
modules_enabled = {
257+
"muc_meeting_id";
258+
{{ if $ENABLE_SUBDOMAINS -}}
259+
"muc_domain_mapper";
260+
{{ end -}}
261+
}
252262
{{ end }}

web/rootfs/defaults/meet.conf

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{ $ENABLE_COLIBRI_WEBSOCKET := .Env.ENABLE_COLIBRI_WEBSOCKET | default "1" | toBool }}
22
{{ $ENABLE_XMPP_WEBSOCKET := .Env.ENABLE_XMPP_WEBSOCKET | default "1" | toBool }}
3+
{{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "true" | toBool -}}
34

45
server_name _;
56

@@ -104,3 +105,40 @@ location /etherpad/ {
104105
proxy_buffering off;
105106
}
106107
{{ end }}
108+
109+
{{ if $ENABLE_SUBDOMAINS }}
110+
location ~ ^/([^/?&:'"]+)/config.js$
111+
{
112+
set $subdomain "$1.";
113+
set $subdir "$1/";
114+
115+
alias /config/config.js;
116+
}
117+
118+
# BOSH for subdomains
119+
location ~ ^/([^/?&:'"]+)/http-bind {
120+
set $subdomain "$1.";
121+
set $subdir "$1/";
122+
set $prefix "$1";
123+
124+
rewrite ^/(.*)$ /http-bind;
125+
}
126+
127+
{{ if $ENABLE_XMPP_WEBSOCKET }}
128+
# websockets for subdomains
129+
location ~ ^/([^/?&:'"]+)/xmpp-websocket {
130+
set $subdomain "$1.";
131+
set $subdir "$1/";
132+
set $prefix "$1";
133+
134+
rewrite ^/(.*)$ /xmpp-websocket;
135+
}
136+
{{ end }}
137+
138+
# Anything that didn't match above, and isn't a real file, assume it's a room name and redirect to /
139+
location ~ ^/([^/?&:'"]+)/(.*)$ {
140+
set $subdomain "$1.";
141+
set $subdir "$1/";
142+
rewrite ^/([^/?&:'"]+)/(.*)$ /$2;
143+
}
144+
{{ end }}

web/rootfs/defaults/system-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{ $CONFIG_EXTERNAL_CONNECT := .Env.CONFIG_EXTERNAL_CONNECT | default "false" | toBool -}}
22
{{ $ENABLE_AUTH := .Env.ENABLE_AUTH | default "false" | toBool -}}
33
{{ $ENABLE_GUESTS := .Env.ENABLE_GUESTS | default "false" | toBool -}}
4-
{{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "false" | toBool -}}
4+
{{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "true" | toBool -}}
55
{{ $ENABLE_XMPP_WEBSOCKET := .Env.ENABLE_XMPP_WEBSOCKET | default "1" | toBool -}}
66
{{ $JICOFO_AUTH_USER := .Env.JICOFO_AUTH_USER | default "focus" }}
77
{{ $PUBLIC_URL_DOMAIN := .Env.PUBLIC_URL | default "https://localhost:8443" | trimPrefix "https://" | trimSuffix "/" -}}

0 commit comments

Comments
 (0)