Remove quack, ensure adapter is finch
[akkoma] / lib / pleroma / config / deprecation_warnings.ex
index c213f3ce667389c3bce419b5ec982509ed591c4f..33dc925bba42f74f71026403119ae3f63ae51ff1 100644 (file)
@@ -181,7 +181,8 @@ defmodule Pleroma.Config.DeprecationWarnings do
       check_uploders_s3_public_endpoint(),
       check_quarantined_instances_tuples(),
       check_transparency_exclusions_tuples(),
-      check_simple_policy_tuples()
+      check_simple_policy_tuples(),
+      check_http_adapter()
     ]
     |> Enum.reduce(:ok, fn
       :ok, :ok -> :ok
@@ -210,6 +211,26 @@ defmodule Pleroma.Config.DeprecationWarnings do
     end
   end
 
+  def check_http_adapter do
+    http_adapter = Application.get_env(:tesla, :adapter)
+    case http_adapter do
+      {Tesla.Adapter.Finch, _} ->
+        :ok
+
+      _anything_else ->
+        Logger.error("""
+        !!!CONFIG ERROR!!!
+        Your config is using a custom tesla adapter, this was standardised
+        to finch in 2022.06, and alternate adapters were removed in 2023.02.
+        Please ensure you either:
+        \n* do not have any custom value for `:tesla, :adapter`, or
+        \n* have `config :tesla, :adapter, {Tesla.Adapter.Finch, name: MyFinch}`
+        """)
+
+        :error
+    end
+  end
+
   def check_old_mrf_config do
     warning_preface = """
     !!!DEPRECATION WARNING!!!