jicofo.conf 12 KB

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