2
0

system-config.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. {{ $CONFIG_EXTERNAL_CONNECT := .Env.CONFIG_EXTERNAL_CONNECT | default "false" | toBool -}}
  2. {{ $ENABLE_AUTH := .Env.ENABLE_AUTH | default "false" | toBool -}}
  3. {{ $ENABLE_GUESTS := .Env.ENABLE_GUESTS | default "false" | toBool -}}
  4. {{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "true" | toBool -}}
  5. {{ $ENABLE_XMPP_WEBSOCKET := .Env.ENABLE_XMPP_WEBSOCKET | default "1" | toBool -}}
  6. {{ $JICOFO_AUTH_USER := .Env.JICOFO_AUTH_USER | default "focus" -}}
  7. {{ $PUBLIC_URL_DOMAIN := .Env.PUBLIC_URL | default "https://localhost:8443" | trimPrefix "https://" | trimSuffix "/" -}}
  8. {{ $XMPP_AUTH_DOMAIN := .Env.XMPP_AUTH_DOMAIN | default "auth.meet.jitsi" -}}
  9. {{ $XMPP_DOMAIN := .Env.XMPP_DOMAIN | default "meet.jitsi" -}}
  10. {{ $XMPP_GUEST_DOMAIN := .Env.XMPP_GUEST_DOMAIN | default "guest.meet.jitsi" -}}
  11. {{ $XMPP_MUC_DOMAIN := .Env.XMPP_MUC_DOMAIN | default "muc.meet.jitsi" -}}
  12. {{ $XMPP_MUC_DOMAIN_PREFIX := (split "." $XMPP_MUC_DOMAIN)._0 -}}
  13. // Begin default config overrides.
  14. if (!config.hasOwnProperty('hosts')) config.hosts = {};
  15. config.hosts.domain = '{{ $XMPP_DOMAIN }}';
  16. config.focusUserJid = '{{$JICOFO_AUTH_USER}}@{{$XMPP_AUTH_DOMAIN}}';
  17. {{ if $ENABLE_SUBDOMAINS -}}
  18. var subdomain = "<!--# echo var="subdomain" default="" -->";
  19. if (subdomain) {
  20. subdomain = subdomain.substr(0,subdomain.length-1).split('.').join('_').toLowerCase() + '.';
  21. }
  22. config.hosts.muc = '{{ $XMPP_MUC_DOMAIN_PREFIX }}.'+subdomain+'{{ $XMPP_DOMAIN }}';
  23. {{ else -}}
  24. config.hosts.muc = '{{ $XMPP_MUC_DOMAIN }}';
  25. {{ end -}}
  26. {{ if $ENABLE_AUTH -}}
  27. {{ if $ENABLE_GUESTS -}}
  28. // When using authentication, domain for guest users.
  29. config.hosts.anonymousdomain = '{{ $XMPP_GUEST_DOMAIN }}';
  30. {{ end -}}
  31. // Domain for authenticated users. Defaults to <domain>.
  32. config.hosts.authdomain = '{{ $XMPP_DOMAIN }}';
  33. {{ end -}}
  34. config.bosh = '/http-bind';
  35. {{ if $ENABLE_XMPP_WEBSOCKET -}}
  36. config.websocket = 'wss://{{ $PUBLIC_URL_DOMAIN }}/xmpp-websocket';
  37. {{ end -}}
  38. {{ if $CONFIG_EXTERNAL_CONNECT -}}
  39. {{ if $ENABLE_SUBDOMAINS -}}
  40. config.externalConnectUrl = '/<!--# echo var="subdir" default="" -->http-pre-bind';
  41. {{ else -}}
  42. config.externalConnectUrl = '/http-pre-bind';
  43. {{ end -}}
  44. {{ end -}}