Commit 800d581b authored by kaniini's avatar kaniini

Merge branch 'fix/epmd-loopback' into 'master'

Use a loopback interface ip address as default hostname

See merge request pleroma/myhtmlex!9
parents 337ffdd9 89d8f000
Pipeline #19659 passed with stage
in 1 minute and 41 seconds
...@@ -47,7 +47,19 @@ defmodule FastHtml.Application do ...@@ -47,7 +47,19 @@ defmodule FastHtml.Application do
end end
end end
defp hostname() do
{:ok, ifaddrs} = :inet.getifaddrs()
|> Enum.filter(fn {_name, value} -> :loopback in Keyword.get(value, :flags) end)
|> elem(1)
|> Keyword.get(:addr)
|> :inet.ntoa()
|> to_string()
defp start_node() do defp start_node() do
Node.start(:"master_#{random_sname()}@") Node.start(:"master_#{random_sname()}@#{hostname()}")
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment