jitsi-meet.cfg.lua 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. {{ $ENABLE_AUTH := .Env.ENABLE_AUTH | default "0" | toBool }}
  2. {{ $ENABLE_GUEST_DOMAIN := and $ENABLE_AUTH (.Env.ENABLE_GUESTS | default "0" | toBool)}}
  3. {{ $AUTH_TYPE := .Env.AUTH_TYPE | default "internal" }}
  4. {{ $JWT_ASAP_KEYSERVER := .Env.JWT_ASAP_KEYSERVER | default "" }}
  5. {{ $JWT_ALLOW_EMPTY := .Env.JWT_ALLOW_EMPTY | default "0" | toBool }}
  6. {{ $JWT_AUTH_TYPE := .Env.JWT_AUTH_TYPE | default "token" }}
  7. {{ $JWT_TOKEN_AUTH_MODULE := .Env.JWT_TOKEN_AUTH_MODULE | default "token_verification" }}
  8. {{ $ENABLE_LOBBY := .Env.ENABLE_LOBBY | default "true" | toBool }}
  9. {{ $ENABLE_AV_MODERATION := .Env.ENABLE_AV_MODERATION | default "true" | toBool }}
  10. {{ $ENABLE_XMPP_WEBSOCKET := .Env.ENABLE_XMPP_WEBSOCKET | default "1" | toBool }}
  11. {{ $PUBLIC_URL := .Env.PUBLIC_URL | default "https://localhost:8443" -}}
  12. {{ $TURN_PORT := .Env.TURN_PORT | default "443" }}
  13. {{ $TURNS_PORT := .Env.TURNS_PORT | default "443" }}
  14. {{ $XMPP_MUC_DOMAIN_PREFIX := (split "." .Env.XMPP_MUC_DOMAIN)._0 }}
  15. {{ $DISABLE_POLLS := .Env.DISABLE_POLLS | default "false" | toBool -}}
  16. admins = {
  17. "{{ .Env.JICOFO_AUTH_USER }}@{{ .Env.XMPP_AUTH_DOMAIN }}",
  18. "{{ .Env.JVB_AUTH_USER }}@{{ .Env.XMPP_AUTH_DOMAIN }}"
  19. }
  20. unlimited_jids = {
  21. "{{ .Env.JICOFO_AUTH_USER }}@{{ .Env.XMPP_AUTH_DOMAIN }}",
  22. "{{ .Env.JVB_AUTH_USER }}@{{ .Env.XMPP_AUTH_DOMAIN }}"
  23. }
  24. plugin_paths = { "/prosody-plugins/", "/prosody-plugins-custom" }
  25. muc_mapper_domain_base = "{{ .Env.XMPP_DOMAIN }}";
  26. muc_mapper_domain_prefix = "{{ $XMPP_MUC_DOMAIN_PREFIX }}";
  27. http_default_host = "{{ .Env.XMPP_DOMAIN }}"
  28. {{ if .Env.TURN_CREDENTIALS }}
  29. external_service_secret = "{{.Env.TURN_CREDENTIALS}}";
  30. {{ end }}
  31. {{ if or .Env.TURN_HOST .Env.TURNS_HOST }}
  32. external_services = {
  33. {{ if .Env.TURN_HOST }}
  34. { type = "turn", host = "{{ .Env.TURN_HOST }}", port = {{ $TURN_PORT }}, transport = "tcp", secret = true, ttl = 86400, algorithm = "turn" }
  35. {{ end }}
  36. {{ if and .Env.TURN_HOST .Env.TURNS_HOST }}
  37. ,
  38. {{ end }}
  39. {{ if .Env.TURNS_HOST }}
  40. { type = "turns", host = "{{ .Env.TURNS_HOST }}", port = {{ $TURNS_PORT }}, transport = "tcp", secret = true, ttl = 86400, algorithm = "turn" }
  41. {{ end }}
  42. };
  43. {{ end }}
  44. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "jwt") .Env.JWT_ACCEPTED_ISSUERS }}
  45. asap_accepted_issuers = { "{{ join "\",\"" (splitList "," .Env.JWT_ACCEPTED_ISSUERS) }}" }
  46. {{ end }}
  47. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "jwt") .Env.JWT_ACCEPTED_AUDIENCES }}
  48. asap_accepted_audiences = { "{{ join "\",\"" (splitList "," .Env.JWT_ACCEPTED_AUDIENCES) }}" }
  49. {{ end }}
  50. consider_bosh_secure = true;
  51. -- Deprecated in 0.12
  52. -- https://github.com/bjc/prosody/commit/26542811eafd9c708a130272d7b7de77b92712de
  53. {{ $XMPP_CROSS_DOMAINS := $PUBLIC_URL }}
  54. {{ $XMPP_CROSS_DOMAIN := .Env.XMPP_CROSS_DOMAIN | default "" }}
  55. {{ if eq $XMPP_CROSS_DOMAIN "true"}}
  56. cross_domain_websocket = true
  57. cross_domain_bosh = true
  58. {{ else }}
  59. {{ if not (eq $XMPP_CROSS_DOMAIN "false") }}
  60. {{ $XMPP_CROSS_DOMAINS = list $PUBLIC_URL (print "https://" .Env.XMPP_DOMAIN) .Env.XMPP_CROSS_DOMAIN | join "," }}
  61. {{ end }}
  62. cross_domain_websocket = { "{{ join "\",\"" (splitList "," $XMPP_CROSS_DOMAINS) }}" }
  63. cross_domain_bosh = { "{{ join "\",\"" (splitList "," $XMPP_CROSS_DOMAINS) }}" }
  64. {{ end }}
  65. VirtualHost "{{ .Env.XMPP_DOMAIN }}"
  66. {{ if $ENABLE_AUTH }}
  67. {{ if eq $AUTH_TYPE "jwt" }}
  68. authentication = "{{ $JWT_AUTH_TYPE }}"
  69. app_id = "{{ .Env.JWT_APP_ID }}"
  70. app_secret = "{{ .Env.JWT_APP_SECRET }}"
  71. allow_empty_token = {{ $JWT_ALLOW_EMPTY }}
  72. {{ if $JWT_ASAP_KEYSERVER }}
  73. asap_key_server = "{{ .Env.JWT_ASAP_KEYSERVER }}"
  74. {{ end }}
  75. {{ else if eq $AUTH_TYPE "ldap" }}
  76. authentication = "cyrus"
  77. cyrus_application_name = "xmpp"
  78. allow_unencrypted_plain_auth = true
  79. {{ else if eq $AUTH_TYPE "internal" }}
  80. authentication = "internal_hashed"
  81. {{ end }}
  82. {{ else }}
  83. authentication = "jitsi-anonymous"
  84. {{ end }}
  85. ssl = {
  86. key = "/config/certs/{{ .Env.XMPP_DOMAIN }}.key";
  87. certificate = "/config/certs/{{ .Env.XMPP_DOMAIN }}.crt";
  88. }
  89. modules_enabled = {
  90. "bosh";
  91. {{ if $ENABLE_XMPP_WEBSOCKET }}
  92. "websocket";
  93. "smacks"; -- XEP-0198: Stream Management
  94. {{ end }}
  95. "pubsub";
  96. "ping";
  97. "speakerstats";
  98. "conference_duration";
  99. {{ if or .Env.TURN_HOST .Env.TURNS_HOST }}
  100. "external_services";
  101. {{ end }}
  102. {{ if $ENABLE_LOBBY }}
  103. "muc_lobby_rooms";
  104. {{ end }}
  105. {{ if $ENABLE_AV_MODERATION }}
  106. "av_moderation";
  107. {{ end }}
  108. {{ if .Env.XMPP_MODULES }}
  109. "{{ join "\";\n\"" (splitList "," .Env.XMPP_MODULES) }}";
  110. {{ end }}
  111. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "ldap") }}
  112. "auth_cyrus";
  113. {{end}}
  114. }
  115. {{ if $ENABLE_LOBBY }}
  116. main_muc = "{{ .Env.XMPP_MUC_DOMAIN }}"
  117. lobby_muc = "lobby.{{ .Env.XMPP_DOMAIN }}"
  118. {{ if .Env.XMPP_RECORDER_DOMAIN }}
  119. muc_lobby_whitelist = { "{{ .Env.XMPP_RECORDER_DOMAIN }}" }
  120. {{ end }}
  121. {{ end }}
  122. speakerstats_component = "speakerstats.{{ .Env.XMPP_DOMAIN }}"
  123. conference_duration_component = "conferenceduration.{{ .Env.XMPP_DOMAIN }}"
  124. {{ if $ENABLE_AV_MODERATION }}
  125. av_moderation_component = "avmoderation.{{ .Env.XMPP_DOMAIN }}"
  126. {{ end }}
  127. c2s_require_encryption = false
  128. {{ if $ENABLE_GUEST_DOMAIN }}
  129. VirtualHost "{{ .Env.XMPP_GUEST_DOMAIN }}"
  130. authentication = "jitsi-anonymous"
  131. c2s_require_encryption = false
  132. {{ end }}
  133. VirtualHost "{{ .Env.XMPP_AUTH_DOMAIN }}"
  134. ssl = {
  135. key = "/config/certs/{{ .Env.XMPP_AUTH_DOMAIN }}.key";
  136. certificate = "/config/certs/{{ .Env.XMPP_AUTH_DOMAIN }}.crt";
  137. }
  138. modules_enabled = {
  139. "limits_exception";
  140. }
  141. authentication = "internal_hashed"
  142. {{ if .Env.XMPP_RECORDER_DOMAIN }}
  143. VirtualHost "{{ .Env.XMPP_RECORDER_DOMAIN }}"
  144. modules_enabled = {
  145. "ping";
  146. }
  147. authentication = "internal_hashed"
  148. {{ end }}
  149. Component "{{ .Env.XMPP_INTERNAL_MUC_DOMAIN }}" "muc"
  150. storage = "memory"
  151. modules_enabled = {
  152. "ping";
  153. {{ if .Env.XMPP_INTERNAL_MUC_MODULES -}}
  154. "{{ join "\";\n\"" (splitList "," .Env.XMPP_INTERNAL_MUC_MODULES) }}";
  155. {{ end -}}
  156. }
  157. restrict_room_creation = true
  158. muc_room_locking = false
  159. muc_room_default_public_jids = true
  160. Component "{{ .Env.XMPP_MUC_DOMAIN }}" "muc"
  161. storage = "memory"
  162. modules_enabled = {
  163. "muc_meeting_id";
  164. {{ if .Env.XMPP_MUC_MODULES -}}
  165. "{{ join "\";\n\"" (splitList "," .Env.XMPP_MUC_MODULES) }}";
  166. {{ end -}}
  167. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "jwt") -}}
  168. "{{ $JWT_TOKEN_AUTH_MODULE }}";
  169. {{ end -}}
  170. {{ if not $DISABLE_POLLS -}}
  171. "polls";
  172. {{ end -}}
  173. }
  174. muc_room_cache_size = 1000
  175. muc_room_locking = false
  176. muc_room_default_public_jids = true
  177. Component "focus.{{ .Env.XMPP_DOMAIN }}" "client_proxy"
  178. target_address = "{{ .Env.JICOFO_AUTH_USER }}@{{ .Env.XMPP_AUTH_DOMAIN }}"
  179. Component "speakerstats.{{ .Env.XMPP_DOMAIN }}" "speakerstats_component"
  180. muc_component = "{{ .Env.XMPP_MUC_DOMAIN }}"
  181. Component "conferenceduration.{{ .Env.XMPP_DOMAIN }}" "conference_duration_component"
  182. muc_component = "{{ .Env.XMPP_MUC_DOMAIN }}"
  183. {{ if $ENABLE_AV_MODERATION }}
  184. Component "avmoderation.{{ .Env.XMPP_DOMAIN }}" "av_moderation_component"
  185. muc_component = "{{ .Env.XMPP_MUC_DOMAIN }}"
  186. {{ end }}
  187. {{ if $ENABLE_LOBBY }}
  188. Component "lobby.{{ .Env.XMPP_DOMAIN }}" "muc"
  189. storage = "memory"
  190. restrict_room_creation = true
  191. muc_room_locking = false
  192. muc_room_default_public_jids = true
  193. {{ end }}