|
|
|
@ -3,6 +3,9 @@ defmodule Pleroma.Web.Router do
|
|
|
|
|
|
|
|
|
|
alias Pleroma.{Repo, User, Web.Router}
|
|
|
|
|
|
|
|
|
|
@instance Application.get_env(:pleroma, :instance)
|
|
|
|
|
@federating Keyword.get(@instance, :federating)
|
|
|
|
|
|
|
|
|
|
def user_fetcher(username) do
|
|
|
|
|
{:ok, Repo.get_by(User, %{nickname: username})}
|
|
|
|
|
end
|
|
|
|
@ -228,20 +231,24 @@ defmodule Pleroma.Web.Router do
|
|
|
|
|
get "/objects/:uuid", OStatus.OStatusController, :object
|
|
|
|
|
get "/activities/:uuid", OStatus.OStatusController, :activity
|
|
|
|
|
get "/notice/:id", OStatus.OStatusController, :notice
|
|
|
|
|
|
|
|
|
|
get "/users/:nickname/feed", OStatus.OStatusController, :feed
|
|
|
|
|
get "/users/:nickname", OStatus.OStatusController, :feed_redirect
|
|
|
|
|
|
|
|
|
|
if @federating do
|
|
|
|
|
post "/users/:nickname/salmon", OStatus.OStatusController, :salmon_incoming
|
|
|
|
|
post "/push/hub/:nickname", Websub.WebsubController, :websub_subscription_request
|
|
|
|
|
get "/push/subscriptions/:id", Websub.WebsubController, :websub_subscription_confirmation
|
|
|
|
|
post "/push/subscriptions/:id", Websub.WebsubController, :websub_incoming
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
pipeline :activitypub do
|
|
|
|
|
plug :accepts, ["activity+json"]
|
|
|
|
|
plug Pleroma.Web.Plugs.HTTPSignaturePlug
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if @federating do
|
|
|
|
|
scope "/", Pleroma.Web.ActivityPub do
|
|
|
|
|
pipe_through :activitypub
|
|
|
|
|
post "/users/:nickname/inbox", ActivityPubController, :inbox
|
|
|
|
@ -254,6 +261,7 @@ defmodule Pleroma.Web.Router do
|
|
|
|
|
get "/host-meta", WebFinger.WebFingerController, :host_meta
|
|
|
|
|
get "/webfinger", WebFinger.WebFingerController, :webfinger
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
scope "/", Pleroma.Web.MastodonAPI do
|
|
|
|
|
pipe_through :mastodon_html
|
|
|
|
|