1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Config.Holder do
6 @config Pleroma.Config.Loader.default_config()
8 @spec save_default() :: :ok
11 if System.get_env("RELEASE_NAME") do
12 Pleroma.Config.Loader.merge(@config, release_defaults())
17 Pleroma.Config.put(:default_config, default_config)
20 @spec default_config() :: keyword()
21 def default_config, do: get_default()
23 @spec default_config(atom()) :: keyword()
24 def default_config(group), do: Keyword.get(get_default(), group)
26 @spec default_config(atom(), atom()) :: keyword()
27 def default_config(group, key), do: get_in(get_default(), [group, key])
29 defp get_default, do: Pleroma.Config.get(:default_config)
31 @spec release_defaults() :: keyword()
32 def release_defaults do
35 {:instance, [static_dir: "/var/lib/pleroma/static"]},
36 {Pleroma.Uploaders.Local, [uploads: "/var/lib/pleroma/uploads"]},
37 {:modules, [runtime_dir: "/var/lib/pleroma/modules"]},