config: make the upload limit configurable
authorWilliam Pitcock <nenolod@dereferenced.org>
Sat, 31 Mar 2018 23:43:03 +0000 (23:43 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Sun, 1 Apr 2018 00:53:23 +0000 (19:53 -0500)
config/config.exs
lib/pleroma/web/endpoint.ex

index 151c6b8267133bc755851ee70884515e8ce19bdf..cf8d6c2b741d4a5d5bf2667f665ce277b442e2e7 100644 (file)
@@ -49,6 +49,7 @@ config :pleroma, :instance,
   name: "Pleroma",
   email: "example@example.com",
   limit: 5000,
+  upload_limit: 16_000_000,
   registrations_open: true,
   federating: true
 
index 0a2ac853e768948143b5bc702434ff3c9410b3a5..dde4e3ffec097f1abbc9348fdb7e74c302579f67 100644 (file)
@@ -34,7 +34,8 @@ defmodule Pleroma.Web.Endpoint do
     Plug.Parsers,
     parsers: [:urlencoded, :multipart, :json],
     pass: ["*/*"],
-    json_decoder: Jason
+    json_decoder: Jason,
+    length: Application.get_env(:pleroma, :instance) |> Keyword.get(:upload_limit)
   )
 
   plug(Plug.MethodOverride)