jitsi-meet.cfg.lua 14 KB

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