jitsi-meet.cfg.lua 7.9 KB

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