jicofo.conf 13 KB

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