feat(prosody): new flags to disable incoming client and server conection limits (#1928)

pull/1929/head
Aaron van Meerten 1 month ago committed by GitHub
parent 02aa4f1d53
commit 7b7f101218
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      docker-compose.yml
  2. 12
      prosody/rootfs/defaults/prosody.cfg.lua

@ -269,6 +269,8 @@ services:
- PROSODY_C2S_REQUIRE_ENCRYPTION - PROSODY_C2S_REQUIRE_ENCRYPTION
- PROSODY_RESERVATION_ENABLED - PROSODY_RESERVATION_ENABLED
- PROSODY_RESERVATION_REST_BASE_URL - PROSODY_RESERVATION_REST_BASE_URL
- PROSODY_DISABLE_C2S_LIMIT
- PROSODY_DISABLE_S2S_LIMIT
- PROSODY_ENABLE_RATE_LIMITS - PROSODY_ENABLE_RATE_LIMITS
- PROSODY_ENABLE_RECORDING_METADATA - PROSODY_ENABLE_RECORDING_METADATA
- PROSODY_ENABLE_STANZA_COUNTS - PROSODY_ENABLE_STANZA_COUNTS

@ -1,4 +1,6 @@
{{ $C2S_REQUIRE_ENCRYPTION := .Env.PROSODY_C2S_REQUIRE_ENCRYPTION | default "1" | toBool -}} {{ $C2S_REQUIRE_ENCRYPTION := .Env.PROSODY_C2S_REQUIRE_ENCRYPTION | default "1" | toBool -}}
{{ $DISABLE_C2S_LIMIT := .Env.PROSODY_DISABLE_C2S_LIMIT | default "0" | toBool -}}
{{ $DISABLE_S2S_LIMIT := .Env.PROSODY_DISABLE_S2S_LIMIT | default "0" | toBool -}}
{{ $ENABLE_AUTH := .Env.ENABLE_AUTH | default "0" | toBool -}} {{ $ENABLE_AUTH := .Env.ENABLE_AUTH | default "0" | toBool -}}
{{ $ENABLE_GUEST_DOMAIN := and $ENABLE_AUTH (.Env.ENABLE_GUESTS | default "0" | toBool) -}} {{ $ENABLE_GUEST_DOMAIN := and $ENABLE_AUTH (.Env.ENABLE_GUESTS | default "0" | toBool) -}}
{{ $ENABLE_IPV6 := .Env.ENABLE_IPV6 | default "true" | toBool -}} {{ $ENABLE_IPV6 := .Env.ENABLE_IPV6 | default "true" | toBool -}}
@ -165,15 +167,17 @@ modules_disabled = {
-- For more information see http://prosody.im/doc/creating_accounts -- For more information see http://prosody.im/doc/creating_accounts
allow_registration = false; allow_registration = false;
{{ if ne .Env.PROSODY_MODE "brewery" -}} {{ if and (ne .Env.PROSODY_MODE "brewery") (or (not $DISABLE_C2S_LIMIT) (not $DISABLE_S2S_LIMIT)) -}}
-- Enable rate limits for incoming client and server connections -- Enable rate limits for incoming connections
limits = { limits = {
{{ if ne $PROSODY_C2S_LIMIT "" }} {{ if not $DISABLE_C2S_LIMIT }}
-- Limit incoming client connections
c2s = { c2s = {
rate = "{{ $PROSODY_C2S_LIMIT }}"; rate = "{{ $PROSODY_C2S_LIMIT }}";
}; };
{{ end }} {{ end }}
{{ if ne $PROSODY_S2S_LIMIT "" }} {{ if not $DISABLE_S2S_LIMIT }}
-- Limit incoming server connections
s2sin = { s2sin = {
rate = "{{ $PROSODY_S2S_LIMIT }}"; rate = "{{ $PROSODY_S2S_LIMIT }}";
}; };

Loading…
Cancel
Save