jicofo.conf 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. {{ $ENABLE_AUTH := .Env.ENABLE_AUTH | default "0" -}}
  2. {{ $ENABLE_VISITORS := .Env.ENABLE_VISITORS | default "0" | toBool -}}
  3. {{ $JICOFO_ENABLE_AUTH := .Env.JICOFO_ENABLE_AUTH | default $ENABLE_AUTH | toBool -}}
  4. {{ $AUTH_TYPE := .Env.AUTH_TYPE | default "internal" -}}
  5. {{ $JICOFO_AUTH_TYPE := .Env.JICOFO_AUTH_TYPE | default $AUTH_TYPE -}}
  6. {{ $JICOFO_AUTH_LIFETIME := .Env.JICOFO_AUTH_LIFETIME | default "24 hours" -}}
  7. {{ $ENABLE_SCTP := .Env.ENABLE_SCTP | default "1" | toBool -}}
  8. {{ $ENABLE_RECORDING := .Env.ENABLE_RECORDING | default "0" | toBool -}}
  9. {{ $ENABLE_TRANSCRIPTIONS := .Env.ENABLE_TRANSCRIPTIONS | default "0" | toBool -}}
  10. {{ $ENABLE_OCTO := .Env.ENABLE_OCTO | default "0" | toBool -}}
  11. {{ $ENABLE_OCTO_SCTP := .Env.ENABLE_OCTO_SCTP | default $ENABLE_SCTP | toBool -}}
  12. {{ $ENABLE_AUTO_LOGIN := .Env.ENABLE_AUTO_LOGIN | default "1" | toBool -}}
  13. {{ $ENABLE_REST := .Env.JICOFO_ENABLE_REST | default "0" | toBool -}}
  14. {{ $ENABLE_JVB_XMPP_SERVER := .Env.ENABLE_JVB_XMPP_SERVER | default "0" | toBool -}}
  15. {{ $ENABLE_SHARED_DOCUMENT_RANDOM_NAME := .Env.ENABLE_SHARED_DOCUMENT_RANDOM_NAME | default "0" | toBool -}}
  16. {{ $HEALTH_CHECKS_USE_PRESENCE := .Env.JICOFO_HEALTH_CHECKS_USE_PRESENCE | default "0" | toBool -}}
  17. {{ $JIBRI_BREWERY_MUC := .Env.JIBRI_BREWERY_MUC | default "jibribrewery" -}}
  18. {{ $JIGASI_BREWERY_MUC := .Env.JIGASI_BREWERY_MUC | default "jigasibrewery" -}}
  19. {{ $JVB_BREWERY_MUC := .Env.JVB_BREWERY_MUC | default "jvbbrewery" -}}
  20. {{ $JIBRI_PENDING_TIMEOUT := .Env.JIBRI_PENDING_TIMEOUT | default "90 seconds" -}}
  21. {{ $JVB_XMPP_AUTH_DOMAIN := .Env.JVB_XMPP_AUTH_DOMAIN | default "auth.jvb.meet.jitsi" -}}
  22. {{ $JVB_XMPP_INTERNAL_MUC_DOMAIN := .Env.JVB_XMPP_INTERNAL_MUC_DOMAIN | default "muc.jvb.meet.jitsi" -}}
  23. {{ $JVB_XMPP_PORT := .Env.JVB_XMPP_PORT | default "6222" -}}
  24. {{ $JVB_XMPP_SERVER := .Env.JVB_XMPP_SERVER | default "xmpp.jvb.meet.jitsi" -}}
  25. {{ $VISITORS_MAX_VISITORS_PER_NODE := .Env.VISITORS_MAX_VISITORS_PER_NODE | default "250" }}
  26. {{ $VISITORS_MUC_PREFIX := .Env.PROSODY_VISITORS_MUC_PREFIX | default "muc" -}}
  27. {{ $VISITORS_REQUIRE_MUC_CONFIG := .Env.JICOFO_VISITORS_REQUIRE_MUC_CONFIG | default "0" | toBool }}
  28. {{ $VISITORS_XMPP_AUTH_DOMAIN := .Env.VISITORS_XMPP_AUTH_DOMAIN | default "auth.meet.jitsi" -}}
  29. {{ $VISITORS_XMPP_DOMAIN := .Env.VISITORS_XMPP_DOMAIN | default "meet.jitsi" -}}
  30. {{ $VISITORS_XMPP_SERVER := .Env.VISITORS_XMPP_SERVER | default "" -}}
  31. {{ $VISITORS_XMPP_SERVERS := splitList "," $VISITORS_XMPP_SERVER | compact -}}
  32. {{ $VISITORS_XMPP_PORT := .Env.VISITORS_XMPP_PORT | default 52220 }}
  33. {{ $XMPP_AUTH_DOMAIN := .Env.XMPP_AUTH_DOMAIN | default "auth.meet.jitsi" -}}
  34. {{ $XMPP_MUC_DOMAIN := .Env.XMPP_MUC_DOMAIN | default "muc.meet.jitsi" -}}
  35. {{ $XMPP_INTERNAL_MUC_DOMAIN := .Env.XMPP_INTERNAL_MUC_DOMAIN | default "internal-muc.meet.jitsi" -}}
  36. {{ $XMPP_DOMAIN := .Env.XMPP_DOMAIN | default "meet.jitsi" -}}
  37. {{ $XMPP_HIDDEN_DOMAIN := .Env.XMPP_HIDDEN_DOMAIN | default "hidden.meet.jitsi" -}}
  38. {{ $XMPP_PORT := .Env.XMPP_PORT | default "5222" -}}
  39. {{ $XMPP_SERVER := .Env.XMPP_SERVER | default "xmpp.meet.jitsi" -}}
  40. {{ $MAX_SSRCS_PER_USER := .Env.MAX_SSRCS_PER_USER | default "20" -}}
  41. {{ $MAX_SSRC_GROUPS_PER_USER := .Env.MAX_SSRC_GROUPS_PER_USER | default $MAX_SSRCS_PER_USER -}}
  42. {{ $TRUSTED_DOMAIN_LIST := .Env.JICOFO_TRUSTED_DOMAINS | default (or $ENABLE_RECORDING $ENABLE_TRANSCRIPTIONS | ternary $XMPP_HIDDEN_DOMAIN "") -}}
  43. {{ $TRUSTED_DOMAINS := splitList "," $TRUSTED_DOMAIN_LIST | compact -}}
  44. {{ $ENV := .Env }}
  45. jicofo {
  46. {{ if $JICOFO_ENABLE_AUTH }}
  47. authentication {
  48. enabled = true
  49. // The type of authentication. Supported values are XMPP or JWT.
  50. {{ if eq $JICOFO_AUTH_TYPE "jwt" }}
  51. type = JWT
  52. {{ else }}
  53. type = XMPP
  54. {{ end }}
  55. login-url = "{{ $XMPP_DOMAIN }}"
  56. enable-auto-login = {{ $ENABLE_AUTO_LOGIN }}
  57. authentication-lifetime = {{ $JICOFO_AUTH_LIFETIME }}
  58. }
  59. {{ end }}
  60. // Configuration related to jitsi-videobridge
  61. bridge {
  62. {{ if .Env.MAX_BRIDGE_PARTICIPANTS }}
  63. max-bridge-participants = "{{ .Env.MAX_BRIDGE_PARTICIPANTS }}"
  64. {{ end }}
  65. {{ if .Env.BRIDGE_AVG_PARTICIPANT_STRESS }}
  66. // The assumed average stress per participant. default is 0.01
  67. average-participant-stress = "{{ .Env.BRIDGE_AVG_PARTICIPANT_STRESS }}"
  68. {{ end }}
  69. {{ if .Env.BRIDGE_STRESS_THRESHOLD }}
  70. // The stress level above which a bridge is considered overstressed. 0.8 is the default value
  71. stress-threshold = "{{ .Env.BRIDGE_STRESS_THRESHOLD }}"
  72. {{ end }}
  73. {{ if $ENABLE_VISITORS }}
  74. selection-strategy = VisitorSelectionStrategy
  75. visitor-selection-strategy = RegionBasedBridgeSelectionStrategy
  76. participant-selection-strategy = RegionBasedBridgeSelectionStrategy
  77. topology-strategy = VisitorTopologyStrategy
  78. {{ else }}
  79. {{ if .Env.OCTO_BRIDGE_SELECTION_STRATEGY }}
  80. selection-strategy = "{{ .Env.OCTO_BRIDGE_SELECTION_STRATEGY }}"
  81. {{ end }}
  82. {{ end }}
  83. {{ if .Env.JICOFO_ENABLE_BRIDGE_HEALTH_CHECKS }}
  84. health-checks {
  85. enabled = {{ .Env.JICOFO_ENABLE_BRIDGE_HEALTH_CHECKS | toBool }}
  86. use-presence = {{ $HEALTH_CHECKS_USE_PRESENCE }}
  87. }
  88. {{ end }}
  89. {{ if $ENABLE_JVB_XMPP_SERVER }}
  90. brewery-jid = "{{ $JVB_BREWERY_MUC }}@{{ $JVB_XMPP_INTERNAL_MUC_DOMAIN }}"
  91. {{ else }}
  92. brewery-jid = "{{ $JVB_BREWERY_MUC }}@{{ $XMPP_INTERNAL_MUC_DOMAIN }}"
  93. {{ end }}
  94. {{ if .Env.JICOFO_BRIDGE_REGION_GROUPS }}
  95. region-groups = [{{ .Env.JICOFO_BRIDGE_REGION_GROUPS }}]
  96. {{ end }}
  97. }
  98. // Configure the codecs and RTP extensions to be used in the offer sent to clients.
  99. codec {
  100. video {
  101. {{ if .Env.ENABLE_CODEC_VP8 }}
  102. vp8 {
  103. enabled = {{ .Env.ENABLE_CODEC_VP8 | toBool }}
  104. }
  105. {{ end }}
  106. {{ if .Env.ENABLE_CODEC_VP9 }}
  107. vp9 {
  108. enabled = {{ .Env.ENABLE_CODEC_VP9 | toBool }}
  109. }
  110. {{ end }}
  111. {{ if .Env.ENABLE_CODEC_AV1 }}
  112. av1 {
  113. enabled = {{ .Env.ENABLE_CODEC_AV1 | toBool }}
  114. }
  115. {{ end }}
  116. {{ if .Env.ENABLE_CODEC_H264 }}
  117. h264 {
  118. enabled = {{ .Env.ENABLE_CODEC_H264 | toBool }}
  119. }
  120. {{ end }}
  121. }
  122. audio {
  123. {{ if .Env.ENABLE_CODEC_OPUS_RED }}
  124. opus {
  125. red {
  126. enabled = {{ .Env.ENABLE_CODEC_OPUS_RED | toBool }}
  127. }
  128. }
  129. {{ end }}
  130. }
  131. rtp-extensions {
  132. video-layers-allocation {
  133. enabled = {{ .Env.ENABLE_VLA | default "0" | toBool }}
  134. }
  135. }
  136. }
  137. conference {
  138. {{ if .Env.ENABLE_AUTO_OWNER }}
  139. enable-auto-owner = {{ .Env.ENABLE_AUTO_OWNER | toBool }}
  140. {{ end }}
  141. {{ if .Env.ENABLE_MODERATOR_CHECKS }}
  142. enable-moderator-checks = {{ .Env.ENABLE_MODERATOR_CHECKS | toBool }}
  143. {{ end }}
  144. {{ if .Env.JICOFO_CONF_INITIAL_PARTICIPANT_WAIT_TIMEOUT }}
  145. initial-timeout = "{{ .Env.JICOFO_CONF_INITIAL_PARTICIPANT_WAIT_TIMEOUT }}"
  146. {{ end }}
  147. max-ssrcs-per-user = "{{ $MAX_SSRCS_PER_USER }}"
  148. max-ssrc-groups-per-user = "{{ $MAX_SSRC_GROUPS_PER_USER }}"
  149. {{ if .Env.JICOFO_CONF_SINGLE_PARTICIPANT_TIMEOUT }}
  150. single-participant-timeout = "{{ .Env.JICOFO_CONF_SINGLE_PARTICIPANT_TIMEOUT }}"
  151. {{ end }}
  152. {{ if .Env.JICOFO_CONF_SOURCE_SIGNALING_DELAYS }}
  153. source-signaling-delays = {{ .Env.JICOFO_CONF_SOURCE_SIGNALING_DELAYS }}
  154. {{ end }}
  155. {{ if .Env.JICOFO_CONF_MAX_AUDIO_SENDERS }}
  156. max-audio-senders = {{ .Env.JICOFO_CONF_MAX_AUDIO_SENDERS }}
  157. {{ end }}
  158. {{ if .Env.JICOFO_CONF_MAX_VIDEO_SENDERS }}
  159. max-video-senders = {{ .Env.JICOFO_CONF_MAX_VIDEO_SENDERS }}
  160. {{ end }}
  161. {{ if .Env.JICOFO_CONF_STRIP_SIMULCAST }}
  162. strip-simulcast = {{ .Env.JICOFO_CONF_STRIP_SIMULCAST | toBool }}
  163. {{ end }}
  164. {{ if .Env.JICOFO_CONF_SSRC_REWRITING }}
  165. use-ssrc-rewriting = {{ .Env.JICOFO_CONF_SSRC_REWRITING | toBool }}
  166. {{ end }}
  167. {{ if .Env.JICOFO_MULTI_STREAM_BACKWARD_COMPAT }}
  168. enable-multi-stream-backward-compat = {{ .Env.JICOFO_MULTI_STREAM_BACKWARD_COMPAT | toBool }}
  169. {{ end }}
  170. {{ if $ENABLE_SHARED_DOCUMENT_RANDOM_NAME }}
  171. shared-document {
  172. use-random-name = {{ $ENABLE_SHARED_DOCUMENT_RANDOM_NAME }}
  173. }
  174. {{ end }}
  175. }
  176. {{ if .Env.JICOFO_ENABLE_HEALTH_CHECKS }}
  177. // Configuration for the internal health checks performed by jicofo.
  178. health {
  179. // Whether to perform health checks.
  180. enabled = {{ .Env.JICOFO_ENABLE_HEALTH_CHECKS | toBool }}
  181. }
  182. {{ end }}
  183. {{ if $ENABLE_RECORDING }}
  184. jibri {
  185. brewery-jid = "{{ $JIBRI_BREWERY_MUC }}@{{ $XMPP_INTERNAL_MUC_DOMAIN }}"
  186. {{ if .Env.JIBRI_REQUEST_RETRIES }}
  187. num-retries = "{{ .Env.JIBRI_REQUEST_RETRIES }}"
  188. {{ end }}
  189. pending-timeout = "{{ $JIBRI_PENDING_TIMEOUT }}"
  190. }
  191. {{ end }}
  192. {{ if .Env.JIBRI_SIP_BREWERY_MUC }}
  193. jibri-sip {
  194. brewery-jid = "{{ .Env.JIBRI_SIP_BREWERY_MUC }}"
  195. }
  196. {{ end }}
  197. {{ if or .Env.JIGASI_SIP_URI $ENABLE_TRANSCRIPTIONS }}
  198. jigasi {
  199. brewery-jid = "{{ $JIGASI_BREWERY_MUC }}@{{ $XMPP_INTERNAL_MUC_DOMAIN }}"
  200. }
  201. {{ end }}
  202. {{ if .Env.JICOFO_OCTO_REGION }}
  203. local-region = "{{ .Env.JICOFO_OCTO_REGION }}"
  204. {{ end }}
  205. octo {
  206. // Whether or not to use Octo. Note that when enabled, its use will be determined by
  207. // $jicofo.bridge.selection-strategy. There's a corresponding flag in the JVB and these
  208. // two MUST be in sync (otherwise bridges will crash because they won't know how to
  209. // deal with octo channels).
  210. enabled = {{ $ENABLE_OCTO }}
  211. sctp-datachannels = {{ $ENABLE_OCTO_SCTP }}
  212. }
  213. {{ if $ENABLE_REST }}
  214. rest {
  215. host = "0.0.0.0"
  216. }
  217. {{ end }}
  218. sctp {
  219. enabled = {{ $ENABLE_SCTP }}
  220. }
  221. {{ if $ENABLE_VISITORS }}
  222. visitors {
  223. enabled = true
  224. {{ if .Env.VISITORS_MAX_PARTICIPANTS }}
  225. max-participants = {{ .Env.VISITORS_MAX_PARTICIPANTS }}
  226. {{ end }}
  227. {{ if $VISITORS_MAX_VISITORS_PER_NODE }}
  228. max-visitors-per-node = {{ $VISITORS_MAX_VISITORS_PER_NODE }}
  229. {{ end }}
  230. require-muc-config-flag = {{ $VISITORS_REQUIRE_MUC_CONFIG }}
  231. }
  232. {{ end }}
  233. xmpp {
  234. {{ if $ENABLE_VISITORS }}
  235. {{ if $.Env.VISITORS_XMPP_SERVER }}
  236. visitors {
  237. {{ range $index, $element := $VISITORS_XMPP_SERVERS -}}
  238. {{ $SERVER := splitn ":" 2 $element }}
  239. v{{ $index }} {
  240. enabled = true
  241. conference-service = {{ $VISITORS_MUC_PREFIX }}.v{{ $index }}.{{ $VISITORS_XMPP_DOMAIN }}
  242. hostname = {{ $SERVER._0 }}
  243. {{ $DEFAULT_PORT := add $VISITORS_XMPP_PORT $index }}
  244. port = {{ $SERVER._1 | default $DEFAULT_PORT }}
  245. domain = "{{ $VISITORS_XMPP_AUTH_DOMAIN }}"
  246. xmpp-domain = v{{ $index }}.{{ $VISITORS_XMPP_DOMAIN }}
  247. password = "{{ $ENV.JICOFO_AUTH_PASSWORD }}"
  248. disable-certificate-verification = true
  249. }
  250. {{ end }}
  251. }
  252. {{ end }}
  253. {{ end }}
  254. client {
  255. enabled = true
  256. hostname = "{{ $XMPP_SERVER }}"
  257. port = "{{ $XMPP_PORT }}"
  258. domain = "{{ $XMPP_AUTH_DOMAIN }}"
  259. xmpp-domain = "{{ $XMPP_DOMAIN }}"
  260. username = "focus"
  261. password = "{{ .Env.JICOFO_AUTH_PASSWORD }}"
  262. conference-muc-jid = "{{ $XMPP_MUC_DOMAIN }}"
  263. client-proxy = "focus.{{ $XMPP_DOMAIN }}"
  264. disable-certificate-verification = true
  265. }
  266. {{ if $ENABLE_JVB_XMPP_SERVER }}
  267. service {
  268. enabled = true
  269. hostname = "{{ $JVB_XMPP_SERVER }}"
  270. port = "{{ $JVB_XMPP_PORT }}"
  271. domain = "{{ $JVB_XMPP_AUTH_DOMAIN }}"
  272. username = "focus"
  273. password = "{{ .Env.JICOFO_AUTH_PASSWORD }}"
  274. disable-certificate-verification = true
  275. }
  276. {{ end }}
  277. trusted-domains = [ {{ range $index, $element := $TRUSTED_DOMAINS }}{{ if gt $index 0 }},{{ end }}"{{ $element }}"{{ end}} ]
  278. }
  279. }
  280. include "custom-jicofo.conf"