def load(config, opts) do
with_defaults = Config.Reader.merge(config, Pleroma.Config.Holder.release_defaults())
- config_path = opts[:config_path]
+ config_path =
+ cond do
+ opts[:config_path] -> opts[:config_path]
+ System.get_env("PLEROMA_CONFIG_PATH") -> System.get_env("PLEROMA_CONFIG_PATH")
+ System.get_env("AKKOMA_CONFIG_PATH") -> System.get_env("AKKOMA_CONFIG_PATH")
+ File.exists?("/etc/akkoma/config.exs") -> "/etc/akkoma/config.exs"
+ true -> "/etc/pleroma/config.exs"
+ end
with_runtime_config =
- if config_path && File.exists?(config_path) do
+ if File.exists?(config_path) do
runtime_config = Config.Reader.read!(config_path)
with_defaults
with_defaults
end
- exported_config_path = opts[:exported_config_path]
+ exported_config_path =
+ opts[:exported_config_path] ||
+ config_path
+ |> Path.dirname()
+ |> Path.join("#{Pleroma.Config.get(:env)}.exported_from_db.secret.exs")
with_exported =
- if exported_config_path && File.exists?(exported_config_path) do
+ if File.exists?(exported_config_path) do
exported_config = Config.Reader.read!(exported_config_path)
Config.Reader.merge(with_runtime_config, exported_config)
else