diff --git a/config/dev.exs b/config/dev.exs index f4b1e0cc0..69a7c5a15 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -108,8 +108,10 @@ config :admin, :base_host, "localhost:3114" # While testing, it was discovered that requests made from Elixir could not reach the vite proxy. # # In the future, if we change the setup and the entity that handles the "domain" in local dev is able to forward the requests to the backend correctly, this can be removed -config :admin, :backend_origin, "http://localhost:3001" -config :admin, :umami_origin, "http://localhost:8000" +config :admin, backend_origin: "http://localhost:3001" +config :admin, client_origin: "http://localhost:3114" +config :admin, umami_origin: "http://localhost:8000" +config :admin, library_origin: "http://localhost:3005" # Publication index (development defaults) config :admin, :publication_reindex_headers, [{"meilisearch-rebuild", "secret"}] diff --git a/config/runtime.exs b/config/runtime.exs index 70e79f520..167afb50b 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -148,7 +148,9 @@ if config_env() == :prod do # In production these configs have the same value. config :admin, base_host: base_host config :admin, backend_origin: "https://#{base_host}" + config :admin, client_origin: "https://#{base_host}" config :admin, umami_origin: "https://umami.#{base_host}" + config :admin, library_origin: "https://library.#{base_host}" # Get the value of the header secret to communicate with Meilisearch config :admin, :publication_reindex_headers, [ diff --git a/config/test.exs b/config/test.exs index 03e8f3c0d..5bdba4bfc 100644 --- a/config/test.exs +++ b/config/test.exs @@ -67,5 +67,7 @@ config :admin, :umami, username: "test", password: "testest" +config :admin, :base_host, "graasp.org" +config :admin, :library_origin, "https://library.graasp.org" config :admin, :umami_origin, "http://localhost:8000" config :admin, :umami_req_options, plug: {Req.Test, Admin.UmamiApi}, retry: false diff --git a/lib/admin/platforms.ex b/lib/admin/platforms.ex index 184630d14..ffd5c2685 100644 --- a/lib/admin/platforms.ex +++ b/lib/admin/platforms.ex @@ -4,9 +4,10 @@ defmodule Admin.Platforms do """ defp base_host, do: Application.get_env(:admin, :base_host) + defp library_host, do: Application.get_env(:admin, :library_origin) def get_url(:library, item_id) do - "https://library.#{base_host()}/collections/#{item_id}" + "#{library_host()}/collections/#{item_id}" end def get_url(:player, root_id), do: get_url(:player, root_id, root_id) diff --git a/lib/admin_web/components/layouts.ex b/lib/admin_web/components/layouts.ex index 6b3cd7a7e..614a0d99b 100644 --- a/lib/admin_web/components/layouts.ex +++ b/lib/admin_web/components/layouts.ex @@ -295,7 +295,7 @@ defmodule AdminWeb.Layouts do def landing_menu(assigns) do ~H"""