jitsi-meet.cfg.lua 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. admins = {
  2. "{{ .Env.JICOFO_AUTH_USER }}@{{ .Env.XMPP_AUTH_DOMAIN }}",
  3. "{{ .Env.JVB_AUTH_USER }}@{{ .Env.XMPP_AUTH_DOMAIN }}"
  4. }
  5. unlimited_jids = {
  6. "{{ .Env.JICOFO_AUTH_USER }}@{{ .Env.XMPP_AUTH_DOMAIN }}",
  7. "{{ .Env.JVB_AUTH_USER }}@{{ .Env.XMPP_AUTH_DOMAIN }}"
  8. }
  9. plugin_paths = { "/prosody-plugins/", "/prosody-plugins-custom" }
  10. -- domain mapper options, must at least have domain base set to use the mapper
  11. muc_mapper_domain_base = "{{ .Env.XMPP_DOMAIN }}";
  12. http_default_host = "{{ .Env.XMPP_DOMAIN }}"
  13. {{ $ENABLE_AUTH := .Env.ENABLE_AUTH | default "0" | toBool }}
  14. {{ $ENABLE_GUEST_DOMAIN := and $ENABLE_AUTH (.Env.ENABLE_GUESTS | default "0" | toBool)}}
  15. {{ $AUTH_TYPE := .Env.AUTH_TYPE | default "internal" }}
  16. {{ $JWT_ASAP_KEYSERVER := .Env.JWT_ASAP_KEYSERVER | default "" }}
  17. {{ $JWT_ALLOW_EMPTY := .Env.JWT_ALLOW_EMPTY | default "0" | toBool }}
  18. {{ $JWT_AUTH_TYPE := .Env.JWT_AUTH_TYPE | default "token" }}
  19. {{ $JWT_TOKEN_AUTH_MODULE := .Env.JWT_TOKEN_AUTH_MODULE | default "token_verification" }}
  20. {{ $ENABLE_LOBBY := .Env.ENABLE_LOBBY | default "0" | toBool }}
  21. {{ $ENABLE_XMPP_WEBSOCKET := .Env.ENABLE_XMPP_WEBSOCKET | default "1" | toBool }}
  22. {{ $PUBLIC_URL := .Env.PUBLIC_URL | default "https://localhost:8443" -}}
  23. {{ $TURN_PORT := .Env.TURN_PORT | default "443" }}
  24. {{ $TURNS_PORT := .Env.TURNS_PORT | default "443" }}
  25. {{ if .Env.TURN_CREDENTIALS }}
  26. external_service_secret = "{{.Env.TURN_CREDENTIALS}}";
  27. {{ end }}
  28. {{ if or .Env.TURN_HOST .Env.TURNS_HOST }}
  29. external_services = {
  30. {{ if .Env.TURN_HOST }}
  31. { type = "turn", host = "{{ .Env.TURN_HOST }}", port = {{ $TURN_PORT }}, transport = "tcp", secret = true, ttl = 86400, algorithm = "turn" }
  32. {{ end }}
  33. {{ if and .Env.TURN_HOST .Env.TURNS_HOST }}
  34. ,
  35. {{ end }}
  36. {{ if .Env.TURNS_HOST }}
  37. { type = "turns", host = "{{ .Env.TURNS_HOST }}", port = {{ $TURNS_PORT }}, transport = "tcp", secret = true, ttl = 86400, algorithm = "turn" }
  38. {{ end }}
  39. };
  40. {{ end }}
  41. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "jwt") .Env.JWT_ACCEPTED_ISSUERS }}
  42. asap_accepted_issuers = { "{{ join "\",\"" (splitList "," .Env.JWT_ACCEPTED_ISSUERS) }}" }
  43. {{ end }}
  44. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "jwt") .Env.JWT_ACCEPTED_AUDIENCES }}
  45. asap_accepted_audiences = { "{{ join "\",\"" (splitList "," .Env.JWT_ACCEPTED_AUDIENCES) }}" }
  46. {{ end }}
  47. consider_bosh_secure = true;
  48. -- Deprecated in 0.12
  49. -- https://github.com/bjc/prosody/commit/26542811eafd9c708a130272d7b7de77b92712de
  50. {{ $XMPP_CROSS_DOMAINS := $PUBLIC_URL }}
  51. {{ $XMPP_CROSS_DOMAIN := .Env.XMPP_CROSS_DOMAIN | default "" }}
  52. {{ if eq $XMPP_CROSS_DOMAIN "true"}}
  53. cross_domain_websocket = true
  54. cross_domain_bosh = true
  55. {{ else }}
  56. {{ if not (eq $XMPP_CROSS_DOMAIN "false") }}
  57. {{ $XMPP_CROSS_DOMAINS = list $PUBLIC_URL (print "https://" .Env.XMPP_DOMAIN) .Env.XMPP_CROSS_DOMAIN | join "," }}
  58. {{ end }}
  59. cross_domain_websocket = { "{{ join "\",\"" (splitList "," $XMPP_CROSS_DOMAINS) }}" }
  60. cross_domain_bosh = { "{{ join "\",\"" (splitList "," $XMPP_CROSS_DOMAINS) }}" }
  61. {{ end }}
  62. VirtualHost "{{ .Env.XMPP_DOMAIN }}"
  63. {{ if $ENABLE_AUTH }}
  64. {{ if eq $AUTH_TYPE "jwt" }}
  65. authentication = "{{ $JWT_AUTH_TYPE }}"
  66. app_id = "{{ .Env.JWT_APP_ID }}"
  67. app_secret = "{{ .Env.JWT_APP_SECRET }}"
  68. allow_empty_token = {{ if $JWT_ALLOW_EMPTY }}true{{ else }}false{{ end }}
  69. {{ if $JWT_ASAP_KEYSERVER }}
  70. asap_key_server = "{{ .Env.JWT_ASAP_KEYSERVER }}"
  71. {{ end }}
  72. {{ else if eq $AUTH_TYPE "ldap" }}
  73. authentication = "cyrus"
  74. cyrus_application_name = "xmpp"
  75. allow_unencrypted_plain_auth = true
  76. {{ else if eq $AUTH_TYPE "internal" }}
  77. authentication = "internal_hashed"
  78. {{ end }}
  79. {{ else }}
  80. -- https://github.com/jitsi/docker-jitsi-meet/pull/502#issuecomment-619146339
  81. {{ if $ENABLE_XMPP_WEBSOCKET }}
  82. authentication = "token"
  83. {{ else }}
  84. authentication = "anonymous"
  85. {{ end }}
  86. app_id = ""
  87. app_secret = ""
  88. allow_empty_token = true
  89. {{ end }}
  90. ssl = {
  91. key = "/config/certs/{{ .Env.XMPP_DOMAIN }}.key";
  92. certificate = "/config/certs/{{ .Env.XMPP_DOMAIN }}.crt";
  93. }
  94. modules_enabled = {
  95. "bosh";
  96. {{ if $ENABLE_XMPP_WEBSOCKET }}
  97. "websocket";
  98. "smacks"; -- XEP-0198: Stream Management
  99. {{ end }}
  100. "pubsub";
  101. "ping";
  102. "speakerstats";
  103. "conference_duration";
  104. {{ if or .Env.TURN_HOST .Env.TURNS_HOST }}
  105. "external_services";
  106. {{ end }}
  107. {{ if $ENABLE_LOBBY }}
  108. "muc_lobby_rooms";
  109. {{ end }}
  110. {{ if .Env.XMPP_MODULES }}
  111. "{{ join "\";\n\"" (splitList "," .Env.XMPP_MODULES) }}";
  112. {{ end }}
  113. {{ if and $ENABLE_AUTH (eq $AUTH_TYPE "ldap") }}
  114. "auth_cyrus";
  115. {{end}}
  116. }
  117. {{ if $ENABLE_LOBBY }}
  118. main_muc = "{{ .Env.XMPP_MUC_DOMAIN }}"
  119. lobby_muc = "lobby.{{ .Env.XMPP_DOMAIN }}"
  120. {{ if .Env.XMPP_RECORDER_DOMAIN }}
  121. muc_lobby_whitelist = { "{{ .Env.XMPP_RECORDER_DOMAIN }}" }
  122. {{ end }}
  123. {{ end }}
  124. speakerstats_component = "speakerstats.{{ .Env.XMPP_DOMAIN }}"
  125. conference_duration_component = "conferenceduration.{{ .Env.XMPP_DOMAIN }}"
  126. c2s_require_encryption = false
  127. {{ if $ENABLE_GUEST_DOMAIN }}
  128. VirtualHost "{{ .Env.XMPP_GUEST_DOMAIN }}"
  129. -- https://github.com/jitsi/docker-jitsi-meet/pull/502#issuecomment-619146339
  130. {{ if $ENABLE_XMPP_WEBSOCKET }}
  131. authentication = "token"
  132. {{ else }}
  133. authentication = "anonymous"
  134. {{ end }}
  135. app_id = ""
  136. app_secret = ""
  137. allow_empty_token = true
  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. }
  178. muc_room_cache_size = 1000
  179. muc_room_locking = false
  180. muc_room_default_public_jids = true
  181. Component "focus.{{ .Env.XMPP_DOMAIN }}" "client_proxy"
  182. target_address = "{{ .Env.JICOFO_AUTH_USER }}@{{ .Env.XMPP_AUTH_DOMAIN }}"
  183. Component "speakerstats.{{ .Env.XMPP_DOMAIN }}" "speakerstats_component"
  184. muc_component = "{{ .Env.XMPP_MUC_DOMAIN }}"
  185. Component "conferenceduration.{{ .Env.XMPP_DOMAIN }}" "conference_duration_component"
  186. muc_component = "{{ .Env.XMPP_MUC_DOMAIN }}"
  187. {{ if $ENABLE_LOBBY }}
  188. Component "lobby.{{ .Env.XMPP_DOMAIN }}" "muc"
  189. storage = "memory"
  190. restrict_room_creation = true
  191. muc_room_locking = false
  192. muc_room_default_public_jids = true
  193. {{ end }}