aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexander Strizhakov <alex.strizhakov@gmail.com>2021-04-08 15:45:31 +0300
committerAlexander Strizhakov <alex.strizhakov@gmail.com>2021-04-08 15:45:31 +0300
commit681a42c359b4fbae74285363c670dff18aac5918 (patch)
tree7a6028468fd6058ef6340d946833c6abe77ec39a /lib
parent4d046afd2769cfdc16b2ee48e8c1d8f7f8e8ffa7 (diff)
downloadpleroma-681a42c359b4fbae74285363c670dff18aac5918.tar.gz
release runtime provider fix for paths
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/config/release_runtime_provider.ex13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/pleroma/config/release_runtime_provider.ex b/lib/pleroma/config/release_runtime_provider.ex
index 46fa35559..e5e9d3dcd 100644
--- a/lib/pleroma/config/release_runtime_provider.ex
+++ b/lib/pleroma/config/release_runtime_provider.ex
@@ -11,10 +11,11 @@ defmodule Pleroma.Config.ReleaseRuntimeProvider do
def load(config, opts) do
with_defaults = Config.Reader.merge(config, Pleroma.Config.Holder.release_defaults())
- config_path = opts[:config_path]
+ config_path =
+ opts[:config_path] || System.get_env("PLEROMA_CONFIG_PATH") || "/etc/pleroma/config.exs"
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
@@ -32,10 +33,14 @@ defmodule Pleroma.Config.ReleaseRuntimeProvider do
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