jitsi-meet.cfg.lua 11 KB

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