Configure ref_inspector and ua_inspector at runtime

This commit is contained in:
Uku Taht 2020-06-09 18:24:08 +03:00
parent 8d36d27ca3
commit 25cd4301c3
2 changed files with 16 additions and 0 deletions

View File

@ -165,4 +165,10 @@ config :plausible, Oban,
queues: if(cron_enabled, do: queues, else: []),
crontab: if(cron_enabled, do: crontab, else: false)
config :ref_inspector,
init: {Plausible.Release, :configure_ref_inspector}
config :ua_inspector,
init: {Plausible.Release, :configure_ua_inspector}
config :logger, level: :warn

View File

@ -68,6 +68,16 @@ defmodule Plausible.Release do
end
end
def configure_ref_inspector() do
priv_dir = Application.app_dir(:plausible, "priv/ref_inspector")
Application.put_env(:ref_inspector, :database_path, priv_dir)
end
def configure_ua_inspector() do
priv_dir = Application.app_dir(:plausible, "priv/ua_inspector")
Application.put_env(:ua_inspector, :database_path, priv_dir)
end
##############################
defp validate_admin({nil, nil, nil}) do