spreed-webrtc icon indicating copy to clipboard operation
spreed-webrtc copied to clipboard

[Docker] Skip key generation on startup

Open nathanielhourt opened this issue 9 years ago • 9 comments

Right now, the docker container attempts to do some key generation(s) on startup, to create some self-signed certs. This is improper behavior in a production environment: I'm running spreed behind a TLS-terminating proxy, so it should not be generating keys/certs of its own.

How can I suppress this behavior?

nathanielhourt avatar Sep 14 '16 03:09 nathanielhourt

To clarify, this is a problem because it hangs when generating the keys, as /dev/random runs out of entropy and there's not enough going on to make more quickly, so I'm left with a dead server.

nathanielhourt avatar Sep 14 '16 03:09 nathanielhourt

All right, i see your point. We will add an environment variable to turn of the implicit TLS listener (and with it the need for certificate creation).

longsleep avatar Sep 14 '16 13:09 longsleep

Why is it even using /dev/random ? http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/

leonklingele avatar Sep 14 '16 13:09 leonklingele

Good point, i guess i copied this over from Spreedbox. That should be changed to /dev/urandom for these Docker deployments.

longsleep avatar Sep 14 '16 14:09 longsleep

Interesting. I did not know that about urandom, leon. I was still under the impression random was considered a better source of entropy. Thanks for the info. :)

nathanielhourt avatar Sep 14 '16 21:09 nathanielhourt

Actually, is there any workaround now for this issue? Means even when I'm specifying certs and keys in server.conf it still hangs on "Creating new server secrets ..."

igorolhovskiy avatar Dec 12 '16 16:12 igorolhovskiy

Maybe you could implement haveged for better entropy within the container, that might speedup the creation of the certs. It is available for most distros. http://www.issihosts.com/haveged/

boschkundendienst avatar Dec 16 '16 10:12 boschkundendienst

I tried havaged, but it didn't seem to help. I think it was because there was no initial entropy from a previous boot in a new image, but perhaps I was just doing it wrong. :)

I'm pretty sure this is fixed now anyways, though... it hasn't bothered me in quite a while.

nathanielhourt avatar Dec 16 '16 22:12 nathanielhourt

open a second shell on the same machine and run: rngd -f -r /dev/urandom as root.

elesos avatar Jun 22 '17 03:06 elesos