config: allow relaying to be disabled
authorWilliam Pitcock <nenolod@dereferenced.org>
Mon, 6 Aug 2018 06:18:15 +0000 (06:18 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Mon, 6 Aug 2018 08:22:10 +0000 (08:22 +0000)
config/config.exs
lib/pleroma/web/router.ex

index 3a730134882ce3192a5a7781eb7ae15369bd59c8..f3102aea3fff8283af482568e61a83183f12d8dd 100644 (file)
@@ -59,6 +59,7 @@ config :pleroma, :instance,
   upload_limit: 16_000_000,
   registrations_open: true,
   federating: true,
+  allow_relay: true,
   rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
   public: true,
   quarantined_instances: []
index 1f9bccf552822c50bb2fcfe8944a790524c060a7..fc9d2d98855468b26df56bb8c24783d769137a90 100644 (file)
@@ -5,6 +5,7 @@ defmodule Pleroma.Web.Router do
 
   @instance Application.get_env(:pleroma, :instance)
   @federating Keyword.get(@instance, :federating)
+  @allow_relay Keyword.get(@instance, :allow_relay)
   @public Keyword.get(@instance, :public)
   @registrations_open Keyword.get(@instance, :registrations_open)
 
@@ -318,10 +319,12 @@ defmodule Pleroma.Web.Router do
   end
 
   if @federating do
-    scope "/", Pleroma.Web.ActivityPub do
-      # XXX: not really ostatus either
-      pipe_through(:ostatus)
-      get("/", ActivityPubController, :relay)
+    if @allow_relay do
+      scope "/", Pleroma.Web.ActivityPub do
+        # XXX: not really ostatus either
+        pipe_through(:ostatus)
+        get("/", ActivityPubController, :relay)
+      end
     end
 
     scope "/", Pleroma.Web.ActivityPub do