FEATURE: new meet config customizations

aaronkvanmeerten/jitsi-customizations
Aaron van Meerten 5 years ago
parent e516c37d32
commit 8615927428
  1. 125
      web/rootfs/defaults/meet.conf
  2. 16
      web/rootfs/etc/cont-init.d/10-config

@ -1,44 +1,66 @@
{{ $XMPP_BOSH_URL_BASE := .Env.XMPP_BOSH_URL_BASE | default "http://xmpp.meet.jitsi:5280" -}}
{{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "false" | toBool -}}
server_name _; server_name _;
client_max_body_size 0; client_max_body_size 0;
root /usr/share/jitsi-meet; root /usr/share/jitsi-meet;
index index.html index index.html;
error_page 404 /static/404.html; error_page 404 /static/404.html;
location ~ ^/([a-zA-Z0-9=\?]+)$ { access_log /dev/stdout;
rewrite ^/(.*)$ / break; error_log /dev/stderr;
}
set $prefix "";
ssi on; ssi on;
ssi_types application/x-javascript application/javascript; ssi_types application/x-javascript application/javascript;
location /config.js { location = /config.js {
alias /config/config.js; alias /config/config.js;
} }
location = /interface_config.js {
location /interface_config.js {
alias /config/interface_config.js; alias /config/interface_config.js;
} }
location /external_api.js { location = /external_api.js {
alias /usr/share/jitsi-meet/libs/external_api.min.js; alias /usr/share/jitsi-meet/libs/external_api.min.js;
} }
location / { {{ if .Env.ENABLE_BOSH_PROXY }}
ssi on; location = /http-bind {
proxy_pass {{ $XMPP_BOSH_URL_BASE }}/http-bind;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host {{ .Env.XMPP_DOMAIN }};
} }
{{ if .Env.ENABLE_WEBSOCKETS }}
# BOSH location = /xmpp-websocket {
location /http-bind { proxy_pass {{ $XMPP_BOSH_URL_BASE }}/xmpp-websocket;
proxy_pass {{ .Env.XMPP_BOSH_URL_BASE }}/http-bind; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host {{ .Env.XMPP_DOMAIN }}; proxy_set_header Host {{ .Env.XMPP_DOMAIN }};
} }
{{ end }}
{{ else }}
{{ if .Env.ENABLE_BOSH_REDIRECT }}
location = /http-bind {
return 404;
}
{{ if .Env.ENABLE_WEBSOCKETS }}
location = /xmpp-websocket {
return 404;
}
{{ end }}
{{ end }}
{{ end }}
{{ if .Env.ETHERPAD_URL_BASE }} {{ if .Env.ETHERPAD_URL_BASE }}
# Etherpad-lite # Etherpad-lite
location /etherpad/ { location = /etherpad/ {
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade'; proxy_set_header Connection 'upgrade';
@ -51,3 +73,76 @@ location /etherpad/ {
proxy_set_header Host {{ .Env.XMPP_DOMAIN }}; proxy_set_header Host {{ .Env.XMPP_DOMAIN }};
} }
{{ end }} {{ end }}
location ~ ^/([^/?&:'"]+)$ {
try_files $uri @root_path;
}
location @root_path {
rewrite ^/(.*)$ / break;
}
location = / {
ssi on;
}
{{ if $ENABLE_SUBDOMAINS }}
location ~ ^/([^/?&:'"]+)/config.js$
{
set $subdomain "$1.";
set $subdir "$1/";
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Expose-Headers' "Content-Type, X-Jitsi-Region, X-Jitsi-Shard, X-Proxy-Region";
alias /config/config.js;
}
location ~ ^/([^/?&:'"]+)/interface_config.js$
{
set $subdomain "$1.";
set $subdir "$1/";
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Expose-Headers' "Content-Type, X-Jitsi-Region, X-Jitsi-Shard, X-Proxy-Region";
alias /config/interface_config.js;
}
location ~ ^/([^/?&:'"]+)/libs/lib-jitsi-meet.min.js
{
set $subdomain "$1.";
set $subdir "$1/";
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Expose-Headers' "Content-Type, X-Jitsi-Region, X-Jitsi-Shard, X-Proxy-Region";
alias /usr/share/jitsi-meet/libs/lib-jitsi-meet.min.js;
}
location ~ ^/([^/?&:'"]+)/external_api.js {
alias /usr/share/jitsi-meet/libs/external_api.min.js;
}
# 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;
# }
# # BOSH for subdomains
# location ~ ^/([^/?&:'"]+)/http-bind {
# set $subdomain "$1.";
# set $subdir "$1/";
# set $prefix "$1";
# rewrite ^/(.*)$ /http-bind;
# }
# # websockets for subdomains
# location ~ ^/([^/?&:'"]+)/xmpp-websocket {
# set $subdomain "$1.";
# set $subdir "$1/";
# set $prefix "$1";
# rewrite ^/(.*)$ /xmpp-websocket;
# }
{{ end }}

@ -73,18 +73,6 @@ if [[ ! -f /config/config.js ]]; then
[ -z "$XMPP_RECORDER_DOMAIN" ] && export XMPP_RECORDER_DOMAIN="recorder.$XMPP_DOMAIN" [ -z "$XMPP_RECORDER_DOMAIN" ] && export XMPP_RECORDER_DOMAIN="recorder.$XMPP_DOMAIN"
tpl /defaults/config.js > /config/config.js tpl /defaults/config.js > /config/config.js
if [[ ! -z "${ETHERPAD_URL_BASE}" && -z "$(grep -om1 'etherpad_base:' /config/config.js)" ]]; then
sed -i \
-e "/enableWelcomePage/a\ etherpad_base: '/etherpad/p/'," \
/config/config.js
fi
if [[ $ENABLE_TRANSCRIPTIONS -eq 1 || "$ENABLE_TRANSCRIPTIONS" == "true" ]]; then
sed -i \
-e "s#// transcribingEnabled:.*#transcribingEnabled: true,#" \
/config/config.js
fi
fi fi
if [[ ! -f /config/interface_config.js ]]; then if [[ ! -f /config/interface_config.js ]]; then
@ -100,3 +88,7 @@ if [[ ! -f /config/interface_config.js ]]; then
fi fi
# copy app files
if [[ ! -f /config/apple-app-site-configuration ]]; then
cp /defaults/nginx.conf /config/nginx/nginx.conf
fi

Loading…
Cancel
Save