jitsi-meet.cfg.lua 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. {{ $ENABLE_AUTH := .Env.ENABLE_AUTH | default "0" | toBool }}
  2. {{ $ENABLE_GUEST_DOMAIN := and $ENABLE_AUTH (.Env.ENABLE_GUESTS | default "0" | toBool)}}
  3. {{ $ENABLE_RECORDING := .Env.ENABLE_RECORDING | default "0" | toBool }}
  4. {{ $AUTH_TYPE := .Env.AUTH_TYPE | default "internal" }}
  5. {{ $JICOFO_AUTH_USER := .Env.JICOFO_AUTH_USER | default "focus" -}}
  6. {{ $JVB_AUTH_USER := .Env.JVB_AUTH_USER | default "jvb" -}}
  7. {{ $JWT_ASAP_KEYSERVER := .Env.JWT_ASAP_KEYSERVER | default "" }}
  8. {{ $JWT_ALLOW_EMPTY := .Env.JWT_ALLOW_EMPTY | default "0" | toBool }}
  9. {{ $JWT_AUTH_TYPE := .Env.JWT_AUTH_TYPE | default "token" }}
  10. {{ $MATRIX_UVS_ISSUER := .Env.MATRIX_UVS_ISSUER | default "issuer" }}
  11. {{ $MATRIX_UVS_SYNC_POWER_LEVELS := .Env.MATRIX_UVS_SYNC_POWER_LEVELS | default "0" | toBool }}
  12. {{ $JWT_TOKEN_AUTH_MODULE := .Env.JWT_TOKEN_AUTH_MODULE | default "token_verification" }}
  13. {{ $ENABLE_LOBBY := .Env.ENABLE_LOBBY | default "true" | toBool }}
  14. {{ $ENABLE_AV_MODERATION := .Env.ENABLE_AV_MODERATION | default "true" | toBool }}
  15. {{ $ENABLE_BREAKOUT_ROOMS := .Env.ENABLE_BREAKOUT_ROOMS | default "true" | toBool }}
  16. {{ $ENABLE_XMPP_WEBSOCKET := .Env.ENABLE_XMPP_WEBSOCKET | default "1" | toBool }}
  17. {{ $ENABLE_JAAS_COMPONENTS := .Env.ENABLE_JAAS_COMPONENTS | default "0" | toBool }}
  18. {{ $PUBLIC_URL := .Env.PUBLIC_URL | default "https://localhost:8443" -}}
  19. {{ $PUBLIC_URL_DOMAIN := $PUBLIC_URL | trimPrefix "https://" | trimSuffix "/" -}}
  20. {{ $TURN_PORT := .Env.TURN_PORT | default "443" }}
  21. {{ $TURNS_PORT := .Env.TURNS_PORT | default "443" }}
  22. {{ $XMPP_AUTH_DOMAIN := .Env.XMPP_AUTH_DOMAIN | default "auth.meet.jitsi" -}}
  23. {{ $XMPP_DOMAIN := .Env.XMPP_DOMAIN | default "meet.jitsi" -}}
  24. {{ $XMPP_GUEST_DOMAIN := .Env.XMPP_GUEST_DOMAIN | default "guest.meet.jitsi" -}}
  25. {{ $XMPP_INTERNAL_MUC_DOMAIN := .Env.XMPP_INTERNAL_MUC_DOMAIN | default "internal-muc.meet.jitsi" -}}
  26. {{ $XMPP_MUC_DOMAIN := .Env.XMPP_MUC_DOMAIN | default "muc.meet.jitsi" -}}
  27. {{ $XMPP_MUC_DOMAIN_PREFIX := (split "." $XMPP_MUC_DOMAIN)._0 }}
  28. {{ $XMPP_RECORDER_DOMAIN := .Env.XMPP_RECORDER_DOMAIN | default "recorder.meet.jitsi" -}}
  29. {{ $DISABLE_POLLS := .Env.DISABLE_POLLS | default "false" | toBool -}}
  30. {{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "true" | toBool -}}
  31. admins = {
  32. "{{ $JICOFO_AUTH_USER }}@{{ $XMPP_AUTH_DOMAIN }}",
  33. "{{ $JVB_AUTH_USER }}@{{ $XMPP_AUTH_DOMAIN }}"
  34. }
  35. unlimited_jids = {
  36. "{{ $JICOFO_AUTH_USER }}@{{ $XMPP_AUTH_DOMAIN }}",
  37. "{{ $JVB_AUTH_USER }}@{{ $XMPP_AUTH_DOMAIN }}"
  38. }
  39. plugin_paths = { "/prosody-plugins/", "/prosody-plugins-custom" }
  40. muc_mapper_domain_base = "{{ $XMPP_DOMAIN }}";
  41. muc_mapper_domain_prefix = "{{ $XMPP_MUC_DOMAIN_PREFIX }}";
  42. http_default_host = "{{ $XMPP_DOMAIN }}"
  43. {{ if .Env.TURN_CREDENTIALS }}
  44. external_service_secret = "{{.Env.TURN_CREDENTIALS}}";
  45. {{ end }}
  46. {{ if or .Env.TURN_HOST .Env.TURNS_HOST }}
  47. external_services = {
  48. {{ if .Env.TURN_HOST }}
  49. { type = "turn", host = "{{ .Env.TURN_HOST }}", port = {{ $TURN_PORT }}, transport = "tcp", secret = true, ttl = 86400, algorithm = "turn" }
  50. {{ end }}
  51. {{ if and .Env.TURN_HOST .Env.TURNS_HOST }}
  52. ,
  53. {{ end }}
  54. {{ if .Env.TURNS_HOST }}
  55. { type = "turns", host = "{{ .Env.TURNS_HOST }}", port = {{ $TURNS_PORT }}, transport = "tcp", secret = true, ttl = 86400, algorithm = "turn" }
  56. {{ end }}
  57. };
  58. {{ end }}
  59. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "jwt") .Env.JWT_ACCEPTED_ISSUERS }}
  60. asap_accepted_issuers = { "{{ join "\",\"" (splitList "," .Env.JWT_ACCEPTED_ISSUERS) }}" }
  61. {{ end }}
  62. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "jwt") .Env.JWT_ACCEPTED_AUDIENCES }}
  63. asap_accepted_audiences = { "{{ join "\",\"" (splitList "," .Env.JWT_ACCEPTED_AUDIENCES) }}" }
  64. {{ end }}
  65. consider_bosh_secure = true;
  66. consider_websocket_secure = true;
  67. {{ if $ENABLE_JAAS_COMPONENTS }}
  68. VirtualHost "jigasi.meet.jitsi"
  69. modules_enabled = {
  70. "ping";
  71. "bosh";
  72. }
  73. authentication = "token"
  74. app_id = "jitsi";
  75. asap_key_server = "https://jaas-public-keys.jitsi.net/jitsi-components/prod-8x8"
  76. asap_accepted_issuers = { "jaas-components" }
  77. asap_accepted_audiences = { "jigasi.{{ $PUBLIC_URL_DOMAIN }}" }
  78. {{ end }}
  79. VirtualHost "{{ $XMPP_DOMAIN }}"
  80. {{ if $ENABLE_AUTH }}
  81. {{ if eq $AUTH_TYPE "jwt" }}
  82. authentication = "{{ $JWT_AUTH_TYPE }}"
  83. app_id = "{{ .Env.JWT_APP_ID }}"
  84. app_secret = "{{ .Env.JWT_APP_SECRET }}"
  85. allow_empty_token = {{ $JWT_ALLOW_EMPTY }}
  86. {{ if $JWT_ASAP_KEYSERVER }}
  87. asap_key_server = "{{ .Env.JWT_ASAP_KEYSERVER }}"
  88. {{ end }}
  89. {{ else if eq $AUTH_TYPE "ldap" }}
  90. authentication = "cyrus"
  91. cyrus_application_name = "xmpp"
  92. allow_unencrypted_plain_auth = true
  93. {{ else if eq $AUTH_TYPE "matrix" }}
  94. authentication = "matrix_user_verification"
  95. app_id = "{{ $MATRIX_UVS_ISSUER }}"
  96. uvs_base_url = "{{ .Env.MATRIX_UVS_URL }}"
  97. {{ if .Env.MATRIX_UVS_AUTH_TOKEN }}
  98. uvs_auth_token = "{{ .Env.MATRIX_UVS_AUTH_TOKEN }}"
  99. {{ end }}
  100. {{ if $MATRIX_UVS_SYNC_POWER_LEVELS }}
  101. uvs_sync_power_levels = true
  102. {{ end }}
  103. {{ else if eq $AUTH_TYPE "internal" }}
  104. authentication = "internal_hashed"
  105. {{ end }}
  106. {{ else }}
  107. authentication = "jitsi-anonymous"
  108. {{ end }}
  109. ssl = {
  110. key = "/config/certs/{{ $XMPP_DOMAIN }}.key";
  111. certificate = "/config/certs/{{ $XMPP_DOMAIN }}.crt";
  112. }
  113. modules_enabled = {
  114. "bosh";
  115. {{ if $ENABLE_XMPP_WEBSOCKET }}
  116. "websocket";
  117. "smacks"; -- XEP-0198: Stream Management
  118. {{ end }}
  119. "pubsub";
  120. "ping";
  121. "speakerstats";
  122. "conference_duration";
  123. {{ if or .Env.TURN_HOST .Env.TURNS_HOST }}
  124. "external_services";
  125. {{ end }}
  126. {{ if $ENABLE_LOBBY }}
  127. "muc_lobby_rooms";
  128. {{ end }}
  129. {{ if $ENABLE_BREAKOUT_ROOMS }}
  130. "muc_breakout_rooms";
  131. {{ end }}
  132. {{ if $ENABLE_AV_MODERATION }}
  133. "av_moderation";
  134. {{ end }}
  135. {{ if .Env.XMPP_MODULES }}
  136. "{{ join "\";\n\"" (splitList "," .Env.XMPP_MODULES) }}";
  137. {{ end }}
  138. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "ldap") }}
  139. "auth_cyrus";
  140. {{end}}
  141. }
  142. main_muc = "{{ $XMPP_MUC_DOMAIN }}"
  143. {{ if $ENABLE_LOBBY }}
  144. lobby_muc = "lobby.{{ $XMPP_DOMAIN }}"
  145. {{ if $ENABLE_RECORDING }}
  146. muc_lobby_whitelist = { "{{ $XMPP_RECORDER_DOMAIN }}" }
  147. {{ end }}
  148. {{ end }}
  149. {{ if $ENABLE_BREAKOUT_ROOMS }}
  150. breakout_rooms_muc = "breakout.{{ $XMPP_DOMAIN }}"
  151. {{ end }}
  152. speakerstats_component = "speakerstats.{{ $XMPP_DOMAIN }}"
  153. conference_duration_component = "conferenceduration.{{ $XMPP_DOMAIN }}"
  154. {{ if $ENABLE_AV_MODERATION }}
  155. av_moderation_component = "avmoderation.{{ $XMPP_DOMAIN }}"
  156. {{ end }}
  157. c2s_require_encryption = false
  158. {{ if $ENABLE_GUEST_DOMAIN }}
  159. VirtualHost "{{ $XMPP_GUEST_DOMAIN }}"
  160. authentication = "jitsi-anonymous"
  161. c2s_require_encryption = false
  162. {{ end }}
  163. VirtualHost "{{ $XMPP_AUTH_DOMAIN }}"
  164. ssl = {
  165. key = "/config/certs/{{ $XMPP_AUTH_DOMAIN }}.key";
  166. certificate = "/config/certs/{{ $XMPP_AUTH_DOMAIN }}.crt";
  167. }
  168. modules_enabled = {
  169. "limits_exception";
  170. }
  171. authentication = "internal_hashed"
  172. {{ if $ENABLE_RECORDING }}
  173. VirtualHost "{{ $XMPP_RECORDER_DOMAIN }}"
  174. modules_enabled = {
  175. "ping";
  176. }
  177. authentication = "internal_hashed"
  178. {{ end }}
  179. Component "{{ $XMPP_INTERNAL_MUC_DOMAIN }}" "muc"
  180. storage = "memory"
  181. modules_enabled = {
  182. "ping";
  183. {{ if .Env.XMPP_INTERNAL_MUC_MODULES -}}
  184. "{{ join "\";\n\"" (splitList "," .Env.XMPP_INTERNAL_MUC_MODULES) }}";
  185. {{ end -}}
  186. }
  187. restrict_room_creation = true
  188. muc_room_locking = false
  189. muc_room_default_public_jids = true
  190. Component "{{ $XMPP_MUC_DOMAIN }}" "muc"
  191. storage = "memory"
  192. modules_enabled = {
  193. "muc_meeting_id";
  194. {{ if .Env.XMPP_MUC_MODULES -}}
  195. "{{ join "\";\n\"" (splitList "," .Env.XMPP_MUC_MODULES) }}";
  196. {{ end -}}
  197. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "jwt") -}}
  198. "{{ $JWT_TOKEN_AUTH_MODULE }}";
  199. {{ end }}
  200. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "matrix") $MATRIX_UVS_SYNC_POWER_LEVELS -}}
  201. "matrix_power_sync";
  202. {{ end -}}
  203. {{ if not $DISABLE_POLLS -}}
  204. "polls";
  205. {{ end -}}
  206. {{ if $ENABLE_SUBDOMAINS -}}
  207. "muc_domain_mapper";
  208. {{ end -}}
  209. }
  210. muc_room_cache_size = 1000
  211. muc_room_locking = false
  212. muc_room_default_public_jids = true
  213. Component "focus.{{ $XMPP_DOMAIN }}" "client_proxy"
  214. target_address = "{{ $JICOFO_AUTH_USER }}@{{ $XMPP_AUTH_DOMAIN }}"
  215. Component "speakerstats.{{ $XMPP_DOMAIN }}" "speakerstats_component"
  216. muc_component = "{{ $XMPP_MUC_DOMAIN }}"
  217. Component "conferenceduration.{{ $XMPP_DOMAIN }}" "conference_duration_component"
  218. muc_component = "{{ $XMPP_MUC_DOMAIN }}"
  219. {{ if $ENABLE_AV_MODERATION }}
  220. Component "avmoderation.{{ $XMPP_DOMAIN }}" "av_moderation_component"
  221. muc_component = "{{ $XMPP_MUC_DOMAIN }}"
  222. {{ end }}
  223. {{ if $ENABLE_LOBBY }}
  224. Component "lobby.{{ $XMPP_DOMAIN }}" "muc"
  225. storage = "memory"
  226. restrict_room_creation = true
  227. muc_room_locking = false
  228. muc_room_default_public_jids = true
  229. {{ end }}
  230. {{ if $ENABLE_BREAKOUT_ROOMS }}
  231. Component "breakout.{{ $XMPP_DOMAIN }}" "muc"
  232. storage = "memory"
  233. restrict_room_creation = true
  234. muc_room_locking = false
  235. muc_room_default_public_jids = true
  236. modules_enabled = {
  237. "muc_meeting_id";
  238. {{ if $ENABLE_SUBDOMAINS -}}
  239. "muc_domain_mapper";
  240. {{ end -}}
  241. {{ if not $DISABLE_POLLS -}}
  242. "polls";
  243. {{ end -}}
  244. }
  245. {{ end }}