Commit e49131bb authored by kaniini's avatar kaniini

relay: move to /relay endpoint from / due to webapp issues

parent 2b628f23
......@@ -638,16 +638,18 @@ defmodule Pleroma.User do
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
......
......@@ -283,6 +283,10 @@ defmodule Pleroma.Web.Router do
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
......@@ -319,9 +323,8 @@ defmodule Pleroma.Web.Router do
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment