implement Move activities (#45)
[akkoma] / lib / pleroma / web / router.ex
index e439a279d0ceb22e011d4fcc9d430bfc836b7f3e..b1817ef8b7851f3d9bb8cf6b68b8e9210ab6d7e2 100644 (file)
@@ -109,6 +109,12 @@ defmodule Pleroma.Web.Router do
     plug(Pleroma.Web.Plugs.UserIsAdminPlug)
   end
 
+  pipeline :mastodon_html do
+    plug(:browser)
+    plug(:authenticate)
+    plug(:after_auth)
+  end
+
   pipeline :pleroma_html do
     plug(:browser)
     plug(:authenticate)
@@ -343,6 +349,11 @@ defmodule Pleroma.Web.Router do
     post("/delete_account", UtilController, :delete_account)
     put("/notification_settings", UtilController, :update_notificaton_settings)
     post("/disable_account", UtilController, :disable_account)
+    post("/move_account", UtilController, :move_account)
+
+    put("/aliases", UtilController, :add_alias)
+    get("/aliases", UtilController, :list_aliases)
+    delete("/aliases", UtilController, :delete_alias)
   end
 
   scope "/api/pleroma", Pleroma.Web.PleromaAPI do
@@ -572,6 +583,13 @@ defmodule Pleroma.Web.Router do
     get("/timelines/list/:list_id", TimelineController, :list)
   end
 
+  scope "/api/web", Pleroma.Web do
+    pipe_through(:authenticated_api)
+
+    # Backend-obscure settings blob for MastoFE, don't parse/reuse elsewhere
+    put("/settings", MastoFEController, :put_settings)
+  end
+
   scope "/api/v1", Pleroma.Web.MastodonAPI do
     pipe_through(:app_api)
 
@@ -585,6 +603,8 @@ defmodule Pleroma.Web.Router do
     get("/accounts/search", SearchController, :account_search)
     get("/search", SearchController, :search)
 
+    get("/accounts/lookup", AccountController, :lookup)
+
     get("/accounts/:id/statuses", AccountController, :statuses)
     get("/accounts/:id/followers", AccountController, :followers)
     get("/accounts/:id/following", AccountController, :following)
@@ -780,12 +800,20 @@ defmodule Pleroma.Web.Router do
     pipe_through(:api)
 
     get("/manifest.json", ManifestController, :show)
+    get("/web/manifest.json", MastoFEController, :manifest)
   end
 
   scope "/", Pleroma.Web do
-    pipe_through(:pleroma_html)
+    pipe_through(:mastodon_html)
+
+    get("/web/login", MastodonAPI.AuthController, :login)
+    delete("/auth/sign_out", MastodonAPI.AuthController, :logout)
+
+    post("/auth/password", MastodonAPI.AuthController, :password_reset)
+
+    get("/web/*path", MastoFEController, :index)
 
-    post("/auth/password", TwitterAPI.PasswordController, :request)
+    get("/embed/:id", EmbedController, :show)
   end
 
   scope "/proxy/", Pleroma.Web do