visitors.cfg.lua 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. }
  49. authentication = 'internal_hashed'
  50. storage = 'internal'
  51. consider_websocket_secure = true;
  52. consider_bosh_secure = true;
  53. bosh_max_inactivity = 60;
  54. -- this is added to make certs_s2soutinjection work
  55. s2sout_override = {
  56. ["{{ $XMPP_MUC_DOMAIN }}"] = "tcp://{{ $XMPP_SERVER }}:{{ $XMPP_SERVER_S2S_PORT }}"; -- needed for visitors to send messages to main room
  57. ["{{ $XMPP_DOMAIN }}"] = "tcp://{{ $XMPP_SERVER }}:{{ $XMPP_SERVER_S2S_PORT }}";
  58. ["visitors.{{ $XMPP_DOMAIN }}"] = "tcp://{{ $XMPP_SERVER }}:{{ $XMPP_SERVER_S2S_PORT }}";
  59. {{ if $ENABLE_GUEST_DOMAIN -}}
  60. ["{{ $XMPP_GUEST_DOMAIN }}"] = "tcp://{{ $XMPP_SERVER }}:{{ $XMPP_SERVER_S2S_PORT }}";
  61. {{ end -}}
  62. {{ if or $ENABLE_RECORDING $ENABLE_TRANSCRIPTIONS -}}
  63. ["{{ $XMPP_HIDDEN_DOMAIN }}"] = "tcp://{{ $XMPP_SERVER }}:{{ $XMPP_SERVER_S2S_PORT }}";
  64. {{ end -}}
  65. {{ if .Env.PROSODY_VISITORS_S2S_VHOSTS -}}
  66. {{- range $index, $vhost := (splitList "," .Env.PROSODY_VISITORS_S2S_VHOSTS | compact) }}
  67. ["{{ $vhost }}"] = "tcp://{{ $XMPP_SERVER }}:{{ $XMPP_SERVER_S2S_PORT }}";
  68. {{ end -}}
  69. {{ end -}}
  70. }
  71. muc_limit_messages_count = 10;
  72. muc_limit_messages_check_token = {{ $LIMIT_MESSAGES_CHECK_TOKEN }};
  73. ----------- Virtual hosts -----------
  74. VirtualHost 'v{{ $VISITOR_INDEX }}.{{ $VISITORS_XMPP_DOMAIN }}'
  75. authentication = 'jitsi-anonymous'
  76. ssl = {
  77. key = "/config/certs/v{{ $VISITOR_INDEX }}.{{ $VISITORS_XMPP_DOMAIN }}.key";
  78. certificate = "/config/certs/v{{ $VISITOR_INDEX }}.{{ $VISITORS_XMPP_DOMAIN }}.crt";
  79. }
  80. modules_enabled = {
  81. 'bosh';
  82. "external_services";
  83. {{ if $ENABLE_XMPP_WEBSOCKET -}}
  84. "websocket";
  85. "smacks"; -- XEP-0198: Stream Management
  86. {{ end -}}
  87. {{ if .Env.XMPP_MODULES }}
  88. "{{ join "\";\n\"" (splitList "," .Env.XMPP_MODULES | compact) }}";
  89. {{ end }}
  90. }
  91. main_muc = '{{ $VISITORS_MUC_PREFIX }}.v{{ $VISITOR_INDEX }}.{{ $VISITORS_XMPP_DOMAIN }}';
  92. shard_name = "{{ $SHARD_NAME }}"
  93. region_name = "{{ $REGION_NAME }}"
  94. release_number = "{{ $RELEASE_NUMBER }}"
  95. {{ if .Env.XMPP_CONFIGURATION -}}
  96. {{ join "\n " (splitList "," .Env.XMPP_CONFIGURATION | compact) }}
  97. {{- end }}
  98. VirtualHost '{{ $XMPP_AUTH_DOMAIN }}'
  99. modules_enabled = {
  100. 'limits_exception';
  101. }
  102. authentication = 'internal_hashed'
  103. Component '{{ $VISITORS_MUC_PREFIX }}.v{{ $VISITOR_INDEX }}.{{ $VISITORS_XMPP_DOMAIN }}' 'muc'
  104. storage = 'memory'
  105. muc_room_cache_size = 10000
  106. restrict_room_creation = true
  107. modules_enabled = {
  108. "muc_hide_all";
  109. "muc_meeting_id";
  110. 'fmuc';
  111. 's2s_bidi';
  112. 's2s_whitelist';
  113. 's2sout_override';
  114. 'muc_max_occupants';
  115. {{ if $ENABLE_SUBDOMAINS -}}
  116. "muc_domain_mapper";
  117. {{ end -}}
  118. {{ if $ENABLE_RATE_LIMITS -}}
  119. "muc_rate_limit";
  120. "rate_limit";
  121. {{ end -}}
  122. {{ if .Env.XMPP_MUC_MODULES -}}
  123. "{{ join "\";\n\"" (splitList "," .Env.XMPP_MUC_MODULES | compact) }}";
  124. {{ end -}}
  125. }
  126. muc_room_default_presence_broadcast = {
  127. visitor = false;
  128. participant = true;
  129. moderator = true;
  130. };
  131. muc_room_locking = false
  132. muc_room_default_public_jids = true
  133. muc_max_occupants = {{ $VISITORS_MAX_VISITORS_PER_NODE}}
  134. muc_access_whitelist = {
  135. "{{ $XMPP_DOMAIN }}";
  136. }
  137. muc_tombstones = false
  138. muc_room_allow_persistent = false
  139. {{ if $ENABLE_RATE_LIMITS -}}
  140. -- Max allowed join/login rate in events per second.
  141. rate_limit_login_rate = {{ $RATE_LIMIT_LOGIN_RATE }};
  142. -- The rate to which sessions from IPs exceeding the join rate will be limited, in bytes per second.
  143. rate_limit_session_rate = {{ $RATE_LIMIT_SESSION_RATE }};
  144. -- The time in seconds, after which the limit for an IP address is lifted.
  145. rate_limit_timeout = {{ $RATE_LIMIT_TIMEOUT }};
  146. -- List of regular expressions for IP addresses that are not limited by this module.
  147. rate_limit_whitelist = {
  148. "127.0.0.1";
  149. {{ range $index, $cidr := (splitList "," $RATE_LIMIT_ALLOW_RANGES) -}}
  150. "{{ $cidr }}";
  151. {{ end -}}
  152. };
  153. rate_limit_whitelist_jids = {
  154. "{{ $JIBRI_RECORDER_USER }}@{{ $XMPP_HIDDEN_DOMAIN }}",
  155. "{{ $JIGASI_TRANSCRIBER_USER }}@{{ $XMPP_HIDDEN_DOMAIN }}"
  156. }
  157. {{ end -}}
  158. -- The size of the cache that saves state for IP addresses
  159. rate_limit_cache_size = {{ $RATE_LIMIT_CACHE_SIZE }};
  160. muc_rate_joins = 30;
  161. {{ if .Env.XMPP_MUC_CONFIGURATION -}}
  162. {{ join "\n" (splitList "," .Env.XMPP_MUC_CONFIGURATION | compact) }}
  163. {{ end -}}