summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorfeld <feld@feld.me>2020-09-18 18:38:20 +0000
committerfeld <feld@feld.me>2020-09-18 18:38:20 +0000
commit6c052bd5b6cc29d321b500654bd6b098d0e6c56a (patch)
tree9357c0e0f653f8e35d63e32eb0faf090e600a816 /config
parent91ddd47e513c5fc343ffa9bea069801b0142a115 (diff)
parenta42880040574701000470fc1c2dbd6f7242c1a06 (diff)
Merge branch 'media-preview-proxy-nostream' into 'develop'
Media preview proxy See merge request pleroma/pleroma!3001
Diffstat (limited to 'config')
-rw-r--r--config/config.exs14
-rw-r--r--config/description.exs43
2 files changed, 55 insertions, 2 deletions
diff --git a/config/config.exs b/config/config.exs
index 147f09722..00624bf00 100644
--- a/config/config.exs
+++ b/config/config.exs
@@ -434,6 +434,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
@@ -448,6 +450,14 @@ 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,
+ image_quality: 85,
+ min_content_length: 100 * 1024
+
config :pleroma, :chat, enabled: true
config :phoenix, :format_encoders, json: Jason
@@ -753,8 +763,8 @@ config :pleroma, :pools,
],
media: [
size: 50,
- max_waiting: 10,
- recv_timeout: 10_000
+ max_waiting: 20,
+ recv_timeout: 15_000
],
upload: [
size: 25,
diff --git a/config/description.exs b/config/description.exs
index 6f3855918..097e98633 100644
--- a/config/description.exs
+++ b/config/description.exs
@@ -1887,6 +1887,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
@@ -1908,6 +1909,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,
@@ -1955,6 +1961,43 @@ 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 for images (video preview always has original dimensions)."
+ },
+ %{
+ key: :thumbnail_max_height,
+ type: :integer,
+ description:
+ "Max height of preview thumbnail for images (video preview always has original dimensions)."
+ },
+ %{
+ key: :image_quality,
+ type: :integer,
+ description: "Quality of the output. Ranges from 0 (min quality) to 100 (max quality)."
+ },
+ %{
+ key: :min_content_length,
+ type: :integer,
+ description:
+ "Min content length to perform preview, in bytes. If greater than 0, media smaller in size will be served as is, without thumbnailing."
+ }
+ ]
+ },
+ %{
+ group: :pleroma,
key: Pleroma.Web.MediaProxy.Invalidation.Http,
type: :group,
description: "HTTP invalidate settings",