logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: df0734fcbf7adcd98e9bce38cc7aa18345aaf78d
parent ede414094f7b196d3ff129b8a23ba461ef80d29f
Author: Mark Felder <feld@feld.me>
Date:   Sun, 11 Feb 2024 16:53:21 -0500

Increase the :max_body for Rich Media to 5MB

Websites are increasingly getting more bloated with tricks like inlining content (e.g., CNN.com) which puts pages at or above 5MB. This value may still be too low.

Diffstat:

Mconfig/config.exs3++-
Mconfig/test.exs3++-
Mlib/pleroma/web/rich_media/helpers.ex2+-
3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/config/config.exs b/config/config.exs @@ -428,7 +428,8 @@ config :pleroma, :rich_media, Pleroma.Web.RichMedia.Parsers.OEmbed ], failure_backoff: 60_000, - ttl_setters: [Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl] + ttl_setters: [Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl], + max_body: 5_000_000 config :pleroma, :media_proxy, enabled: false, diff --git a/config/test.exs b/config/test.exs @@ -61,7 +61,8 @@ config :tesla, adapter: Tesla.Mock config :pleroma, :rich_media, enabled: false, ignore_hosts: [], - ignore_tld: ["local", "localdomain", "lan"] + ignore_tld: ["local", "localdomain", "lan"], + max_body: 2_000_000 config :pleroma, :instance, multi_factor_authentication: [ diff --git a/lib/pleroma/web/rich_media/helpers.ex b/lib/pleroma/web/rich_media/helpers.ex @@ -59,7 +59,7 @@ defmodule Pleroma.Web.RichMedia.Helpers do defp http_options() do [ pool: :media, - max_body: Config.get([:rich_media, :max_body], 2_000_000) + max_body: Config.get([:rich_media, :max_body], 5_000_000) ] end end