mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
explicitly set the app dir
This commit is contained in:
parent
567459bf48
commit
481e29fd50
2 changed files with 7 additions and 2 deletions
|
@ -28,7 +28,8 @@ config :philomena,
|
||||||
channel_banner_file_root: "priv/static/system/images",
|
channel_banner_file_root: "priv/static/system/images",
|
||||||
tag_file_root: "priv/static/system/images",
|
tag_file_root: "priv/static/system/images",
|
||||||
cdn_host: "",
|
cdn_host: "",
|
||||||
proxy_host: nil
|
proxy_host: nil,
|
||||||
|
app_dir: File.cwd!()
|
||||||
|
|
||||||
config :philomena, :pow,
|
config :philomena, :pow,
|
||||||
user: Philomena.Users.User,
|
user: Philomena.Users.User,
|
||||||
|
|
|
@ -46,10 +46,14 @@ defmodule Philomena.Servers.Config do
|
||||||
defp maybe_update_state(state, _key, _true), do: state
|
defp maybe_update_state(state, _key, _true), do: state
|
||||||
|
|
||||||
defp load_config(name) do
|
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)
|
{:ok, json} <- Jason.decode(text)
|
||||||
do
|
do
|
||||||
json
|
json
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
defp app_dir do
|
||||||
|
Application.get_env(:philomena, :app_dir)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue