prosody: update the comma logic while listing TURNs
This commit is contained in:
@@ -79,23 +79,20 @@ external_service_secret = "{{.Env.TURN_CREDENTIALS}}";
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{ if or .Env.TURN_HOST .Env.TURNS_HOST -}}
|
{{ if or .Env.TURN_HOST .Env.TURNS_HOST -}}
|
||||||
{{- $comma := "" -}}
|
|
||||||
external_services = {
|
external_services = {
|
||||||
{{ if $TURN_HOST -}}
|
{{ if $TURN_HOST -}}
|
||||||
{{- range $idx1, $host := $TURN_HOSTS -}}
|
{{- range $idx1, $host := $TURN_HOSTS -}}
|
||||||
{{- range $idx2, $transport := $TURN_TRANSPORTS -}}
|
{{- range $idx2, $transport := $TURN_TRANSPORTS -}}
|
||||||
{{- $comma }}
|
{{- if or $idx1 $idx2 -}},{{- end }}
|
||||||
{ type = "turn", host = "{{ $host }}", port = {{ $TURN_PORT }}, transport = "{{ $transport }}", secret = true, ttl = 86400, algorithm = "turn" }
|
{ type = "turn", host = "{{ $host }}", port = {{ $TURN_PORT }}, transport = "{{ $transport }}", secret = true, ttl = 86400, algorithm = "turn" }
|
||||||
{{- $comma = "," -}}
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- if $TURNS_HOST -}}
|
{{- if $TURNS_HOST -}}
|
||||||
{{- range $idx, $host := $TURNS_HOSTS -}}
|
{{- range $idx, $host := $TURNS_HOSTS -}}
|
||||||
{{- $comma }}
|
{{- if or $TURN_HOST $idx -}},{{- end }}
|
||||||
{ type = "turns", host = "{{ $host }}", port = {{ $TURNS_PORT }}, transport = "tcp", secret = true, ttl = 86400, algorithm = "turn" }
|
{ type = "turns", host = "{{ $host }}", port = {{ $TURNS_PORT }}, transport = "tcp", secret = true, ttl = 86400, algorithm = "turn" }
|
||||||
{{- $comma = "," -}}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user