jitsi-meet.cfg.lua 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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_END_CONFERENCE := .Env.ENABLE_END_CONFERENCE | default "true" | toBool }}
  20. {{ $ENABLE_XMPP_WEBSOCKET := .Env.ENABLE_XMPP_WEBSOCKET | default "1" | toBool }}
  21. {{ $ENABLE_JAAS_COMPONENTS := .Env.ENABLE_JAAS_COMPONENTS | default "0" | toBool }}
  22. {{ $PUBLIC_URL := .Env.PUBLIC_URL | default "https://localhost:8443" -}}
  23. {{ $PUBLIC_URL_DOMAIN := $PUBLIC_URL | trimPrefix "https://" | trimSuffix "/" -}}
  24. {{ $TURN_PORT := .Env.TURN_PORT | default "443" }}
  25. {{ $TURNS_PORT := .Env.TURNS_PORT | default "443" }}
  26. {{ $TURN_TRANSPORT := .Env.TURN_TRANSPORT | default "tcp" -}}
  27. {{ $TURN_TRANSPORTS := splitList "," $TURN_TRANSPORT -}}
  28. {{ $XMPP_AUTH_DOMAIN := .Env.XMPP_AUTH_DOMAIN | default "auth.meet.jitsi" -}}
  29. {{ $XMPP_DOMAIN := .Env.XMPP_DOMAIN | default "meet.jitsi" -}}
  30. {{ $XMPP_GUEST_DOMAIN := .Env.XMPP_GUEST_DOMAIN | default "guest.meet.jitsi" -}}
  31. {{ $XMPP_INTERNAL_MUC_DOMAIN := .Env.XMPP_INTERNAL_MUC_DOMAIN | default "internal-muc.meet.jitsi" -}}
  32. {{ $XMPP_MUC_DOMAIN := .Env.XMPP_MUC_DOMAIN | default "muc.meet.jitsi" -}}
  33. {{ $XMPP_MUC_DOMAIN_PREFIX := (split "." $XMPP_MUC_DOMAIN)._0 }}
  34. {{ $XMPP_RECORDER_DOMAIN := .Env.XMPP_RECORDER_DOMAIN | default "recorder.meet.jitsi" -}}
  35. {{ $DISABLE_POLLS := .Env.DISABLE_POLLS | default "false" | toBool -}}
  36. {{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "true" | toBool -}}
  37. {{ $PROSODY_RESERVATION_ENABLED := .Env.PROSODY_RESERVATION_ENABLED | default "false" | toBool }}
  38. {{ $PROSODY_RESERVATION_REST_BASE_URL := .Env.PROSODY_RESERVATION_REST_BASE_URL | default "" }}
  39. {{ $ENV := .Env -}}
  40. admins = {
  41. {{ if .Env.JIGASI_XMPP_PASSWORD }}
  42. "{{ $JIGASI_XMPP_USER }}@{{ $XMPP_AUTH_DOMAIN }}",
  43. {{ end }}
  44. {{ if .Env.JIBRI_XMPP_PASSWORD }}
  45. "{{ $JIBRI_XMPP_USER }}@{{ $XMPP_AUTH_DOMAIN }}",
  46. {{ end }}
  47. "{{ $JICOFO_AUTH_USER }}@{{ $XMPP_AUTH_DOMAIN }}",
  48. "{{ $JVB_AUTH_USER }}@{{ $XMPP_AUTH_DOMAIN }}"
  49. }
  50. unlimited_jids = {
  51. "{{ $JICOFO_AUTH_USER }}@{{ $XMPP_AUTH_DOMAIN }}",
  52. "{{ $JVB_AUTH_USER }}@{{ $XMPP_AUTH_DOMAIN }}"
  53. }
  54. plugin_paths = { "/prosody-plugins/", "/prosody-plugins-custom" }
  55. muc_mapper_domain_base = "{{ $XMPP_DOMAIN }}";
  56. muc_mapper_domain_prefix = "{{ $XMPP_MUC_DOMAIN_PREFIX }}";
  57. http_default_host = "{{ $XMPP_DOMAIN }}"
  58. {{ if .Env.TURN_CREDENTIALS }}
  59. external_service_secret = "{{.Env.TURN_CREDENTIALS}}";
  60. {{ end }}
  61. {{ if or .Env.TURN_HOST .Env.TURNS_HOST }}
  62. external_services = {
  63. {{ if .Env.TURN_HOST }}
  64. {{ range $index, $transport := $TURN_TRANSPORTS }}
  65. {{ if gt $index 0 }}
  66. ,
  67. {{ end }}
  68. { type = "turn", host = "{{ $ENV.TURN_HOST }}", port = {{ $TURN_PORT }}, transport = "{{ $transport }}", secret = true, ttl = 86400, algorithm = "turn" }
  69. {{ end }}
  70. {{ end }}
  71. {{ if and .Env.TURN_HOST .Env.TURNS_HOST }}
  72. ,
  73. {{ end }}
  74. {{ if .Env.TURNS_HOST }}
  75. { type = "turns", host = "{{ .Env.TURNS_HOST }}", port = {{ $TURNS_PORT }}, transport = "tcp", secret = true, ttl = 86400, algorithm = "turn" }
  76. {{ end }}
  77. };
  78. {{ end }}
  79. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "jwt") .Env.JWT_ACCEPTED_ISSUERS }}
  80. asap_accepted_issuers = { "{{ join "\",\"" (splitList "," .Env.JWT_ACCEPTED_ISSUERS) }}" }
  81. {{ end }}
  82. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "jwt") .Env.JWT_ACCEPTED_AUDIENCES }}
  83. asap_accepted_audiences = { "{{ join "\",\"" (splitList "," .Env.JWT_ACCEPTED_AUDIENCES) }}" }
  84. {{ end }}
  85. consider_bosh_secure = true;
  86. consider_websocket_secure = true;
  87. {{ if $ENABLE_JAAS_COMPONENTS }}
  88. VirtualHost "jigasi.meet.jitsi"
  89. modules_enabled = {
  90. "ping";
  91. "bosh";
  92. "muc_password_check";
  93. }
  94. authentication = "token"
  95. app_id = "jitsi";
  96. asap_key_server = "https://jaas-public-keys.jitsi.net/jitsi-components/prod-8x8"
  97. asap_accepted_issuers = { "jaas-components" }
  98. asap_accepted_audiences = { "jigasi.{{ $PUBLIC_URL_DOMAIN }}" }
  99. {{ end }}
  100. VirtualHost "{{ $XMPP_DOMAIN }}"
  101. {{ if $ENABLE_AUTH }}
  102. {{ if eq $AUTH_TYPE "jwt" }}
  103. authentication = "{{ $JWT_AUTH_TYPE }}"
  104. app_id = "{{ .Env.JWT_APP_ID }}"
  105. app_secret = "{{ .Env.JWT_APP_SECRET }}"
  106. allow_empty_token = {{ $JWT_ALLOW_EMPTY }}
  107. {{ if $JWT_ASAP_KEYSERVER }}
  108. asap_key_server = "{{ .Env.JWT_ASAP_KEYSERVER }}"
  109. {{ end }}
  110. enable_domain_verification = {{ $JWT_ENABLE_DOMAIN_VERIFICATION }}
  111. {{ else if eq $AUTH_TYPE "ldap" }}
  112. authentication = "cyrus"
  113. cyrus_application_name = "xmpp"
  114. allow_unencrypted_plain_auth = true
  115. {{ else if eq $AUTH_TYPE "matrix" }}
  116. authentication = "matrix_user_verification"
  117. app_id = "{{ $MATRIX_UVS_ISSUER }}"
  118. uvs_base_url = "{{ .Env.MATRIX_UVS_URL }}"
  119. {{ if .Env.MATRIX_UVS_AUTH_TOKEN }}
  120. uvs_auth_token = "{{ .Env.MATRIX_UVS_AUTH_TOKEN }}"
  121. {{ end }}
  122. {{ if $MATRIX_UVS_SYNC_POWER_LEVELS }}
  123. uvs_sync_power_levels = true
  124. {{ end }}
  125. {{ else if eq $AUTH_TYPE "internal" }}
  126. authentication = "internal_hashed"
  127. {{ end }}
  128. {{ else }}
  129. authentication = "jitsi-anonymous"
  130. {{ end }}
  131. ssl = {
  132. key = "/config/certs/{{ $XMPP_DOMAIN }}.key";
  133. certificate = "/config/certs/{{ $XMPP_DOMAIN }}.crt";
  134. }
  135. modules_enabled = {
  136. "bosh";
  137. {{ if $ENABLE_XMPP_WEBSOCKET }}
  138. "websocket";
  139. "smacks"; -- XEP-0198: Stream Management
  140. {{ end }}
  141. "pubsub";
  142. "ping";
  143. "speakerstats";
  144. "conference_duration";
  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.{{ .Env.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 = { "{{ .Env.JICOFO_AUTH_USER }}@{{ .Env.XMPP_AUTH_DOMAIN }}" }
  255. muc_max_occupants = "{{ .Env.MAX_PARTICIPANTS }}"
  256. {{ end }}
  257. Component "focus.{{ $XMPP_DOMAIN }}" "client_proxy"
  258. target_address = "{{ $JICOFO_AUTH_USER }}@{{ $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.{{ .Env.XMPP_DOMAIN }}" "end_conference"
  265. muc_component = "{{ .Env.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 }}