aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoman Chvanikov <chvanikoff@pm.me>2020-07-21 12:14:20 +0300
committerRoman Chvanikov <chvanikoff@pm.me>2020-07-21 12:14:20 +0300
commitec5dcb651ced6372f8eb3d3c16da10edb5b435f1 (patch)
tree5b5b678d0ba70fbd46701d805079edd45649235c /lib
parent7dd03bc83d122b7d73bc151639670bab2c30bd71 (diff)
downloadpleroma-ec5dcb651ced6372f8eb3d3c16da10edb5b435f1.tar.gz
Fix instance setup
Diffstat (limited to 'lib')
-rw-r--r--lib/mix/tasks/pleroma/frontend.ex28
-rw-r--r--lib/mix/tasks/pleroma/instance.ex3
2 files changed, 18 insertions, 13 deletions
diff --git a/lib/mix/tasks/pleroma/frontend.ex b/lib/mix/tasks/pleroma/frontend.ex
index 6b884e4d7..1750b5ffc 100644
--- a/lib/mix/tasks/pleroma/frontend.ex
+++ b/lib/mix/tasks/pleroma/frontend.ex
@@ -77,16 +77,19 @@ defmodule Mix.Tasks.Pleroma.Frontend do
%{"ref" => ref, "url" => url} = get_frontend_metadata(frontend, ref0)
dest = dest_path(frontend, ref)
-
- shell_info("Installing frontend #{frontend} (#{ref})")
-
tmp_dir = Path.join(dest, "tmp/src")
+ fe_label = "#{frontend} (#{ref})"
+
+ shell_info("Downloading #{fe_label} to #{tmp_dir}")
:ok = download_frontend(url, tmp_dir)
+
+ shell_info("Building #{fe_label} (this will take some time)")
:ok = build_frontend(frontend, tmp_dir)
- :ok = install_frontend(frontend, tmp_dir, dest)
- shell_info("Frontend #{frontend} (#{ref}) installed to #{dest}")
+ shell_info("Installing #{fe_label} to #{dest}")
+ :ok = install_frontend(frontend, tmp_dir, dest)
+ shell_info("Frontend #{fe_label} installed to #{dest}")
{:ok, ref}
end
@@ -144,14 +147,13 @@ defmodule Mix.Tasks.Pleroma.Frontend do
# fallback to develop version if compatible stable ref is not defined in
# mix.exs for the given frontend
defp get_frontend_metadata(frontend, @ref_stable) do
- ref =
- Map.get(
- Pleroma.Application.frontends(),
- frontend,
+ case Map.get(Pleroma.Application.frontends(), frontend) do
+ nil ->
get_frontend_metadata(frontend, @ref_develop)
- )
- %{"ref" => ref, "url" => archive_url(frontend, ref)}
+ ref ->
+ %{"ref" => ref, "url" => archive_url(frontend, ref)}
+ end
end
defp get_frontend_metadata(frontend, ref) do
@@ -245,6 +247,8 @@ defmodule Mix.Tasks.Pleroma.Frontend do
Tesla.Middleware.JSON
]
- Tesla.client(middleware)
+ adapter = {Tesla.Adapter.Gun, [timeout: 120_000]}
+
+ Tesla.client(middleware, adapter)
end
end
diff --git a/lib/mix/tasks/pleroma/instance.ex b/lib/mix/tasks/pleroma/instance.ex
index 72c5fcfe5..6319134b4 100644
--- a/lib/mix/tasks/pleroma/instance.ex
+++ b/lib/mix/tasks/pleroma/instance.ex
@@ -162,7 +162,8 @@ defmodule Mix.Tasks.Pleroma.Instance do
)
|> Path.expand()
- Config.put([:instance, :static_dir], static_dir)
+ Config.put([:instance, :static_dir], static_dir) |> IO.inspect(label: "put #{static_dir}")
+ Config.get!([:instance, :static_dir]) |> IO.inspect(label: :get_instance_static_dir)
install_fe =
case Mix.env() do