X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fconfig%2Floader.ex;h=b64d06707840788f6442f3ce68240370a7c8662a;hb=5856f51717c12f4c6b0b89e480ff689c8480393d;hp=b2cb34129ed81dbb946dd981d7584f945d1d9daa;hpb=282a93554fbf919ff553d839eeea98abe1f861d4;p=akkoma
diff --git a/lib/pleroma/config/loader.ex b/lib/pleroma/config/loader.ex
index b2cb34129..b64d06707 100644
--- a/lib/pleroma/config/loader.ex
+++ b/lib/pleroma/config/loader.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Config.Loader do
@@ -12,15 +12,26 @@ defmodule Pleroma.Config.Loader do
:swarm
]
+ @reject_groups [
+ :postgrex,
+ :tesla
+ ]
+
if Code.ensure_loaded?(Config.Reader) do
@reader Config.Reader
+
+ def read(path), do: @reader.read!(path)
else
# support for Elixir less than 1.9
@reader Mix.Config
+ def read(path) do
+ path
+ |> @reader.eval!()
+ |> elem(0)
+ end
end
@spec read(Path.t()) :: keyword()
- def read(path), do: @reader.read!(path)
@spec merge(keyword(), keyword()) :: keyword()
def merge(c1, c2), do: @reader.merge(c1, c2)
@@ -41,7 +52,8 @@ defmodule Pleroma.Config.Loader do
@spec filter_group(atom(), keyword()) :: keyword()
def filter_group(group, configs) do
Enum.reject(configs[group], fn {key, _v} ->
- key in @reject_keys or (group == :phoenix and key == :serve_endpoints)
+ key in @reject_keys or group in @reject_groups or
+ (group == :phoenix and key == :serve_endpoints)
end)
end
end