end
def get_or_create_instance_user do
- if user = get_by_ap_id(Pleroma.Web.Endpoint.url()) do
+ relay_uri = "#{Pleroma.Web.Endpoint.url()}/relay"
+
+ if user = get_by_ap_id(relay_uri) do
user
else
changes =
%User{}
|> cast(%{}, [:ap_id, :nickname, :local])
- |> put_change(:ap_id, Pleroma.Web.Endpoint.url())
+ |> put_change(:ap_id, relay_uri)
|> put_change(:nickname, nil)
|> put_change(:local, true)
- |> put_change(:follower_address, Pleroma.Web.Endpoint.url() <> "/relay/followers")
+ |> put_change(:follower_address, relay_uri <> "/followers")
{:ok, user} = Repo.insert(changes)
user
get("/externalprofile/show", TwitterAPI.Controller, :external_profile)
end
+ pipeline :ap_relay do
+ plug(:accepts, ["activity+json"])
+ end
+
pipeline :ostatus do
plug(:accepts, ["xml", "atom", "html", "activity+json"])
end
end
if @federating do
- scope "/", Pleroma.Web.ActivityPub do
- # XXX: not really ostatus either
- pipe_through(:ostatus)
+ scope "/relay", Pleroma.Web.ActivityPub do
+ pipe_through(:ap_relay)
get("/", ActivityPubController, :relay)
end