diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/config.exs | 12 | ||||
-rw-r--r-- | config/description.exs | 56 |
2 files changed, 68 insertions, 0 deletions
diff --git a/config/config.exs b/config/config.exs index 246712b9f..e1558e29e 100644 --- a/config/config.exs +++ b/config/config.exs @@ -423,6 +423,8 @@ config :pleroma, :media_proxy, proxy_opts: [ redirect_on_failure: false, max_body_length: 25 * 1_048_576, + # Note: max_read_duration defaults to Pleroma.ReverseProxy.max_read_duration_default/1 + max_read_duration: 30_000, http: [ follow_redirect: true, pool: :media @@ -437,6 +439,16 @@ config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Http, config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Script, script_path: nil +# Note: media preview proxy depends on media proxy to be enabled +config :pleroma, :media_preview_proxy, + enabled: false, + thumbnail_max_width: 600, + thumbnail_max_height: 600, + quality: 2, + proxy_opts: [ + head_request_max_read_duration: 5_000 + ] + config :pleroma, :chat, enabled: true config :phoenix, :format_encoders, json: Jason diff --git a/config/description.exs b/config/description.exs index 29a657333..0082cc84f 100644 --- a/config/description.exs +++ b/config/description.exs @@ -1880,6 +1880,7 @@ config :pleroma, :config_description, [ suggestions: [ redirect_on_failure: false, max_body_length: 25 * 1_048_576, + max_read_duration: 30_000, http: [ follow_redirect: true, pool: :media @@ -1901,6 +1902,11 @@ config :pleroma, :config_description, [ "specified length. It is validated with the `content-length` header and also verified when proxying." }, %{ + key: :max_read_duration, + type: :integer, + description: "Timeout (in milliseconds) of GET request to remote URI." + }, + %{ key: :http, label: "HTTP", type: :keyword, @@ -1948,6 +1954,56 @@ config :pleroma, :config_description, [ }, %{ group: :pleroma, + key: :media_preview_proxy, + type: :group, + description: "Media preview proxy", + children: [ + %{ + key: :enabled, + type: :boolean, + description: + "Enables proxying of remote media preview to the instance's proxy. Requires enabled media proxy." + }, + %{ + key: :thumbnail_max_width, + type: :integer, + description: "Max width of preview thumbnail." + }, + %{ + key: :thumbnail_max_height, + type: :integer, + description: "Max height of preview thumbnail." + }, + %{ + key: :quality, + type: :integer, + description: "Quality of the output. Ranges from 1 (max quality) to 31 (lowest quality)." + }, + %{ + key: :proxy_opts, + type: :keyword, + description: "Media proxy options", + suggestions: [ + head_request_max_read_duration: 5_000 + ], + children: [ + %{ + key: :head_request_max_read_duration, + type: :integer, + description: "Timeout (in milliseconds) of HEAD request to remote URI." + } + ] + }, + %{ + key: :whitelist, + type: {:list, :string}, + description: "List of hosts with scheme to bypass the mediaproxy", + suggestions: ["http://example.com"] + } + ] + }, + %{ + group: :pleroma, key: Pleroma.Web.MediaProxy.Invalidation.Http, type: :group, description: "HTTP invalidate settings", |