From 368b22fd2f41cb9d7883fb823732f35426fc7ed7 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Sun, 6 Aug 2023 15:12:57 +0100 Subject: [PATCH] Ensure we can't crash out on unusual logger backend settings --- lib/pleroma/application.ex | 3 ++- lib/pleroma/config/transfer_task.ex | 2 +- lib/pleroma/web/plugs/o_auth_scopes_plug.ex | 4 +--- mix.exs | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex index 1c905303c..3200175d1 100644 --- a/lib/pleroma/application.ex +++ b/lib/pleroma/application.ex @@ -158,8 +158,9 @@ def load_all_pleroma_modules do |> String.to_existing_atom() |> Code.ensure_loaded!() end) + # Use this when 1.15 is standard - #|> Code.ensure_all_loaded!() + # |> Code.ensure_all_loaded!() end defp cachex_children do diff --git a/lib/pleroma/config/transfer_task.ex b/lib/pleroma/config/transfer_task.ex index efbc84eb0..a8a96f393 100644 --- a/lib/pleroma/config/transfer_task.ex +++ b/lib/pleroma/config/transfer_task.ex @@ -110,7 +110,7 @@ defp merge_with_default(%{group: group, key: key, value: value} = setting) do defp configure({_, :backends, _, merged}) do # removing current backends - Enum.each(Application.get_env(:logger, :backends), &Logger.remove_backend/1) + Enum.each(Application.get_env(:logger, :backends, []), &Logger.remove_backend/1) Enum.each(merged, &Logger.add_backend/1) diff --git a/lib/pleroma/web/plugs/o_auth_scopes_plug.ex b/lib/pleroma/web/plugs/o_auth_scopes_plug.ex index e4d098a7d..f017c8bc7 100644 --- a/lib/pleroma/web/plugs/o_auth_scopes_plug.ex +++ b/lib/pleroma/web/plugs/o_auth_scopes_plug.ex @@ -34,9 +34,7 @@ def perform(%Plug.Conn{assigns: assigns} = conn, %{scopes: scopes} = options) do permissions = Enum.join(missing_scopes, " #{op} ") error_message = - dgettext("errors", "Insufficient permissions: %{permissions}.", - permissions: permissions - ) + dgettext("errors", "Insufficient permissions: %{permissions}.", permissions: permissions) conn |> put_resp_content_type("application/json") diff --git a/mix.exs b/mix.exs index 2b555f39b..27f1aa77a 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Pleroma.Mixfile do def project do [ app: :pleroma, - version: version("3.10.2"), + version: version("3.10.3"), elixir: "~> 1.14", elixirc_paths: elixirc_paths(Mix.env()), compilers: [:phoenix] ++ Mix.compilers(),