visitors.cfg.lua 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. {{ $ENABLE_AUTH := .Env.ENABLE_AUTH | default "0" | toBool -}}
  2. {{ $ENABLE_GUEST_DOMAIN := and $ENABLE_AUTH (.Env.ENABLE_GUESTS | default "0" | toBool) -}}
  3. {{ $ENABLE_RATE_LIMITS := .Env.PROSODY_ENABLE_RATE_LIMITS | default "0" | toBool -}}
  4. {{ $ENABLE_RECORDING := .Env.ENABLE_RECORDING | default "0" | toBool -}}
  5. {{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "true" | toBool -}}
  6. {{ $ENABLE_TRANSCRIPTIONS := .Env.ENABLE_TRANSCRIPTIONS | default "0" | toBool -}}
  7. {{ $ENABLE_XMPP_WEBSOCKET := .Env.ENABLE_XMPP_WEBSOCKET | default "1" | toBool -}}
  8. {{ $JIBRI_RECORDER_USER := .Env.JIBRI_RECORDER_USER | default "recorder" -}}
  9. {{ $JIGASI_TRANSCRIBER_USER := .Env.JIGASI_TRANSCRIBER_USER | default "transcriber" -}}
  10. {{ $LIMIT_MESSAGES_CHECK_TOKEN := .Env.PROSODY_LIMIT_MESSAGES_CHECK_TOKEN | default "0" | toBool -}}
  11. {{ $RATE_LIMIT_LOGIN_RATE := .Env.PROSODY_RATE_LIMIT_LOGIN_RATE | default "3" -}}
  12. {{ $RATE_LIMIT_SESSION_RATE := .Env.PROSODY_RATE_LIMIT_SESSION_RATE | default "200" -}}
  13. {{ $RATE_LIMIT_TIMEOUT := .Env.PROSODY_RATE_LIMIT_TIMEOUT | default "60" -}}
  14. {{ $RATE_LIMIT_ALLOW_RANGES := .Env.PROSODY_RATE_LIMIT_ALLOW_RANGES | default "10.0.0.0/8" -}}
  15. {{ $RATE_LIMIT_CACHE_SIZE := .Env.PROSODY_RATE_LIMIT_CACHE_SIZE | default "10000" -}}
  16. {{ $REGION_NAME := .Env.PROSODY_REGION_NAME | default "default" -}}
  17. {{ $RELEASE_NUMBER := .Env.RELEASE_NUMBER | default "" -}}
  18. {{ $SHARD_NAME := .Env.SHARD | default "default" -}}
  19. {{ $S2S_PORT := .Env.PROSODY_S2S_PORT | default "5269" -}}
  20. {{ $VISITOR_INDEX := .Env.PROSODY_VISITOR_INDEX | default "0" -}}
  21. {{ $VISITORS_MUC_PREFIX := .Env.PROSODY_VISITORS_MUC_PREFIX | default "muc" -}}
  22. {{ $VISITORS_MAX_VISITORS_PER_NODE := .Env.VISITORS_MAX_VISITORS_PER_NODE | default "250" }}
  23. {{ $VISITORS_XMPP_DOMAIN := .Env.VISITORS_XMPP_DOMAIN | default "meet.jitsi" -}}
  24. {{ $XMPP_AUTH_DOMAIN := .Env.XMPP_AUTH_DOMAIN | default "auth.meet.jitsi" -}}
  25. {{ $XMPP_DOMAIN := .Env.XMPP_DOMAIN | default "meet.jitsi" -}}
  26. {{ $XMPP_GUEST_DOMAIN := .Env.XMPP_GUEST_DOMAIN | default "guest.meet.jitsi" -}}
  27. {{ $XMPP_MUC_DOMAIN := .Env.XMPP_MUC_DOMAIN | default "muc.meet.jitsi" -}}
  28. {{ $XMPP_MUC_DOMAIN_PREFIX := (split "." $XMPP_MUC_DOMAIN)._0 -}}
  29. {{ $XMPP_SERVER := .Env.XMPP_SERVER | default "xmpp.meet.jitsi" -}}
  30. {{ $XMPP_SERVER_S2S_PORT := .Env.XMPP_SERVER_S2S_PORT | default $S2S_PORT -}}
  31. {{ $XMPP_HIDDEN_DOMAIN := .Env.XMPP_HIDDEN_DOMAIN | default "hidden.meet.jitsi" -}}
  32. plugin_paths = { "/prosody-plugins/", "/prosody-plugins-custom", "/prosody-plugins-contrib" }
  33. muc_mapper_domain_base = "v{{ $VISITOR_INDEX }}.{{ $VISITORS_XMPP_DOMAIN }}";
  34. muc_mapper_domain_prefix = "{{ $XMPP_MUC_DOMAIN_PREFIX }}";
  35. http_default_host = "v{{ $VISITOR_INDEX }}.{{ $VISITORS_XMPP_DOMAIN }}"
  36. main_domain = '{{ $XMPP_DOMAIN }}';
  37. -- https://prosody.im/doc/modules/mod_smacks
  38. smacks_max_unacked_stanzas = 5;
  39. smacks_hibernation_time = 60;
  40. -- this is dropped in 0.12
  41. smacks_max_hibernated_sessions = 1;
  42. smacks_max_old_sessions = 1;
  43. unlimited_jids = { "focus@{{ $XMPP_AUTH_DOMAIN }}" }
  44. limits = {
  45. c2s = {
  46. rate = "512kb/s";
  47. };
  48. s2sin = {
  49. rate = "512kb/s";
  50. };
  51. }
  52. authentication = 'internal_hashed'
  53. storage = 'internal'
  54. consider_websocket_secure = true;
  55. consider_bosh_secure = true;
  56. bosh_max_inactivity = 60;
  57. -- this is added to make certs_s2soutinjection work
  58. s2sout_override = {
  59. ["{{ $XMPP_MUC_DOMAIN }}"] = "tcp://{{ $XMPP_SERVER }}:{{ $XMPP_SERVER_S2S_PORT }}"; -- needed for visitors to send messages to main room
  60. ["{{ $XMPP_DOMAIN }}"] = "tcp://{{ $XMPP_SERVER }}:{{ $XMPP_SERVER_S2S_PORT }}";
  61. ["visitors.{{ $XMPP_DOMAIN }}"] = "tcp://{{ $XMPP_SERVER }}:{{ $XMPP_SERVER_S2S_PORT }}";
  62. {{ if $ENABLE_GUEST_DOMAIN -}}
  63. ["{{ $XMPP_GUEST_DOMAIN }}"] = "tcp://{{ $XMPP_SERVER }}:{{ $XMPP_SERVER_S2S_PORT }}";
  64. {{ end -}}
  65. {{ if or $ENABLE_RECORDING $ENABLE_TRANSCRIPTIONS -}}
  66. ["{{ $XMPP_HIDDEN_DOMAIN }}"] = "tcp://{{ $XMPP_SERVER }}:{{ $XMPP_SERVER_S2S_PORT }}";
  67. {{ end -}}
  68. {{ if .Env.PROSODY_VISITORS_S2S_VHOSTS -}}
  69. {{- range $index, $vhost := (splitList "," .Env.PROSODY_VISITORS_S2S_VHOSTS | compact) }}
  70. ["{{ $vhost }}"] = "tcp://{{ $XMPP_SERVER }}:{{ $XMPP_SERVER_S2S_PORT }}";
  71. {{ end -}}
  72. {{ end -}}
  73. }
  74. muc_limit_messages_count = 10;
  75. muc_limit_messages_check_token = {{ $LIMIT_MESSAGES_CHECK_TOKEN }};
  76. ----------- Virtual hosts -----------
  77. VirtualHost 'v{{ $VISITOR_INDEX }}.{{ $VISITORS_XMPP_DOMAIN }}'
  78. authentication = 'jitsi-anonymous'
  79. ssl = {
  80. key = "/config/certs/v{{ $VISITOR_INDEX }}.{{ $VISITORS_XMPP_DOMAIN }}.key";
  81. certificate = "/config/certs/v{{ $VISITOR_INDEX }}.{{ $VISITORS_XMPP_DOMAIN }}.crt";
  82. }
  83. modules_enabled = {
  84. 'bosh';
  85. "external_services";
  86. {{ if $ENABLE_XMPP_WEBSOCKET -}}
  87. "websocket";
  88. "smacks"; -- XEP-0198: Stream Management
  89. {{ end -}}
  90. {{ if .Env.XMPP_MODULES }}
  91. "{{ join "\";\n\"" (splitList "," .Env.XMPP_MODULES | compact) }}";
  92. {{ end }}
  93. }
  94. main_muc = '{{ $VISITORS_MUC_PREFIX }}.v{{ $VISITOR_INDEX }}.{{ $VISITORS_XMPP_DOMAIN }}';
  95. shard_name = "{{ $SHARD_NAME }}"
  96. region_name = "{{ $REGION_NAME }}"
  97. release_number = "{{ $RELEASE_NUMBER }}"
  98. {{ if .Env.XMPP_CONFIGURATION -}}
  99. {{ join "\n " (splitList "," .Env.XMPP_CONFIGURATION | compact) }}
  100. {{- end }}
  101. VirtualHost '{{ $XMPP_AUTH_DOMAIN }}'
  102. modules_enabled = {
  103. 'limits_exception';
  104. 'smacks';
  105. }
  106. authentication = 'internal_hashed'
  107. smacks_hibernation_time = 15;
  108. Component '{{ $VISITORS_MUC_PREFIX }}.v{{ $VISITOR_INDEX }}.{{ $VISITORS_XMPP_DOMAIN }}' 'muc'
  109. storage = 'memory'
  110. muc_room_cache_size = 10000
  111. restrict_room_creation = true
  112. modules_enabled = {
  113. "muc_hide_all";
  114. "muc_meeting_id";
  115. 'fmuc';
  116. 's2s_bidi';
  117. 's2s_whitelist';
  118. 's2sout_override';
  119. 'muc_max_occupants';
  120. {{ if $ENABLE_SUBDOMAINS -}}
  121. "muc_domain_mapper";
  122. {{ end -}}
  123. {{ if $ENABLE_RATE_LIMITS -}}
  124. "muc_rate_limit";
  125. "rate_limit";
  126. {{ end -}}
  127. {{ if .Env.XMPP_MUC_MODULES -}}
  128. "{{ join "\";\n\"" (splitList "," .Env.XMPP_MUC_MODULES | compact) }}";
  129. {{ end -}}
  130. }
  131. muc_room_default_presence_broadcast = {
  132. visitor = false;
  133. participant = true;
  134. moderator = true;
  135. };
  136. muc_room_locking = false
  137. muc_room_default_public_jids = true
  138. muc_max_occupants = {{ $VISITORS_MAX_VISITORS_PER_NODE}}
  139. muc_access_whitelist = {
  140. "{{ $XMPP_DOMAIN }}";
  141. }
  142. muc_tombstones = false
  143. muc_room_allow_persistent = false
  144. {{ if $ENABLE_RATE_LIMITS -}}
  145. -- Max allowed join/login rate in events per second.
  146. rate_limit_login_rate = {{ $RATE_LIMIT_LOGIN_RATE }};
  147. -- The rate to which sessions from IPs exceeding the join rate will be limited, in bytes per second.
  148. rate_limit_session_rate = {{ $RATE_LIMIT_SESSION_RATE }};
  149. -- The time in seconds, after which the limit for an IP address is lifted.
  150. rate_limit_timeout = {{ $RATE_LIMIT_TIMEOUT }};
  151. -- List of regular expressions for IP addresses that are not limited by this module.
  152. rate_limit_whitelist = {
  153. "127.0.0.1";
  154. {{ range $index, $cidr := (splitList "," $RATE_LIMIT_ALLOW_RANGES) -}}
  155. "{{ $cidr }}";
  156. {{ end -}}
  157. };
  158. rate_limit_whitelist_jids = {
  159. "{{ $JIBRI_RECORDER_USER }}@{{ $XMPP_HIDDEN_DOMAIN }}",
  160. "{{ $JIGASI_TRANSCRIBER_USER }}@{{ $XMPP_HIDDEN_DOMAIN }}"
  161. }
  162. {{ end -}}
  163. -- The size of the cache that saves state for IP addresses
  164. rate_limit_cache_size = {{ $RATE_LIMIT_CACHE_SIZE }};
  165. muc_rate_joins = 30;
  166. {{ if .Env.XMPP_MUC_CONFIGURATION -}}
  167. {{ join "\n" (splitList "," .Env.XMPP_MUC_CONFIGURATION | compact) }}
  168. {{ end -}}