little changes for MRF config descriptions
authorAlexander Strizhakov <alex.strizhakov@gmail.com>
Wed, 11 Nov 2020 15:49:15 +0000 (18:49 +0300)
committerAlexander Strizhakov <alex.strizhakov@gmail.com>
Wed, 11 Nov 2020 15:49:15 +0000 (18:49 +0300)
- log level reduction, if policy doesn't implement config_description method
- docs in dev.md

docs/dev.md
lib/pleroma/web/activity_pub/mrf.ex

index 22e0691f14e35e906bbb4a1a546874e4d0606b77..aa89a941fdfe3e011150a7115f47e372fbc12a2f 100644 (file)
@@ -21,3 +21,26 @@ This document contains notes and guidelines for Pleroma developers.
 ## Auth-related configuration, OAuth consumer mode etc.
 
 See `Authentication` section of [the configuration cheatsheet](configuration/cheatsheet.md#authentication).
+
+## MRF policies descriptions
+
+If MRF policy depends on config, it can be added into MRF tab to adminFE by adding `config_description/0` method, which returns map with special structure.
+
+Example:
+
+```elixir
+%{
+      key: :mrf_activity_expiration,
+      related_policy: "Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicy",
+      label: "MRF Activity Expiration Policy",
+      description: "Adds automatic expiration to all local activities",
+      children: [
+        %{
+          key: :days,
+          type: :integer,
+          description: "Default global expiration time for all local activities (in days)",
+          suggestions: [90, 365]
+        }
+      ]
+    }
+```
index ce125a6969b1b3eea3284c496c1ee40b586bcb86..6e73b2f22f7e685d1ba12d1b89f2240df6c421d4 100644 (file)
@@ -164,7 +164,7 @@ defmodule Pleroma.Web.ActivityPub.MRF do
           acc
         end
       else
-        Logger.info(
+        Logger.debug(
           "#{policy} is excluded from config descriptions, because does not implement `config_description/0` method."
         )