Skip to content

Commit b72d20d

Browse files
add coturn.auth.staticAuthSecret and coturn.auth.secretKeys.staticAuthSecret (#195)
* allow static-auth-secret as per #177 * bump chart version * clean up the readme * undo secret thing here * helm-docs: automated action --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 7bdefe0 commit b72d20d

5 files changed

Lines changed: 26 additions & 2 deletions

File tree

charts/coturn/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ type: application
44
description: A Helm chart to deploy coturn
55
home: "https://github.com/small-hack/coturn-chart"
66

7-
version: 9.3.0
7+
version: 9.4.0
88

99
# renovate: image=coturn/coturn
1010
appVersion: 4.8.0

charts/coturn/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# coturn
22

3-
![Version: 9.3.0](https://img.shields.io/badge/Version-9.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 4.8.0](https://img.shields.io/badge/AppVersion-4.8.0-informational?style=flat-square)
3+
![Version: 9.4.0](https://img.shields.io/badge/Version-9.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 4.8.0](https://img.shields.io/badge/AppVersion-4.8.0-informational?style=flat-square)
44

55
A Helm chart to deploy coturn
66

@@ -38,7 +38,9 @@ A Helm chart to deploy coturn
3838
| coturn.auth.existingSecret | string | `""` | existing secret with keys username/password for coturn |
3939
| coturn.auth.password | string | `""` | password for the main user of the turn server |
4040
| coturn.auth.secretKeys.password | string | `"password"` | key in existing secret for turn server user's password |
41+
| coturn.auth.secretKeys.staticAuthSecret | string | `""` | key in existing secret for coturn static-auth-secret |
4142
| coturn.auth.secretKeys.username | string | `"username"` | key in existing secret for turn server user |
43+
| coturn.auth.staticAuthSecret | string | `""` | 'Static' authentication secret value (a string) for TURN REST API only. If not set, then the turn server will try to use the 'dynamic' value in the turn_secret table in the user database (if present). The database-stored value can be changed on-the-fly by a separate program, so this is why that mode is considered 'dynamic'. |
4244
| coturn.auth.username | string | `"coturn"` | username for the main user of the turn server |
4345
| coturn.extraEnvVars | list | `[]` | Extra environment variables to pass to the Coturn container example: - name: STATIC_AUTH_SECRET_VAL_OPT value: supersecretpassword123abcyes |
4446
| coturn.extraTurnserverConfiguration | string | `"verbose\n"` | extra configuration for turnserver.conf |

charts/coturn/templates/auth-secret.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@ data:
1212
{{- else }}
1313
password: {{ .Values.coturn.auth.password | b64enc | quote }}
1414
{{- end }}
15+
{{- with .Values.coturn.auth.staticAuthSecret }}
16+
staticAuthSecret: {{ . }}
17+
{{- end }}
1518
{{- end }}

charts/coturn/templates/deployment.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,13 @@ spec:
129129
secretKeyRef:
130130
name: {{ include "coturn.auth.secretName" . }}
131131
key: {{ .Values.coturn.auth.secretKeys.password }}
132+
{{- if or .Values.coturn.auth.staticAuthSecret .Values.coturn.auth.secretKeys.staticAuthSecret }}
133+
- name: STATIC_AUTH_SECRET
134+
valueFrom:
135+
secretKeyRef:
136+
name: {{ include "coturn.auth.secretName" . }}
137+
key: {{ .Values.coturn.auth.secretKeys.staticAuthSecret | default "staticAuthSecret" }}
138+
{{- end }}
132139
{{- if or .Values.externalDatabase.enabled .Values.postgresql.enabled .Values.mysql.enabled }}
133140
- name: DATABASE_HOSTNAME
134141
{{- if and .Values.externalDatabase.enabled .Values.externalDatabase.secretKeys.hostname }}
@@ -189,6 +196,10 @@ spec:
189196
export CONNECTION_STRING="host=$DATABASE_HOSTNAME dbname=$DATABASE user=$DATABASE_USER password=$DATABASE_PASS port=3306 connect_timeout=10 read_timeout=10" && \
190197
yq eval -i '.mysql-userdb = env(CONNECTION_STRING)' /data/turnserver.yaml && \
191198
{{- end }}
199+
{{- if or .Values.coturn.auth.staticAuthSecret .Values.coturn.auth.secretKeys.staticAuthSecret }}
200+
yq eval -i '.static-auth-secret = env(STATIC_AUTH_SECRET)' /data/turnserver.yaml && \
201+
sed -i '1i use-auth-secret' /data/turnserver.yaml && \
202+
{{- end }}
192203
sed -i 's/: /=/' /data/turnserver.yaml && \
193204
cat /extra/turnserver.conf >> /data/turnserver.yaml && \
194205
echo '' >> /data/turnserver.yaml && \

charts/coturn/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,21 @@ coturn:
159159
username: "coturn"
160160
# -- password for the main user of the turn server
161161
password: ""
162+
# -- 'Static' authentication secret value (a string) for TURN REST API only.
163+
# If not set, then the turn server
164+
# will try to use the 'dynamic' value in the turn_secret table
165+
# in the user database (if present). The database-stored value can be changed on-the-fly
166+
# by a separate program, so this is why that mode is considered 'dynamic'.
167+
staticAuthSecret: ""
162168
# -- existing secret with keys username/password for coturn
163169
existingSecret: ""
164170
secretKeys:
165171
# -- key in existing secret for turn server user
166172
username: username
167173
# -- key in existing secret for turn server user's password
168174
password: password
175+
# -- key in existing secret for coturn static-auth-secret
176+
staticAuthSecret: ""
169177

170178
# -- coturn's listening IP address
171179
listeningIP: "0.0.0.0"

0 commit comments

Comments
 (0)