From c33a4315fb09e67d0ed5f644877054a3fb7b1fe1 Mon Sep 17 00:00:00 2001 From: Maksim Pechnikov Date: Mon, 18 May 2020 06:48:19 +0300 Subject: updated docs --- docs/configuration/cheatsheet.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'docs/configuration/cheatsheet.md') diff --git a/docs/configuration/cheatsheet.md b/docs/configuration/cheatsheet.md index 1078c4e87..aaea3f46c 100644 --- a/docs/configuration/cheatsheet.md +++ b/docs/configuration/cheatsheet.md @@ -249,6 +249,26 @@ This section describe PWA manifest instance-specific values. Currently this opti * `base_url`: The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host/CDN fronts. * `proxy_opts`: All options defined in `Pleroma.ReverseProxy` documentation, defaults to `[max_body_length: (25*1_048_576)]`. * `whitelist`: List of domains to bypass the mediaproxy +* `invalidation`: options for remove media from cache after delete object: + * `enabled`: Enables purge cache + * `provider`: Which one of the [purge cache strategy](#purge-cache-strategy) to use. + +### Purge cache strategy + +#### Pleroma.Web.MediaProxy.Invalidation.Script + +This strategy allow perform external bash script to purge cache. +Urls of attachments pass to script as arguments. + +* `script_path`: path to external script. + +#### Pleroma.Web.MediaProxy.Invalidation.Http + +This strategy allow perform custom http request to purge cache. + +* `method`: http method. default is `purge` +* `headers`: http headers. default is empty +* `options`: request options. default is empty ## Link previews -- cgit v1.2.3 From 5f0a3ac74d51333a778e6be26876fe26b0ff625b Mon Sep 17 00:00:00 2001 From: Maksim Pechnikov Date: Mon, 18 May 2020 09:22:26 +0300 Subject: added tests --- docs/configuration/cheatsheet.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'docs/configuration/cheatsheet.md') diff --git a/docs/configuration/cheatsheet.md b/docs/configuration/cheatsheet.md index aaea3f46c..ddea6a4fb 100644 --- a/docs/configuration/cheatsheet.md +++ b/docs/configuration/cheatsheet.md @@ -262,6 +262,12 @@ Urls of attachments pass to script as arguments. * `script_path`: path to external script. +Example: +```elixir +config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Script, + script_path: "./installation/nginx-cache-purge.example" +``` + #### Pleroma.Web.MediaProxy.Invalidation.Http This strategy allow perform custom http request to purge cache. @@ -270,6 +276,14 @@ This strategy allow perform custom http request to purge cache. * `headers`: http headers. default is empty * `options`: request options. default is empty +Example: +```elixir +config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Http, + method: :purge, + headers: [], + options: [] +``` + ## Link previews ### Pleroma.Web.Metadata (provider) -- cgit v1.2.3