use Config in generated config when available

Mix.Config is deprecated and does not work on OTP releases. However
we can't fully switch to Config because it is not present in
Elixir < 1.9. I tried to evaluate if Config is available at runtime,
but for some weird reason OTP releases crash if I do that.
This commit is contained in:
rinpatch 2019-06-21 21:56:49 +03:00
parent 6906db512d
commit 960d6b54e8

View file

@ -3,7 +3,11 @@
# NOTE: This file should not be committed to a repo or otherwise made public # NOTE: This file should not be committed to a repo or otherwise made public
# without removing sensitive information. # without removing sensitive information.
use Mix.Config <%= if Code.ensure_loaded?(Config) do
"import Config"
else
"use Mix.Config"
end %>
config :pleroma, Pleroma.Web.Endpoint, config :pleroma, Pleroma.Web.Endpoint,
url: [host: "<%= domain %>", scheme: "https", port: <%= port %>], url: [host: "<%= domain %>", scheme: "https", port: <%= port %>],