diff --git a/changelog.d/admin-fe-package-url.fix b/changelog.d/admin-fe-package-url.fix new file mode 100644 index 000000000..d4ab5a8f5 --- /dev/null +++ b/changelog.d/admin-fe-package-url.fix @@ -0,0 +1 @@ +Fix Admin-FE installation by downloading builds from the package registry instead of GitLab job artifacts. diff --git a/config/config.exs b/config/config.exs index e2c110689..c4c29da82 100644 --- a/config/config.exs +++ b/config/config.exs @@ -802,7 +802,7 @@ config :pleroma, :frontends, "name" => "admin-fe", "git" => "https://git.pleroma.social/pleroma/admin-fe", "build_url" => - "https://git.pleroma.social/pleroma/admin-fe/-/jobs/artifacts/${ref}/download?job=build", + "https://git.pleroma.social/api/packages/pleroma/generic/admin-fe-builds/${ref}/latest.zip", "ref" => "develop" }, "soapbox" => %{ diff --git a/docs/administration/CLI_tasks/frontend.md b/docs/administration/CLI_tasks/frontend.md index 4e9d9eecb..6350c1f4e 100644 --- a/docs/administration/CLI_tasks/frontend.md +++ b/docs/administration/CLI_tasks/frontend.md @@ -76,6 +76,28 @@ The resulting frontend will always be installed into a folder of this template: Careful: This folder will be completely replaced on installation. +## Installing Admin-FE + +Install the latest published `develop` build using the configured package URL: + +=== "OTP" + + ```sh + ./bin/pleroma_ctl frontend install admin-fe --ref develop + # Or pin a release (replace with its exact tag): + ./bin/pleroma_ctl frontend install admin-fe --ref + ``` + +=== "From Source" + + ```sh + mix pleroma.frontend install admin-fe --ref develop + # Or pin a release (replace with its exact tag): + mix pleroma.frontend install admin-fe --ref + ``` + +Use `--ref stable` for the latest published stable branch build, or replace `develop` with an exact published release tag to pin a version. The ref selects the package version in `https://git.pleroma.social/api/packages/pleroma/generic/admin-fe-builds/${ref}/latest.zip`; it must have a published package. The archive's `dist/` directory matches the default build directory, so no `--build-url` or `--build-dir` override is needed. + ## Example installation for an unknown frontend The installation process is the same, but you will have to give all the needed options on the command line. For example: diff --git a/docs/administration/frontends-management.md b/docs/administration/frontends-management.md index f982c4bca..44a0b82a0 100644 --- a/docs/administration/frontends-management.md +++ b/docs/administration/frontends-management.md @@ -56,7 +56,7 @@ Due to aforementioned bug, preferred way of installing frontends in AdminFE is b ![screenshot of admin-fe with instructions on how to install a frontend](../assets/way_to_install_frontends.png) and filling in the fields. Unfortunately AdminFE does not provide the raw data necessary for you to fill those fields, so your best bet is to see what backend returns in browser's devtools or refer to the [source code](https://git.pleroma.social/pleroma/pleroma/-/blob/develop/config/config.exs?ref_type=heads#L742-791). For the most part, only **Name**, **Ref** (i.e. version) and **Build URL** fields are required, although some frontends might also require **Build Directory** to work. -For pleroma-fe you can use either `master` or `develop` refs, or potentially any ref in GitLab that has artifacts for `build` job, but that's outside scope of this document. +Pleroma-FE and Admin-FE builds are downloaded from the generic package registry rather than GitLab job artifacts. For Admin-FE, set **Name** to `admin-fe` and **Build URL** to `https://git.pleroma.social/api/packages/pleroma/generic/admin-fe-builds/${ref}/latest.zip`. Set **Ref** to `develop` or `stable` for the latest published build of that branch, or to an exact published release tag to pin a version. Only refs with a published package are installable; an arbitrary Git ref is not enough. The archive contains a `dist/` directory, so use `dist` as **Build Directory** (the backend default). ### Selecting default frontend diff --git a/test/pleroma/frontend_test.exs b/test/pleroma/frontend_test.exs index 22e0ffb9a..47856b005 100644 --- a/test/pleroma/frontend_test.exs +++ b/test/pleroma/frontend_test.exs @@ -17,6 +17,11 @@ defmodule Pleroma.FrontendTest do end) end + test "admin-fe uses package builds" do + assert Pleroma.Config.get([:frontends, :available, "admin-fe", "build_url"]) == + "https://git.pleroma.social/api/packages/pleroma/generic/admin-fe-builds/${ref}/latest.zip" + end + test "it downloads and unzips a known frontend" do clear_config([:frontends, :available], %{ "pleroma" => %{