config :pleroma, :database, rum_enabled: false
+config :pleroma, :env, Mix.env()
+
config :http_signatures,
adapter: Pleroma.Signature
end
end
- if Mix.env() == :test do
+ if Pleroma.Config.get(:env) == :test do
defp streamer_child, do: []
defp chat_child, do: []
else
connect_src = "connect-src 'self' #{static_url} #{websocket_url}"
connect_src =
- if Mix.env() == :dev do
+ if Pleroma.Config.get(:env) == :dev do
connect_src <> " http://localhost:3035/"
else
connect_src
end
script_src =
- if Mix.env() == :dev do
+ if Pleroma.Config.get(:env) == :dev do
"script-src 'self' 'unsafe-eval'"
else
"script-src 'self'"
def start_link do
enabled =
- if Mix.env() == :test, do: true, else: Pleroma.Config.get([__MODULE__, :enabled], false)
+ if Pleroma.Config.get(:env) == :test,
+ do: true,
+ else: Pleroma.Config.get([__MODULE__, :enabled], false)
if enabled do
Logger.info("Starting retry queue")
{:noreply, state}
end
- if Mix.env() == :test do
+ if Pleroma.Config.get(:env) == :test do
defp growth_function(_retries) do
_shutit = Pleroma.Config.get([__MODULE__, :initial_timeout])
DateTime.to_unix(DateTime.utc_now()) - 1
with_body: true
]
- if Mix.env() == :test do
+ if Pleroma.Config.get(:env) == :test do
def parse(url) when is_binary(url), do: parse_url(url)
else
def parse(url) when is_binary(url) do
def parse(nil), do: {:error, "No URL provided"}
- if Mix.env() == :test do
+ if Pleroma.Config.get(:env) == :test do
def parse(url), do: parse_url(url)
else
def parse(url) do
get("/:sig/:url/:filename", MediaProxyController, :remote)
end
- if Mix.env() == :dev do
+ if Pleroma.Config.get(:env) == :dev do
scope "/dev" do
pipe_through([:mailbox_preview])
def render("500.json", assigns) do
Logger.error("Internal server error: #{inspect(assigns[:reason])}")
- if Mix.env() != :prod do
+ if Pleroma.Config.get(:env) != :prod do
%{errors: %{detail: "Internal server error", reason: inspect(assigns[:reason])}}
else
%{errors: %{detail: "Internal server error"}}