25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

Mix: Enable stun by default when vars.config not found

configure.ac by default enables stun and zlib, in fact ejabberd.yml
has ejabberd_stun enabled by default, so for coherence mix.exs should
enable stun too when vars.config is not found.
This commit is contained in:
Badlop 2023-12-26 13:21:00 +01:00
parent fa3c25ab66
commit 8b38aebbc7

12
mix.exs
View File

@ -42,11 +42,12 @@ defmodule Ejabberd.MixProject do
[mod: {:ejabberd_app, []},
applications: [:idna, :inets, :kernel, :sasl, :ssl, :stdlib, :mix,
:base64url, :fast_tls, :fast_xml, :fast_yaml, :jiffy, :jose,
:p1_utils, :stringprep, :syntax_tools, :yconf],
:p1_utils, :stringprep, :syntax_tools, :yconf]
++ cond_apps(),
included_applications: [:mnesia, :os_mon,
:cache_tab, :eimp, :mqtree, :p1_acme,
:p1_oauth2, :pkix, :xmpp]
++ cond_apps()]
++ cond_included_apps()]
end
defp if_version_above(ver, okResult) do
@ -145,6 +146,11 @@ defmodule Ejabberd.MixProject do
end
defp cond_apps do
for {:true, app} <- [{config(:stun), :stun}], do:
app
end
defp cond_included_apps do
for {:true, app} <- [{config(:pam), :epam},
{config(:lua), :luerl},
{config(:redis), :eredis},
@ -179,7 +185,7 @@ defmodule Ejabberd.MixProject do
end
case :file.consult(filepath) do
{:ok,config} -> config
_ -> [zlib: true]
_ -> [stun: true, zlib: true]
end
end