Mostly to improve the docker ui, ie it will say "unhealthy" if it takes
too long to start e.g. waiting for certs, or if Prosody crashes without
getting restarted.
Probes the http port on the assumption that this means Prosody is up and
running.
Signed-off-by: Matthew Wild <mwild1@gmail.com>
Reading untold amounts of data and throwing away all except \~86% seems
wasteful.
This method reads exactly 32 bytes from /dev/urandom, while the previous
method would have stuffed pipes full before finding 32 bytes in the
specified range. All of the entropy of those 32 bytes are also kept in
the base64 form, although this is probably insane overkill.
The original implementation unintentionally included whitespace
and other noise in the secret file.
The new secret is stored in a -v2 file, the old one is cleaned up
if present.
This simplifies things in preparation for adding coturn and its large
number of ports.
As Prosody now must listen on the "real" HTTP ports, we had to give
permission to the Lua binary to bind low network ports.