diff --git a/config/config.exs b/config/config.exs index 7385fb6c3..1ec4b4d85 100644 --- a/config/config.exs +++ b/config/config.exs @@ -405,6 +405,14 @@ config :pleroma, :media_proxy, ], whitelist: [] +config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Http, %{ + "method" => :purge, + "headers" => [], + "options" => [] +} + +config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Script, script_path: nil + config :pleroma, :chat, enabled: true config :phoenix, :format_encoders, json: Jason diff --git a/docs/configuration/cheatsheet.md b/docs/configuration/cheatsheet.md index 505acb293..e841c2bec 100644 --- a/docs/configuration/cheatsheet.md +++ b/docs/configuration/cheatsheet.md @@ -283,10 +283,11 @@ This strategy allow perform custom http request to purge cache. Example: ```elixir -config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Http, - method: :purge, - headers: [], - options: [] +config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Http, %{ + "method" => :purge, + "headers" => [], + "options" => [] +} ``` ## Link previews diff --git a/lib/pleroma/web/media_proxy/invalidations/http.ex b/lib/pleroma/web/media_proxy/invalidations/http.ex index 07248df6e..eec95e7e0 100644 --- a/lib/pleroma/web/media_proxy/invalidations/http.ex +++ b/lib/pleroma/web/media_proxy/invalidations/http.ex @@ -17,7 +17,8 @@ defmodule Pleroma.Web.MediaProxy.Invalidation.Http do Logger.debug("Running cache purge: #{inspect(urls)}") Enum.each(urls, fn url -> - with {:error, error} <- do_purge(method, url, headers, options) do + with {:error, error} <- + do_purge(method, url |> Pleroma.Web.MediaProxy.url(), headers, options) do Logger.error("Error while cache purge: url - #{url}, error: #{inspect(error)}") end end)