-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(prosody) - Added TURN_USERNAME and TURN_PASSWORD #1989
feat(prosody) - Added TURN_USERNAME and TURN_PASSWORD #1989
Conversation
transport = "tcp", | ||
ttl = {{ $TURN_TTL }}, | ||
|
||
{{ if $.Env.TURN_CREDENTIALS -}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this just be .Env.TURN_CREDENTIALS
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because .Env
tries to access the Env field from the current scope rather than the root context.
In Go templates, the $
symbol refers to the root context. When accessing top-level variables like Env
, we need to use $.Env
instead of .Env
to ensure we're accessing from the root scope rather than the current context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ops, I forgot about that! Thanks for the reminder!
algorithm = "turn", | ||
{{- end }} | ||
|
||
{{ if $.Env.TURN_USERNAME -}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
username = "{{$.Env.TURN_USERNAME}}", | ||
{{- end }} | ||
|
||
{{ if $.Env.TURN_PASSWORD -}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
* 3ba77e1 feat(prosody) - Added TURN_USERNAME and TURN_PASSWORD (#1989) * 82e98d2 web: Added P2P_STUN_SERVERS environment variable (#1990) * 02499f8 feat(grafana): prosody monitoring dashboard created (#1879) * 3af0725 web: add option param for Automatic Gain Control * 9bc57e2 misc: working on unstable
release * 3ba77e1 feat(prosody) - Added TURN_USERNAME and TURN_PASSWORD (jitsi#1989) * 82e98d2 web: Added P2P_STUN_SERVERS environment variable (jitsi#1990) * 02499f8 feat(grafana): prosody monitoring dashboard created (jitsi#1879) * 3af0725 web: add option param for Automatic Gain Control * 9bc57e2 misc: working on unstable
release * 3ba77e1 feat(prosody) - Added TURN_USERNAME and TURN_PASSWORD (jitsi#1989) * 82e98d2 web: Added P2P_STUN_SERVERS environment variable (jitsi#1990) * 02499f8 feat(grafana): prosody monitoring dashboard created (jitsi#1879) * 3af0725 web: add option param for Automatic Gain Control * 9bc57e2 misc: working on unstable
Fix: Add support for TURN servers that don't implement draft-uberti-behave-turn-rest-00
Problem
Cloudflare TURN servers do not support the draft-uberti-behave-turn-rest-00 specification, which is the default method used by mod_external_services to generate TURN credentials (username and password).
Solution
Added two new environment variables:
TURN_USERNAME
: Define a static TURN usernameTURN_PASSWORD
: Define a static TURN passwordWhen
TURN_CREDENTIALS
is not set, the module will not attempt to generate credentials using the draft-uberti-behave-turn-rest-00 method. Instead, it will use the static credentials if provided throughTURN_USERNAME
andTURN_PASSWORD
.This change allows Prosody to work with TURN servers that don't implement the expired draft spec, such as Cloudflare TURN.
Reference