Put js build through phoenix
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -73,9 +73,9 @@ defmodule Eventos.Actors.Actor do
|
||||
:banner_url,
|
||||
:user_id
|
||||
])
|
||||
|> put_change(:url, "#{EventosWeb.Endpoint.url()}/@#{attrs["prefered_username"]}")
|
||||
|> put_change(:url, "#{EventosWeb.Endpoint.url()}/@#{attrs["preferred_username"]}")
|
||||
|> validate_required([:preferred_username, :keys, :suspended, :url])
|
||||
|> unique_constraint(:prefered_username, name: :actors_preferred_username_domain_index)
|
||||
|> unique_constraint(:preferred_username, name: :actors_preferred_username_domain_index)
|
||||
end
|
||||
|
||||
def registration_changeset(%Actor{} = actor, attrs) do
|
||||
@@ -94,7 +94,10 @@ defmodule Eventos.Actors.Actor do
|
||||
:user_id
|
||||
])
|
||||
|> unique_constraint(:preferred_username, name: :actors_preferred_username_domain_index)
|
||||
|> put_change(:url, "#{EventosWeb.Endpoint.url()}/@#{attrs["prefered_username"]}")
|
||||
|> put_change(:url, "#{EventosWeb.Endpoint.url()}/@#{attrs.preferred_username}")
|
||||
|> put_change(:inbox_url, "#{EventosWeb.Endpoint.url()}/@#{attrs.preferred_username}/inbox")
|
||||
|> put_change(:outbox_url, "#{EventosWeb.Endpoint.url()}/@#{attrs.preferred_username}/outbox")
|
||||
|> put_change(:shared_inbox_url, "#{EventosWeb.Endpoint.url()}/inbox")
|
||||
|> validate_required([:preferred_username, :keys, :suspended, :url, :type])
|
||||
end
|
||||
|
||||
@@ -157,14 +160,14 @@ defmodule Eventos.Actors.Actor do
|
||||
])
|
||||
|> put_change(
|
||||
:outbox_url,
|
||||
"#{EventosWeb.Endpoint.url()}/@#{params["prefered_username"]}/outbox"
|
||||
"#{EventosWeb.Endpoint.url()}/@#{params["preferred_username"]}/outbox"
|
||||
)
|
||||
|> put_change(
|
||||
:inbox_url,
|
||||
"#{EventosWeb.Endpoint.url()}/@#{params["prefered_username"]}/inbox"
|
||||
"#{EventosWeb.Endpoint.url()}/@#{params["preferred_username"]}/inbox"
|
||||
)
|
||||
|> put_change(:shared_inbox_url, "#{EventosWeb.Endpoint.url()}/inbox")
|
||||
|> put_change(:url, "#{EventosWeb.Endpoint.url()}/@#{params["prefered_username"]}")
|
||||
|> put_change(:url, "#{EventosWeb.Endpoint.url()}/@#{params["preferred_username"]}")
|
||||
|> put_change(:domain, nil)
|
||||
|> put_change(:type, :Group)
|
||||
|> validate_required([:url, :outbox_url, :inbox_url, :type, :name, :preferred_username])
|
||||
|
||||
@@ -11,9 +11,16 @@ defmodule EventosWeb.ActivityPubController do
|
||||
|
||||
def actor(conn, %{"name" => name}) do
|
||||
with %Actor{} = actor <- Actors.get_local_actor_by_name(name) do
|
||||
conn
|
||||
|> put_resp_header("content-type", "application/activity+json")
|
||||
|> json(ActorView.render("actor.json", %{actor: actor}))
|
||||
case get_req_header(conn, "accept") do
|
||||
["application/activity+json"] ->
|
||||
conn
|
||||
|> put_resp_header("content-type", "application/activity+json")
|
||||
|> json(ActorView.render("actor.json", %{actor: actor}))
|
||||
_ ->
|
||||
conn
|
||||
|> put_resp_content_type("text/html")
|
||||
|> send_file(200, "priv/static/index.html")
|
||||
end
|
||||
else
|
||||
nil -> {:error, :not_found}
|
||||
end
|
||||
|
||||
@@ -7,6 +7,8 @@ defmodule EventosWeb.PageController do
|
||||
plug(:put_layout, false)
|
||||
|
||||
def index(conn, _params) do
|
||||
render(conn, "index.html")
|
||||
conn
|
||||
|> put_resp_content_type("text/html")
|
||||
|> send_file(200, "priv/static/index.html")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,7 +13,7 @@ defmodule EventosWeb.Router do
|
||||
end
|
||||
|
||||
pipeline :activity_pub do
|
||||
plug(:accepts, ["activity-json"])
|
||||
plug(:accepts, ["activity-json", "text/html"])
|
||||
plug(EventosWeb.HTTPSignaturePlug)
|
||||
end
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<!DOCTYPE html><html><head><link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons" rel=stylesheet><script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBF37pw38j0giICt73TCAPNogc07Upe_Q4&libraries=places"></script><meta charset=utf-8><title>libre-event</title><link href=/css/app.a3c38b40a31fa078b9acdba649983cb5.css rel=stylesheet></head><body><noscript>Mets du JS.</noscript><div id=app></div><script type=text/javascript src=/js/manifest.881ff1dba0c9e5d0130f.js></script><script type=text/javascript src=/js/vendor.0d63a19c6680451dd336.js></script><script type=text/javascript src=/js/app.29c4f33994925affb616.js></script></body></html>
|
||||
Reference in New Issue
Block a user