Add proxy route and proxify pics everywhere

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-05-28 10:51:02 +02:00
parent c648ff1f37
commit d4d295eae1
8 changed files with 65 additions and 17 deletions

View File

@@ -39,6 +39,9 @@ defmodule MobilizonWeb.Router do
plug(:put_secure_browser_headers)
end
pipeline :remote_media do
end
scope "/api" do
pipe_through(:graphql)
@@ -94,6 +97,13 @@ defmodule MobilizonWeb.Router do
post("/inbox", ActivityPubController, :inbox)
end
scope "/proxy/", MobilizonWeb do
pipe_through(:remote_media)
get("/:sig/:url", MediaProxyController, :remote)
get("/:sig/:url/:filename", MediaProxyController, :remote)
end
if Mix.env() == :dev do
# If using Phoenix
forward("/sent_emails", Bamboo.SentEmailViewerPlug)