fix for endpoints after env update
authorAlexander <alex.strizhakov@gmail.com>
Tue, 10 Dec 2019 09:00:40 +0000 (12:00 +0300)
committerAlexander Strizhakov <alex.strizhakov@gmail.com>
Fri, 10 Jan 2020 12:52:00 +0000 (15:52 +0300)
lib/mix/tasks/pleroma/config.ex
lib/pleroma/config/transfer_task.ex

index cef02b864bb31d0a4a07fdc8900b4cd6e880c799..257a0dfe5841fa53541980f3fe84784f32e59aef 100644 (file)
@@ -74,7 +74,9 @@ defmodule Mix.Tasks.Pleroma.Config do
   defp load_and_create(group) do
     group
     |> Application.get_all_env()
-    |> Enum.reject(fn {k, _v} -> k in [Pleroma.Repo, :env] end)
+    |> Enum.reject(fn {k, _v} ->
+      k in [Pleroma.Repo, :env] or (group == :phoenix and k == :serve_endpoints)
+    end)
     |> Enum.each(fn {key, value} ->
       key = inspect(key)
       {:ok, _} = Config.update_or_create(%{group: inspect(group), key: key, value: value})
index 0bc4c4029a30a155a61712eee3f94e43cbca1f18..c89c1fcc8c56202cfb52e5b9688703a376a7b104 100644 (file)
@@ -37,7 +37,9 @@ defmodule Pleroma.Config.TransferTask do
       group = Config.from_string(setting.group)
       value = Config.from_binary(setting.value)
 
-      :ok = Application.put_env(group, key, value)
+      if group != :phoenix and key != :serve_endpoints do
+        :ok = Application.put_env(group, key, value)
+      end
 
       group
     rescue