Add config option to disable federation
Closes #148 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
bcda0fc428
commit
65b49e247f
@ -17,6 +17,8 @@ config :mobilizon, :instance,
|
|||||||
registrations_open: System.get_env("MOBILIZON_INSTANCE_REGISTRATIONS_OPEN") || false,
|
registrations_open: System.get_env("MOBILIZON_INSTANCE_REGISTRATIONS_OPEN") || false,
|
||||||
repository: Mix.Project.config()[:source_url],
|
repository: Mix.Project.config()[:source_url],
|
||||||
allow_relay: true,
|
allow_relay: true,
|
||||||
|
# Federation is to be activated with Mobilizon 1.0.0-beta.2
|
||||||
|
federating: false,
|
||||||
remote_limit: 100_000,
|
remote_limit: 100_000,
|
||||||
upload_limit: 16_000_000,
|
upload_limit: 16_000_000,
|
||||||
avatar_upload_limit: 2_000_000,
|
avatar_upload_limit: 2_000_000,
|
||||||
|
@ -58,14 +58,16 @@ defmodule Mobilizon.Service.ActivityPub.Utils do
|
|||||||
def maybe_federate(%Activity{local: true} = activity) do
|
def maybe_federate(%Activity{local: true} = activity) do
|
||||||
Logger.debug("Maybe federate an activity")
|
Logger.debug("Maybe federate an activity")
|
||||||
|
|
||||||
priority =
|
if Mobilizon.Config.get!([:instance, :federating]) do
|
||||||
case activity.data["type"] do
|
priority =
|
||||||
"Delete" -> 10
|
case activity.data["type"] do
|
||||||
"Create" -> 1
|
"Delete" -> 10
|
||||||
_ -> 5
|
"Create" -> 1
|
||||||
end
|
_ -> 5
|
||||||
|
end
|
||||||
|
|
||||||
Federator.enqueue(:publish, activity, priority)
|
Federator.enqueue(:publish, activity, priority)
|
||||||
|
end
|
||||||
|
|
||||||
:ok
|
:ok
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user