diff --git a/config/config.exs b/config/config.exs index 869f0cff..ca52eefd 100644 --- a/config/config.exs +++ b/config/config.exs @@ -28,7 +28,8 @@ config :philomena, channel_banner_file_root: "priv/static/system/images", tag_file_root: "priv/static/system/images", cdn_host: "", - proxy_host: nil + proxy_host: nil, + app_dir: File.cwd!() config :philomena, :pow, user: Philomena.Users.User, diff --git a/lib/philomena/servers/config.ex b/lib/philomena/servers/config.ex index c4dc1108..c95a8b9a 100644 --- a/lib/philomena/servers/config.ex +++ b/lib/philomena/servers/config.ex @@ -46,10 +46,14 @@ defmodule Philomena.Servers.Config do defp maybe_update_state(state, _key, _true), do: state defp load_config(name) do - with {:ok, text} <- File.read("config/#{name}.json"), + with {:ok, text} <- File.read("#{app_dir()}/config/#{name}.json"), {:ok, json} <- Jason.decode(text) do json end end + + defp app_dir do + Application.get_env(:philomena, :app_dir) + end end