jicofo.conf 11 KB

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