From 3771db97b4bdc5bf1161a1086e89cf14296328fb Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Thu, 21 May 2020 16:23:57 -0500 Subject: Add MediaProxy invalidation settings to description.exs --- config/description.exs | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/config/description.exs b/config/description.exs index cf7cc297a..5873aba7e 100644 --- a/config/description.exs +++ b/config/description.exs @@ -1632,6 +1632,31 @@ config :pleroma, :config_description, [ "The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host/CDN fronts.", suggestions: ["https://example.com"] }, + %{ + key: :invalidation, + type: :keyword, + description: "Cache invalidation for MediaProxy", + suggestions: [ + enabled: false, + provider: Pleroma.Web.MediaProxy.Invalidation.Script + ], + children: [ + %{ + key: :enabled, + type: :boolean, + description: "Enable cache invalidation when object is deleted." + }, + %{ + key: :provider, + type: {:dropdown, :atom}, + suggestions: [ + "Pleroma.Web.MediaProxy.Invalidation.Http", + "Pleroma.Web.MediaProxy.Invalidation.Script" + ], + description: "Invalidate cached objects via HTTP or a custom script." + } + ] + }, %{ key: :proxy_opts, type: :keyword, @@ -1704,6 +1729,43 @@ config :pleroma, :config_description, [ } ] }, + %{ + group: :pleroma, + key: Pleroma.Web.MediaProxy.Invalidation.Http, + type: :group, + description: "MediaProxy Cache Invalidation Http Settings", + children: [ + %{ + key: :method, + type: :string, + description: "HTTP method for invalidation requests.", + suggestions: ["purge"] + }, + %{ + key: :headers, + type: :string, + description: "Additional HTTP headers for invalidation requests." + }, + %{ + key: :options, + type: :string, + description: "Additional HTTP request options for invalidation requests." + } + ] + }, + %{ + group: :pleroma, + key: Pleroma.Web.MediaProxy.Invalidation.Script, + type: :group, + description: "MediaProxy Cache Invalidation Script Settings", + children: [ + %{ + key: :script_path, + type: :string, + description: "Path to a custom script to automate cache invalidation." + } + ] + }, %{ group: :pleroma, key: :gopher, -- cgit v1.2.3