X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fmix%2Ftasks%2Fpleroma%2Frelay.ex;h=c6ca888d4c65e1ab1afff5ae776b368bdeec2fe4;hb=05da5f5cca00c8b061858ff85e4a4640f3d91cb6;hp=83ed0ed02b6013827bd93da97e47ceb1240b18ea;hpb=ffb4eb9779ddd28ecee84c06e8dc58f4a4daaa38;p=akkoma diff --git a/lib/mix/tasks/pleroma/relay.ex b/lib/mix/tasks/pleroma/relay.ex index 83ed0ed02..c6ca888d4 100644 --- a/lib/mix/tasks/pleroma/relay.ex +++ b/lib/mix/tasks/pleroma/relay.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2018 Pleroma Authors +# Copyright © 2017-2020 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.Relay do @@ -8,21 +8,8 @@ defmodule Mix.Tasks.Pleroma.Relay do alias Pleroma.Web.ActivityPub.Relay @shortdoc "Manages remote relays" - @moduledoc """ - Manages remote relays + @moduledoc File.read!("docs/administration/CLI_tasks/relay.md") - ## Follow a remote relay - - ``mix pleroma.relay follow `` - - Example: ``mix pleroma.relay follow https://example.org/relay`` - - ## Unfollow a remote relay - - ``mix pleroma.relay unfollow `` - - Example: ``mix pleroma.relay unfollow https://example.org/relay`` - """ def run(["follow", target]) do start_pleroma() @@ -44,4 +31,14 @@ defmodule Mix.Tasks.Pleroma.Relay do {:error, e} -> shell_error("Error while following #{target}: #{inspect(e)}") end end + + def run(["list"]) do + start_pleroma() + + with {:ok, list} <- Relay.list() do + list |> Enum.each(&shell_info(&1)) + else + {:error, e} -> shell_error("Error while fetching relay subscription list: #{inspect(e)}") + end + end end