jitsi-meet.cfg.lua 7.8 KB

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