jitsi-meet.cfg.lua 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  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. {{ $ENABLE_RATE_LIMITS := .Env.PROSODY_ENABLE_RATE_LIMITS | default "0" | toBool -}}
  22. {{ $PUBLIC_URL := .Env.PUBLIC_URL | default "https://localhost:8443" -}}
  23. {{ $PUBLIC_URL_DOMAIN := $PUBLIC_URL | trimPrefix "https://" | trimSuffix "/" -}}
  24. {{ $TURN_HOST := .Env.TURN_HOST | default "" -}}
  25. {{ $TURN_HOSTS := splitList "," $TURN_HOST -}}
  26. {{ $TURN_PORT := .Env.TURN_PORT | default "443" -}}
  27. {{ $TURN_TRANSPORT := .Env.TURN_TRANSPORT | default "tcp" -}}
  28. {{ $TURN_TRANSPORTS := splitList "," $TURN_TRANSPORT -}}
  29. {{ $TURNS_HOST := .Env.TURNS_HOST | default "" -}}
  30. {{ $TURNS_HOSTS := splitList "," $TURNS_HOST -}}
  31. {{ $TURNS_PORT := .Env.TURNS_PORT | default "443" -}}
  32. {{ $XMPP_AUTH_DOMAIN := .Env.XMPP_AUTH_DOMAIN | default "auth.meet.jitsi" -}}
  33. {{ $XMPP_DOMAIN := .Env.XMPP_DOMAIN | default "meet.jitsi" -}}
  34. {{ $XMPP_GUEST_DOMAIN := .Env.XMPP_GUEST_DOMAIN | default "guest.meet.jitsi" -}}
  35. {{ $XMPP_INTERNAL_MUC_DOMAIN := .Env.XMPP_INTERNAL_MUC_DOMAIN | default "internal-muc.meet.jitsi" -}}
  36. {{ $XMPP_MUC_DOMAIN := .Env.XMPP_MUC_DOMAIN | default "muc.meet.jitsi" -}}
  37. {{ $XMPP_MUC_DOMAIN_PREFIX := (split "." $XMPP_MUC_DOMAIN)._0 -}}
  38. {{ $XMPP_RECORDER_DOMAIN := .Env.XMPP_RECORDER_DOMAIN | default "recorder.meet.jitsi" -}}
  39. {{ $JIBRI_RECORDER_USER := .Env.JIBRI_RECORDER_USER | default "recorder" -}}
  40. {{ $JIGASI_TRANSCRIBER_USER := .Env.JIGASI_TRANSCRIBER_USER | default "transcriber" -}}
  41. {{ $DISABLE_POLLS := .Env.DISABLE_POLLS | default "false" | toBool -}}
  42. {{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "true" | toBool -}}
  43. {{ $PROSODY_RESERVATION_ENABLED := .Env.PROSODY_RESERVATION_ENABLED | default "false" | toBool -}}
  44. {{ $PROSODY_RESERVATION_REST_BASE_URL := .Env.PROSODY_RESERVATION_REST_BASE_URL | default "" -}}
  45. {{ $RATE_LIMIT_LOGIN_RATE := .Env.PROSODY_RATE_LIMIT_LOGIN_RATE | default "3" -}}
  46. {{ $RATE_LIMIT_SESSION_RATE := .Env.PROSODY_RATE_LIMIT_SESSION_RATE | default "200" -}}
  47. {{ $RATE_LIMIT_TIMEOUT := .Env.PROSODY_RATE_LIMIT_TIMEOUT | default "60" -}}
  48. {{ $RATE_LIMIT_ALLOW_RANGES := .Env.PROSODY_RATE_LIMIT_ALLOW_RANGES | default "10.0.0.0/8" -}}
  49. {{ $RATE_LIMIT_CACHE_SIZE := .Env.PROSODY_RATE_LIMIT_CACHE_SIZE | default "10000" -}}
  50. {{ $ENV := .Env -}}
  51. admins = {
  52. {{ if .Env.JIGASI_XMPP_PASSWORD }}
  53. "{{ $JIGASI_XMPP_USER }}@{{ $XMPP_AUTH_DOMAIN }}",
  54. {{ end }}
  55. {{ if .Env.JIBRI_XMPP_PASSWORD }}
  56. "{{ $JIBRI_XMPP_USER }}@{{ $XMPP_AUTH_DOMAIN }}",
  57. {{ end }}
  58. "focus@{{ $XMPP_AUTH_DOMAIN }}",
  59. "{{ $JVB_AUTH_USER }}@{{ $XMPP_AUTH_DOMAIN }}"
  60. }
  61. unlimited_jids = {
  62. "focus@{{ $XMPP_AUTH_DOMAIN }}",
  63. "{{ $JVB_AUTH_USER }}@{{ $XMPP_AUTH_DOMAIN }}"
  64. }
  65. plugin_paths = { "/prosody-plugins/", "/prosody-plugins-custom" }
  66. muc_mapper_domain_base = "{{ $XMPP_DOMAIN }}";
  67. muc_mapper_domain_prefix = "{{ $XMPP_MUC_DOMAIN_PREFIX }}";
  68. http_default_host = "{{ $XMPP_DOMAIN }}"
  69. {{ if .Env.TURN_CREDENTIALS -}}
  70. external_service_secret = "{{.Env.TURN_CREDENTIALS}}";
  71. {{- end }}
  72. {{ if or .Env.TURN_HOST .Env.TURNS_HOST -}}
  73. external_services = {
  74. {{ if $TURN_HOST -}}
  75. {{- range $idx1, $host := $TURN_HOSTS -}}
  76. {{- range $idx2, $transport := $TURN_TRANSPORTS -}}
  77. {{- if or $idx1 $idx2 -}},{{- end }}
  78. { type = "turn", host = "{{ $host }}", port = {{ $TURN_PORT }}, transport = "{{ $transport }}", secret = true, ttl = 86400, algorithm = "turn" }
  79. {{- end -}}
  80. {{- end -}}
  81. {{- end -}}
  82. {{- if $TURNS_HOST -}}
  83. {{- range $idx, $host := $TURNS_HOSTS -}}
  84. {{- if or $TURN_HOST $idx -}},{{- end }}
  85. { type = "turns", host = "{{ $host }}", port = {{ $TURNS_PORT }}, transport = "tcp", secret = true, ttl = 86400, algorithm = "turn" }
  86. {{- end }}
  87. {{- end }}
  88. };
  89. {{- end }}
  90. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "jwt") .Env.JWT_ACCEPTED_ISSUERS }}
  91. asap_accepted_issuers = { "{{ join "\",\"" (splitList "," .Env.JWT_ACCEPTED_ISSUERS) }}" }
  92. {{ end }}
  93. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "jwt") .Env.JWT_ACCEPTED_AUDIENCES }}
  94. asap_accepted_audiences = { "{{ join "\",\"" (splitList "," .Env.JWT_ACCEPTED_AUDIENCES) }}" }
  95. {{ end }}
  96. consider_bosh_secure = true;
  97. consider_websocket_secure = true;
  98. {{ if $ENABLE_JAAS_COMPONENTS }}
  99. VirtualHost "jigasi.meet.jitsi"
  100. modules_enabled = {
  101. "ping";
  102. "bosh";
  103. "muc_password_check";
  104. }
  105. authentication = "token"
  106. app_id = "jitsi";
  107. asap_key_server = "https://jaas-public-keys.jitsi.net/jitsi-components/prod-8x8"
  108. asap_accepted_issuers = { "jaas-components" }
  109. asap_accepted_audiences = { "jigasi.{{ $PUBLIC_URL_DOMAIN }}" }
  110. {{ end }}
  111. VirtualHost "{{ $XMPP_DOMAIN }}"
  112. {{ if $ENABLE_AUTH }}
  113. {{ if eq $AUTH_TYPE "jwt" }}
  114. authentication = "{{ $JWT_AUTH_TYPE }}"
  115. app_id = "{{ .Env.JWT_APP_ID }}"
  116. app_secret = "{{ .Env.JWT_APP_SECRET }}"
  117. allow_empty_token = {{ $JWT_ALLOW_EMPTY }}
  118. {{ if $JWT_ASAP_KEYSERVER }}
  119. asap_key_server = "{{ .Env.JWT_ASAP_KEYSERVER }}"
  120. {{ end }}
  121. enable_domain_verification = {{ $JWT_ENABLE_DOMAIN_VERIFICATION }}
  122. {{ else if eq $AUTH_TYPE "ldap" }}
  123. authentication = "cyrus"
  124. cyrus_application_name = "xmpp"
  125. allow_unencrypted_plain_auth = true
  126. {{ else if eq $AUTH_TYPE "matrix" }}
  127. authentication = "matrix_user_verification"
  128. app_id = "{{ $MATRIX_UVS_ISSUER }}"
  129. uvs_base_url = "{{ .Env.MATRIX_UVS_URL }}"
  130. {{ if .Env.MATRIX_UVS_AUTH_TOKEN }}
  131. uvs_auth_token = "{{ .Env.MATRIX_UVS_AUTH_TOKEN }}"
  132. {{ end }}
  133. {{ if $MATRIX_UVS_SYNC_POWER_LEVELS }}
  134. uvs_sync_power_levels = true
  135. {{ end }}
  136. {{ else if eq $AUTH_TYPE "internal" }}
  137. authentication = "internal_hashed"
  138. {{ end }}
  139. {{ else }}
  140. authentication = "jitsi-anonymous"
  141. {{ end }}
  142. ssl = {
  143. key = "/config/certs/{{ $XMPP_DOMAIN }}.key";
  144. certificate = "/config/certs/{{ $XMPP_DOMAIN }}.crt";
  145. }
  146. modules_enabled = {
  147. "bosh";
  148. {{ if $ENABLE_XMPP_WEBSOCKET }}
  149. "websocket";
  150. "smacks"; -- XEP-0198: Stream Management
  151. {{ end }}
  152. "pubsub";
  153. "ping";
  154. "speakerstats";
  155. "conference_duration";
  156. "room_metadata";
  157. {{ if $ENABLE_END_CONFERENCE }}
  158. "end_conference";
  159. {{ end }}
  160. {{ if or .Env.TURN_HOST .Env.TURNS_HOST }}
  161. "external_services";
  162. {{ end }}
  163. {{ if $ENABLE_LOBBY }}
  164. "muc_lobby_rooms";
  165. {{ end }}
  166. {{ if $ENABLE_BREAKOUT_ROOMS }}
  167. "muc_breakout_rooms";
  168. {{ end }}
  169. {{ if $ENABLE_AV_MODERATION }}
  170. "av_moderation";
  171. {{ end }}
  172. {{ if .Env.XMPP_MODULES }}
  173. "{{ join "\";\n\"" (splitList "," .Env.XMPP_MODULES) }}";
  174. {{ end }}
  175. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "ldap") }}
  176. "auth_cyrus";
  177. {{end}}
  178. {{ if $PROSODY_RESERVATION_ENABLED }}
  179. "reservations";
  180. {{ end }}
  181. }
  182. main_muc = "{{ $XMPP_MUC_DOMAIN }}"
  183. {{ if $ENABLE_LOBBY }}
  184. lobby_muc = "lobby.{{ $XMPP_DOMAIN }}"
  185. {{ if $ENABLE_RECORDING }}
  186. muc_lobby_whitelist = { "{{ $XMPP_RECORDER_DOMAIN }}" }
  187. {{ end }}
  188. {{ end }}
  189. {{ if $PROSODY_RESERVATION_ENABLED }}
  190. reservations_api_prefix = "{{ $PROSODY_RESERVATION_REST_BASE_URL }}"
  191. {{ end }}
  192. {{ if $ENABLE_BREAKOUT_ROOMS }}
  193. breakout_rooms_muc = "breakout.{{ $XMPP_DOMAIN }}"
  194. {{ end }}
  195. speakerstats_component = "speakerstats.{{ $XMPP_DOMAIN }}"
  196. conference_duration_component = "conferenceduration.{{ $XMPP_DOMAIN }}"
  197. {{ if $ENABLE_END_CONFERENCE }}
  198. end_conference_component = "endconference.{{ $XMPP_DOMAIN }}"
  199. {{ end }}
  200. {{ if $ENABLE_AV_MODERATION }}
  201. av_moderation_component = "avmoderation.{{ $XMPP_DOMAIN }}"
  202. {{ end }}
  203. c2s_require_encryption = false
  204. {{ if $ENABLE_GUEST_DOMAIN }}
  205. VirtualHost "{{ $XMPP_GUEST_DOMAIN }}"
  206. authentication = "jitsi-anonymous"
  207. c2s_require_encryption = false
  208. {{ end }}
  209. VirtualHost "{{ $XMPP_AUTH_DOMAIN }}"
  210. ssl = {
  211. key = "/config/certs/{{ $XMPP_AUTH_DOMAIN }}.key";
  212. certificate = "/config/certs/{{ $XMPP_AUTH_DOMAIN }}.crt";
  213. }
  214. modules_enabled = {
  215. "limits_exception";
  216. }
  217. authentication = "internal_hashed"
  218. {{ if $ENABLE_RECORDING }}
  219. VirtualHost "{{ $XMPP_RECORDER_DOMAIN }}"
  220. modules_enabled = {
  221. "ping";
  222. }
  223. authentication = "internal_hashed"
  224. {{ end }}
  225. Component "{{ $XMPP_INTERNAL_MUC_DOMAIN }}" "muc"
  226. storage = "memory"
  227. modules_enabled = {
  228. "ping";
  229. {{ if .Env.XMPP_INTERNAL_MUC_MODULES -}}
  230. "{{ join "\";\n\"" (splitList "," .Env.XMPP_INTERNAL_MUC_MODULES) }}";
  231. {{ end -}}
  232. }
  233. restrict_room_creation = true
  234. muc_room_locking = false
  235. muc_room_default_public_jids = true
  236. Component "{{ $XMPP_MUC_DOMAIN }}" "muc"
  237. restrict_room_creation = true
  238. storage = "memory"
  239. modules_enabled = {
  240. "muc_meeting_id";
  241. {{ if .Env.XMPP_MUC_MODULES -}}
  242. "{{ join "\";\n\"" (splitList "," .Env.XMPP_MUC_MODULES) }}";
  243. {{ end -}}
  244. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "jwt") -}}
  245. "{{ $JWT_TOKEN_AUTH_MODULE }}";
  246. {{ end }}
  247. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "matrix") $MATRIX_UVS_SYNC_POWER_LEVELS -}}
  248. "matrix_power_sync";
  249. {{ end -}}
  250. {{ if not $DISABLE_POLLS -}}
  251. "polls";
  252. {{ end -}}
  253. {{ if $ENABLE_SUBDOMAINS -}}
  254. "muc_domain_mapper";
  255. {{ end -}}
  256. {{ if $ENABLE_RATE_LIMITS -}}
  257. "muc_rate_limit";
  258. "rate_limit";
  259. {{ end -}}
  260. {{ if .Env.MAX_PARTICIPANTS }}
  261. "muc_max_occupants";
  262. {{ end }}
  263. "muc_password_whitelist";
  264. }
  265. {{ if $ENABLE_RATE_LIMITS -}}
  266. -- Max allowed join/login rate in events per second.
  267. rate_limit_login_rate = {{ $RATE_LIMIT_LOGIN_RATE }};
  268. -- The rate to which sessions from IPs exceeding the join rate will be limited, in bytes per second.
  269. rate_limit_session_rate = {{ $RATE_LIMIT_SESSION_RATE }};
  270. -- The time in seconds, after which the limit for an IP address is lifted.
  271. rate_limit_timeout = {{ $RATE_LIMIT_TIMEOUT }};
  272. -- List of regular expressions for IP addresses that are not limited by this module.
  273. rate_limit_whitelist = {
  274. "127.0.0.1";
  275. {{ range $index, $cidr := (splitList "," $RATE_LIMIT_ALLOW_RANGES) -}}
  276. "{{ $cidr }}";
  277. {{ end -}}
  278. };
  279. rate_limit_whitelist_jids = {
  280. "{{ $JIBRI_RECORDER_USER }}@{{ $XMPP_RECORDER_DOMAIN }}",
  281. "{{ $JIGASI_TRANSCRIBER_USER }}@{{ $XMPP_RECORDER_DOMAIN }}"
  282. }
  283. {{ end -}}
  284. -- The size of the cache that saves state for IP addresses
  285. rate_limit_cache_size = {{ $RATE_LIMIT_CACHE_SIZE }};
  286. muc_room_cache_size = 1000
  287. muc_room_locking = false
  288. muc_room_default_public_jids = true
  289. {{ if .Env.XMPP_MUC_CONFIGURATION -}}
  290. {{ join "\n" (splitList "," .Env.XMPP_MUC_CONFIGURATION) }}
  291. {{ end -}}
  292. {{ if .Env.MAX_PARTICIPANTS }}
  293. muc_access_whitelist = { "focus@{{ .Env.XMPP_AUTH_DOMAIN }}" }
  294. muc_max_occupants = "{{ .Env.MAX_PARTICIPANTS }}"
  295. {{ end }}
  296. muc_password_whitelist = {
  297. "focus@{{ .Env.XMPP_AUTH_DOMAIN }}"
  298. }
  299. Component "focus.{{ $XMPP_DOMAIN }}" "client_proxy"
  300. target_address = "focus@{{ $XMPP_AUTH_DOMAIN }}"
  301. Component "speakerstats.{{ $XMPP_DOMAIN }}" "speakerstats_component"
  302. muc_component = "{{ $XMPP_MUC_DOMAIN }}"
  303. Component "conferenceduration.{{ $XMPP_DOMAIN }}" "conference_duration_component"
  304. muc_component = "{{ $XMPP_MUC_DOMAIN }}"
  305. {{ if $ENABLE_END_CONFERENCE }}
  306. Component "endconference.{{ $XMPP_DOMAIN }}" "end_conference"
  307. muc_component = "{{ $XMPP_MUC_DOMAIN }}"
  308. {{ end }}
  309. {{ if $ENABLE_AV_MODERATION }}
  310. Component "avmoderation.{{ $XMPP_DOMAIN }}" "av_moderation_component"
  311. muc_component = "{{ $XMPP_MUC_DOMAIN }}"
  312. {{ end }}
  313. {{ if $ENABLE_LOBBY }}
  314. Component "lobby.{{ $XMPP_DOMAIN }}" "muc"
  315. storage = "memory"
  316. restrict_room_creation = true
  317. muc_room_locking = false
  318. muc_room_default_public_jids = true
  319. modules_enabled = {
  320. {{ if $ENABLE_RATE_LIMITS -}}
  321. "muc_rate_limit";
  322. {{ end -}}
  323. }
  324. {{ end }}
  325. {{ if $ENABLE_BREAKOUT_ROOMS }}
  326. Component "breakout.{{ $XMPP_DOMAIN }}" "muc"
  327. storage = "memory"
  328. restrict_room_creation = true
  329. muc_room_locking = false
  330. muc_room_default_public_jids = true
  331. modules_enabled = {
  332. "muc_meeting_id";
  333. {{ if $ENABLE_SUBDOMAINS -}}
  334. "muc_domain_mapper";
  335. {{ end -}}
  336. {{ if not $DISABLE_POLLS -}}
  337. "polls";
  338. {{ end -}}
  339. {{ if $ENABLE_RATE_LIMITS -}}
  340. "muc_rate_limit";
  341. {{ end -}}
  342. }
  343. {{ end }}
  344. Component "metadata.{{ $XMPP_DOMAIN }}" "room_metadata_component"
  345. muc_component = "{{ $XMPP_MUC_DOMAIN }}"
  346. breakout_rooms_component = "breakout.{{ $XMPP_DOMAIN }}"