Skip to content

Commit c479950

Browse files
authored
Merge pull request #31 from wireapp/ratelimit-allowlist-helm
add helm config for the allowlist of binding requests rate-limiting
2 parents 65598c9 + 8299a1b commit c479950

File tree

5 files changed

+42
-8
lines changed

5 files changed

+42
-8
lines changed

charts/coturn/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ type: application
66
# This is the chart version. This version number should be incremented each time you make changes
77
# to the chart and its templates, including the app version.
88
# Versions are expected to follow Semantic Versioning (https://semver.org/)
9-
version: 0.0.42
9+
version: 0.0.43
1010

1111
# This is the version number of the application being deployed. This version number should be
1212
# incremented each time you make changes to the application. Versions are not expected to
1313
# follow Semantic Versioning. They should reflect the version the application is using.
14-
appVersion: 4.6.2-federation-wireapp.16
14+
appVersion: 4.6.2-federation-wireapp.31
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{- if .Values.ratelimit.allowlist }}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: coturn-allowlist
6+
labels:
7+
app: coturn
8+
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
9+
release: {{ .Release.Name }}
10+
heritage: {{ .Release.Service }}
11+
data:
12+
allowlist.txt: |
13+
{{- range .Values.ratelimit.allowlist }}
14+
{{ . }}
15+
{{- end }}
16+
{{- end }}

charts/coturn/templates/configmap-coturn-conf-template.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ data:
9090
401-req-limit={{ .Values.ratelimit.requestLimit }}
9191
401-window={{ .Values.ratelimit.window }}
9292
{{- end }}
93+
{{- if .Values.ratelimit.allowlist }}
94+
## rate-limiting allowlist location
95+
401-allowlist=/etc/coturn/allowlist.txt
96+
{{- end }}
9397
9498
{{- if .Values.federate.enabled }}
9599
### federation setup

charts/coturn/templates/statefulset.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ spec:
6363
secret:
6464
secretName: coturn-dtls-certificate
6565
{{- end }}
66+
{{- if .Values.ratelimit.allowlist }}
67+
- name: allowlist-volume
68+
configMap:
69+
name: coturn-allowlist
70+
{{- end }}
6671
initContainers:
6772
- name: get-external-ip
6873
image: bitnami/kubectl:1.29.11
@@ -125,11 +130,16 @@ spec:
125130
mountPath: /secrets-tls/
126131
readOnly: true
127132
{{- end }}
128-
{{- if .Values.federate.dtls.enabled }}
133+
{{- if .Values.federate.dtls.enabled }}
129134
- name: coturn-dtls-certificate
130135
mountPath: /coturn-dtls-certificate/
131136
readOnly: true
132-
{{- end }}
137+
{{- end }}
138+
{{- if .Values.ratelimit.allowlist }}
139+
- name: allowlist-volume
140+
mountPath: /etc/coturn/allowlist.txt
141+
subPath: allowlist.txt
142+
{{- end }}
133143
command:
134144
- /usr/bin/dumb-init
135145
- --

charts/coturn/values.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,14 @@ federate:
9393

9494
ratelimit:
9595
override: false
96-
# # Set the maximum number of 401 Unauthorized responses allowed per rate-limiting window. Defaults is 1000.
97-
# requestLimit: 1000
98-
# # Set the time window duration in seconds for rate limiting 401 Unauthorized responses. Defaults is 120.
99-
# window: 120
96+
# # Set the maximum number of 401 Unauthorized responses allowed per rate-limiting window. Defaults is 1000.
97+
# requestLimit: 1000
98+
# # Set the time window duration in seconds for rate limiting 401 Unauthorized responses. Defaults is 120.
99+
# window: 120
100+
# # Define the IPs allowed to bypass the 401 rate-limiting
101+
# allowlist:
102+
# - "192.168.1.1"
103+
# - "192.168.1.2"
100104

101105
metrics:
102106
serviceMonitor:

0 commit comments

Comments
 (0)