Closed j1elo closed 3 years ago
Would you be open for this change? I believe that the current ip discovery method is a bit flaky, using a random service, and could be improved from the suggestions given here: How can I get my external IP address in a shell script?
Side note: the Travis CI checks failure seem to be due to some MySQL error, not to the changes in this PR?
Oh, @j1elo, hi! Nice to meet you! Long time, no see. How is the Kurento thing going? 😅
Unfortunately, this Docker image is going to be deprecated, because moves to upstream.
I'm not against this change, but it will be better to contribute it to the upstream once the image is finally settled there. It's a matter of few days (maximum a week) now. I'll notify you right here, once it's ready.
Thanks! 👋
@j1elo upstream is ready for this contribution. Thanks for patience!
PR ported to here --> https://github.com/coturn/coturn/pull/753
Using DNS requests is a much more robust and reliable method to discover a machine's external IP address, instead of the previous method of using Curl against an HTTP service.
Using Curl is fine, but the kind of services that are typically used (here it was icanhazip.com, but there are lots more with a similar behavior) are are not as dependable as the official DNS request methods supported by some of the biggest service providers.
This uses "dig", which Alpine provides in the package "bind-tools".
This also offers IPv6 discovery, because the code is directly being adapted to Busybox's Ash from an script that I already had been using for some time: https://github.com/j1elo/shell-snippets/blob/master/discover-public-ip.sh (but if IPv6 is not desired, that part could be removed)