Skip to content

Commit

Permalink
feat: Enables tenants/subdomains by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Mar 2, 2022
1 parent d50df67 commit 0b019ee
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
10 changes: 10 additions & 0 deletions prosody/rootfs/defaults/conf.d/jitsi-meet.cfg.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
{{ $TURNS_PORT := .Env.TURNS_PORT | default "443" }}
{{ $XMPP_MUC_DOMAIN_PREFIX := (split "." .Env.XMPP_MUC_DOMAIN)._0 }}
{{ $DISABLE_POLLS := .Env.DISABLE_POLLS | default "false" | toBool -}}
{{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "true" | toBool -}}

admins = {
"{{ .Env.JICOFO_AUTH_USER }}@{{ .Env.XMPP_AUTH_DOMAIN }}",
Expand Down Expand Up @@ -216,6 +217,9 @@ Component "{{ .Env.XMPP_MUC_DOMAIN }}" "muc"
{{ if not $DISABLE_POLLS -}}
"polls";
{{ end -}}
{{ if $ENABLE_SUBDOMAINS -}}
"muc_domain_mapper";
{{ end -}}
}
muc_room_cache_size = 1000
muc_room_locking = false
Expand Down Expand Up @@ -249,4 +253,10 @@ Component "breakout.{{ .Env.XMPP_DOMAIN }}" "muc"
restrict_room_creation = true
muc_room_locking = false
muc_room_default_public_jids = true
modules_enabled = {
"muc_meeting_id";
{{ if $ENABLE_SUBDOMAINS -}}
"muc_domain_mapper";
{{ end -}}
}
{{ end }}
38 changes: 38 additions & 0 deletions web/rootfs/defaults/meet.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{ $ENABLE_COLIBRI_WEBSOCKET := .Env.ENABLE_COLIBRI_WEBSOCKET | default "1" | toBool }}
{{ $ENABLE_XMPP_WEBSOCKET := .Env.ENABLE_XMPP_WEBSOCKET | default "1" | toBool }}
{{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "true" | toBool -}}

server_name _;

Expand Down Expand Up @@ -104,3 +105,40 @@ location /etherpad/ {
proxy_buffering off;
}
{{ end }}

{{ if $ENABLE_SUBDOMAINS }}
location ~ ^/([^/?&:'"]+)/config.js$
{
set $subdomain "$1.";
set $subdir "$1/";

alias /config/config.js;
}

# BOSH for subdomains
location ~ ^/([^/?&:'"]+)/http-bind {
set $subdomain "$1.";
set $subdir "$1/";
set $prefix "$1";

rewrite ^/(.*)$ /http-bind;
}

{{ if $ENABLE_XMPP_WEBSOCKET }}
# websockets for subdomains
location ~ ^/([^/?&:'"]+)/xmpp-websocket {
set $subdomain "$1.";
set $subdir "$1/";
set $prefix "$1";

rewrite ^/(.*)$ /xmpp-websocket;
}
{{ end }}

# Anything that didn't match above, and isn't a real file, assume it's a room name and redirect to /
location ~ ^/([^/?&:'"]+)/(.*)$ {
set $subdomain "$1.";
set $subdir "$1/";
rewrite ^/([^/?&:'"]+)/(.*)$ /$2;
}
{{ end }}
2 changes: 1 addition & 1 deletion web/rootfs/defaults/system-config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ $CONFIG_EXTERNAL_CONNECT := .Env.CONFIG_EXTERNAL_CONNECT | default "false" | toBool -}}
{{ $ENABLE_AUTH := .Env.ENABLE_AUTH | default "false" | toBool -}}
{{ $ENABLE_GUESTS := .Env.ENABLE_GUESTS | default "false" | toBool -}}
{{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "false" | toBool -}}
{{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "true" | toBool -}}
{{ $ENABLE_XMPP_WEBSOCKET := .Env.ENABLE_XMPP_WEBSOCKET | default "1" | toBool -}}
{{ $JICOFO_AUTH_USER := .Env.JICOFO_AUTH_USER | default "focus" }}
{{ $PUBLIC_URL_DOMAIN := .Env.PUBLIC_URL | default "https://localhost:8443" | trimPrefix "https://" | trimSuffix "/" -}}
Expand Down

0 comments on commit 0b019ee

Please sign in to comment.