projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor edit (comment).
[akkoma]
/
lib
/
pleroma
/
web
/
router.ex
diff --git
a/lib/pleroma/web/router.ex
b/lib/pleroma/web/router.ex
index e0611e3fcb6f7352fe55b2f3e09a1e59f1e821bf..837153ed452547690dfccdf6ba04fa6ec7bb12e3 100644
(file)
--- a/
lib/pleroma/web/router.ex
+++ b/
lib/pleroma/web/router.ex
@@
-202,6
+202,9
@@
defmodule Pleroma.Web.Router do
put("/statuses/:id", AdminAPIController, :status_update)
delete("/statuses/:id", AdminAPIController, :status_delete)
put("/statuses/:id", AdminAPIController, :status_update)
delete("/statuses/:id", AdminAPIController, :status_delete)
+
+ get("/config", AdminAPIController, :config_show)
+ post("/config", AdminAPIController, :config_update)
end
scope "/", Pleroma.Web.TwitterAPI do
end
scope "/", Pleroma.Web.TwitterAPI do
@@
-309,8
+312,6
@@
defmodule Pleroma.Web.Router do
post("/conversations/:id/read", MastodonAPIController, :conversation_read)
get("/endorsements", MastodonAPIController, :empty_array)
post("/conversations/:id/read", MastodonAPIController, :conversation_read)
get("/endorsements", MastodonAPIController, :empty_array)
-
- get("/pleroma/flavour", MastodonAPIController, :get_flavour)
end
scope [] do
end
scope [] do
@@
-335,6
+336,8
@@
defmodule Pleroma.Web.Router do
put("/scheduled_statuses/:id", MastodonAPIController, :update_scheduled_status)
delete("/scheduled_statuses/:id", MastodonAPIController, :delete_scheduled_status)
put("/scheduled_statuses/:id", MastodonAPIController, :update_scheduled_status)
delete("/scheduled_statuses/:id", MastodonAPIController, :delete_scheduled_status)
+ post("/polls/:id/votes", MastodonAPIController, :poll_vote)
+
post("/media", MastodonAPIController, :upload)
put("/media/:id", MastodonAPIController, :update_media)
post("/media", MastodonAPIController, :upload)
put("/media/:id", MastodonAPIController, :update_media)
@@
-350,7
+353,8
@@
defmodule Pleroma.Web.Router do
put("/filters/:id", MastodonAPIController, :update_filter)
delete("/filters/:id", MastodonAPIController, :delete_filter)
put("/filters/:id", MastodonAPIController, :update_filter)
delete("/filters/:id", MastodonAPIController, :delete_filter)
- post("/pleroma/flavour/:flavour", MastodonAPIController, :set_flavour)
+ get("/pleroma/mascot", MastodonAPIController, :get_mascot)
+ put("/pleroma/mascot", MastodonAPIController, :set_mascot)
post("/reports", MastodonAPIController, :reports)
end
post("/reports", MastodonAPIController, :reports)
end
@@
-411,7
+415,7
@@
defmodule Pleroma.Web.Router do
get("/trends", MastodonAPIController, :empty_array)
get("/trends", MastodonAPIController, :empty_array)
- get("/accounts/search",
MastodonAPI
Controller, :account_search)
+ get("/accounts/search",
Search
Controller, :account_search)
scope [] do
pipe_through(:oauth_read_or_public)
scope [] do
pipe_through(:oauth_read_or_public)
@@
-430,7
+434,7
@@
defmodule Pleroma.Web.Router do
get("/accounts/:id/following", MastodonAPIController, :following)
get("/accounts/:id", MastodonAPIController, :user)
get("/accounts/:id/following", MastodonAPIController, :following)
get("/accounts/:id", MastodonAPIController, :user)
- get("/search",
MastodonAPI
Controller, :search)
+ get("/search",
Search
Controller, :search)
get("/pleroma/accounts/:id/favourites", MastodonAPIController, :user_favourites)
end
get("/pleroma/accounts/:id/favourites", MastodonAPIController, :user_favourites)
end
@@
-438,7
+442,7
@@
defmodule Pleroma.Web.Router do
scope "/api/v2", Pleroma.Web.MastodonAPI do
pipe_through([:api, :oauth_read_or_public])
scope "/api/v2", Pleroma.Web.MastodonAPI do
pipe_through([:api, :oauth_read_or_public])
- get("/search",
MastodonAPI
Controller, :search2)
+ get("/search",
Search
Controller, :search2)
end
scope "/api", Pleroma.Web do
end
scope "/api", Pleroma.Web do
@@
-603,12
+607,6
@@
defmodule Pleroma.Web.Router do
post("/push/subscriptions/:id", Websub.WebsubController, :websub_incoming)
end
post("/push/subscriptions/:id", Websub.WebsubController, :websub_incoming)
end
- scope "/", Pleroma.Web do
- pipe_through(:oembed)
-
- get("/oembed", OEmbed.OEmbedController, :url)
- end
-
pipeline :activitypub do
plug(:accepts, ["activity+json", "json"])
plug(Pleroma.Web.Plugs.HTTPSignaturePlug)
pipeline :activitypub do
plug(:accepts, ["activity+json", "json"])
plug(Pleroma.Web.Plugs.HTTPSignaturePlug)
@@
-698,7
+696,7
@@
defmodule Pleroma.Web.Router do
get("/:sig/:url/:filename", MediaProxyController, :remote)
end
get("/:sig/:url/:filename", MediaProxyController, :remote)
end
- if
Mix.env(
) == :dev do
+ if
Pleroma.Config.get(:env
) == :dev do
scope "/dev" do
pipe_through([:mailbox_preview])
scope "/dev" do
pipe_through([:mailbox_preview])
@@
-706,9
+704,15
@@
defmodule Pleroma.Web.Router do
end
end
end
end
+ scope "/", Pleroma.Web.MongooseIM do
+ get("/user_exists", MongooseIMController, :user_exists)
+ get("/check_password", MongooseIMController, :check_password)
+ end
+
scope "/", Fallback do
get("/registration/:token", RedirectController, :registration_page)
get("/:maybe_nickname_or_id", RedirectController, :redirector_with_meta)
scope "/", Fallback do
get("/registration/:token", RedirectController, :registration_page)
get("/:maybe_nickname_or_id", RedirectController, :redirector_with_meta)
+ get("/api*path", RedirectController, :api_not_implemented)
get("/*path", RedirectController, :redirector)
options("/*path", RedirectController, :empty)
get("/*path", RedirectController, :redirector)
options("/*path", RedirectController, :empty)
@@
-720,6
+724,12
@@
defmodule Fallback.RedirectController do
alias Pleroma.User
alias Pleroma.Web.Metadata
alias Pleroma.User
alias Pleroma.Web.Metadata
+ def api_not_implemented(conn, _params) do
+ conn
+ |> put_status(404)
+ |> json(%{error: "Not implemented"})
+ end
+
def redirector(conn, _params, code \\ 200) do
conn
|> put_resp_content_type("text/html")
def redirector(conn, _params, code \\ 200) do
conn
|> put_resp_content_type("text/html")