jitsi-meet.cfg.lua 13 KB

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