Skip to content
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

prosody.cfg.lua and /conf.d/jitsi-meet.cfg.lua reset every restart - STUN Server config lost! #877

Closed
RedJohn14 opened this issue Dec 14, 2020 · 2 comments

Comments

@RedJohn14
Copy link

RedJohn14 commented Dec 14, 2020

Hello,

Since last upgrade you recreate prosody.cfg.lua and /conf.d/jitsi-meet.cfg.lua at every restart that is not so nice. Because after restart STUN Server config in /conf.d/jitsi-meet.cfg.lua is lost!

How can I make STUN Server config persistent in /conf.d/jitsi-meet.cfg.lua:

[...]
turncredentials_secret = xxxx
turncredentials = {
  { type = "stun", host = "my.domain.com", port = "443" },
  { type = "turns", host = "my.domain.com", port = "443", transport = "udp" },
  { type = "turns", host = "my.domain.com", port = "443", transport = "tcp" }
};
[...]
modules_enabled = {
        "bosh";
        "pubsub";
        "ping";
        "speakerstats";
        "conference_duration";
        "turncredentials";
[...]

And also the prosody.cfg.lua config file:

[...]
modules_enabled = {

        -- Generally required
                "roster"; -- Allow users to have a roster. Recommended ;)
                "saslauth"; -- Authentication for clients and servers. Recommended if you want to log in.
                "tls"; -- Add support for secure TLS on c2s/s2s connections
                "dialback"; -- s2s dialback support
                "disco"; -- Service discovery
                "turncredentials";
[...]

I can't see any variables, but now my hole config for STUN Server will lost after every reboot really?

Is there now way? I must really "mount out" the config directory like in my last post with Jitsi-web container?

Regards!

@saghul
Copy link
Member

saghul commented Dec 14, 2020

Right now there is indeed no way. Adding new env variables for setting TUrN serves with them would be the way forward. Any chance you can make a PR?

@pandel
Copy link
Contributor

pandel commented Dec 19, 2020

@RedJohn14
If it helps, you can do the following after you have started your containers (replace variable values accordingly):

#!/bin/bash

JVB_STUN_SERVER=<yourstunserver>:<port>
TURN_SECRET=<your turn secret>

CONFIG=~/.jitsi-meet-cfg

PROSODY_SRV_CONFIG=${CONFIG}/prosody/config/conf.d/jitsi-meet.cfg.lua

 # add TURN server credentials
_srv=$(echo $JVB_STUN_SERVER | cut -d ':' -f 1)
_port=$(echo $JVB_STUN_SERVER | cut -d ':' -f 2)

# add TURN credentials at the top
sed -i "1s/^/};\n/" ${PROSODY_SRV_CONFIG}
sed -i "1s/^/  { type = \"turns\", host = \"${_srv}\", port = \"${_port}\", transport = \"tcp\" }\n/" ${PROSODY_SRV_CONFIG}
sed -i "1s/^/  { type = \"turn\", host = \"${_srv}\", port = \"${_port}\", transport = \"udp\" },\n/" ${PROSODY_SRV_CONFIG}
sed -i "1s/^/  { type = \"stun\", host = \"${_srv}\", port = \"${_port}\" },\n/" ${PROSODY_SRV_CONFIG}
sed -i "1s/^/turncredentials = {\n/" ${PROSODY_SRV_CONFIG}
sed -i "1s/^/turncredentials_ttl=86400;\n/" ${PROSODY_SRV_CONFIG}
sed -i "1s/^/turncredentials_port=443;\n/" ${PROSODY_SRV_CONFIG}
sed -i "1s/^/turncredentials_secret=\"${TURN_SECRET}\";\n/" ${PROSODY_SRV_CONFIG}

# no need to change prosody.cfg.lua, but insert into VirtualHost
sed -i '/"speakerstats";/i \\t"turncredentials";' ${PROSODY_SRV_CONFIG}


# Restart Prosody instance
docker exec jitsi-meet_prosody_1 /bin/bash -c 'kill $(pidof lua5.2)'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants