2
0

jitsi-meet.cfg.lua 7.9 KB

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