Partially restore `/api/statusnet/config.json`
authorEgor Kislitsyn <egor@kislitsyn.com>
Thu, 26 Mar 2020 13:59:45 +0000 (17:59 +0400)
committerEgor Kislitsyn <egor@kislitsyn.com>
Thu, 26 Mar 2020 13:59:45 +0000 (17:59 +0400)
lib/pleroma/web/router.ex
lib/pleroma/web/twitter_api/controllers/util_controller.ex

index c3ea7b6260386488c923c3284d3daea7ff427803..322b074c2d2d9c935a07d3cc51a787a3e6e19e89 100644 (file)
@@ -482,6 +482,9 @@ defmodule Pleroma.Web.Router do
     pipe_through(:config)
 
     get("/pleroma/frontend_configurations", TwitterAPI.UtilController, :frontend_configurations)
+
+    # Deprecated
+    get("/statusnet/config", TwitterAPI.UtilController, :config)
   end
 
   scope "/api", Pleroma.Web do
index bb08f5426562d25d7e51576dff8e9e758d378657..2fc60da5af55b7fb26747665e17e8403f0637e22 100644 (file)
@@ -88,6 +88,18 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
     end
   end
 
+  # Deprecated in favor of `/nodeinfo`
+  # https://git.pleroma.social/pleroma/pleroma/-/merge_requests/2327
+  # https://git.pleroma.social/pleroma/pleroma-fe/-/merge_requests/1084
+  def config(conn, _params) do
+    json(conn, %{
+      site: %{
+        textlimit: to_string(Config.get([:instance, :limit])),
+        vapidPublicKey: Keyword.get(Pleroma.Web.Push.vapid_config(), :public_key)
+      }
+    })
+  end
+
   def frontend_configurations(conn, _params) do
     config =
       Pleroma.Config.get(:frontend_configurations, %{})