jitsi-meet.cfg.lua 11 KB

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