1 defmodule Mix.Tasks.Pleroma.Relay do
3 alias Pleroma.Web.ActivityPub.Relay
4 alias Mix.Tasks.Pleroma.Common
6 @shortdoc "Manages remote relays"
10 ## Follow a remote relay
12 ``mix pleroma.relay unfollow <relay_url>``
14 Example: ``mix pleroma.relay follow https://example.org/relay``
16 ## Unfollow a remote relay
18 ``mix pleroma.relay unfollow <relay_url>``
20 Example: ``mix pleroma.relay unfollow https://example.org/relay``
22 def run(["follow", target]) do
24 with {:ok, activity} <- Relay.follow(target) do
25 # put this task to sleep to allow the genserver to push out the messages
28 {:error, e} -> Mix.shell().error("Error while following #{target}: #{inspect(e)}")
32 def run(["unfollow", target]) do
35 with {:ok, activity} <- Relay.follow(target) do
36 # put this task to sleep to allow the genserver to push out the messages
39 {:error, e} -> Mix.shell().error("Error while following #{target}: #{inspect(e)}")