jitsi-meet.cfg.lua 9.9 KB

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