jicofo.conf 11 KB

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