jitsi-meet.cfg.lua 8.9 KB

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