jicofo.conf 11 KB

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