jitsi-meet.cfg.lua 10 KB

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