From 9d56f2717ca9176513722ce6601b7d30c7871c44 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Sat, 10 Jul 2021 19:08:16 +0300 Subject: [PATCH] Update types in mrf config description --- lib/pleroma/web/activity_pub/mrf.ex | 4 ++-- lib/pleroma/web/activity_pub/mrf/keyword_policy.ex | 6 +++--- lib/pleroma/web/activity_pub/mrf/mention_policy.ex | 2 +- lib/pleroma/web/activity_pub/mrf/normalize_markup.ex | 2 +- .../web/activity_pub/mrf/object_age_policy.ex | 2 +- lib/pleroma/web/activity_pub/mrf/simple_policy.ex | 20 ++++++++++---------- lib/pleroma/web/activity_pub/mrf/subchain_policy.ex | 2 +- .../web/activity_pub/mrf/vocabulary_policy.ex | 4 ++-- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/pleroma/web/activity_pub/mrf.ex b/lib/pleroma/web/activity_pub/mrf.ex index ef5a09a93..b08260a40 100644 --- a/lib/pleroma/web/activity_pub/mrf.ex +++ b/lib/pleroma/web/activity_pub/mrf.ex @@ -18,7 +18,7 @@ defmodule Pleroma.Web.ActivityPub.MRF do children: [ %{ key: :policies, - type: [:module, {:list, :module}], + type: {:multiple_select, :reduced_labels}, description: "A list of MRF policies enabled. Module names are shortened (removed leading `Pleroma.Web.ActivityPub.MRF.` part), but on adding custom module you need to use full name.", suggestions: {:list_behaviour_implementations, Pleroma.Web.ActivityPub.MRF} @@ -33,7 +33,7 @@ defmodule Pleroma.Web.ActivityPub.MRF do %{ key: :transparency_exclusions, label: "MRF transparency exclusions", - type: {:list, :string}, + type: :multiple_select, description: "Exclude specific instance names from MRF transparency. The use of the exclusions feature will be disclosed in nodeinfo as a boolean value.", suggestions: [ diff --git a/lib/pleroma/web/activity_pub/mrf/keyword_policy.ex b/lib/pleroma/web/activity_pub/mrf/keyword_policy.ex index f91b51bcf..b6c0acb41 100644 --- a/lib/pleroma/web/activity_pub/mrf/keyword_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/keyword_policy.ex @@ -138,7 +138,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.KeywordPolicy do children: [ %{ key: :reject, - type: {:list, :string}, + type: :multiple_select, description: """ A list of patterns which result in message being rejected. @@ -148,7 +148,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.KeywordPolicy do }, %{ key: :federated_timeline_removal, - type: {:list, :string}, + type: :multiple_select, description: """ A list of patterns which result in message being removed from federated timelines (a.k.a unlisted). @@ -158,7 +158,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.KeywordPolicy do }, %{ key: :replace, - type: {:list, :tuple}, + type: {:keyword, :string}, description: """ **Pattern**: a string or [Regex](https://hexdocs.pm/elixir/Regex.html) in the format of `~r/PATTERN/`. diff --git a/lib/pleroma/web/activity_pub/mrf/mention_policy.ex b/lib/pleroma/web/activity_pub/mrf/mention_policy.ex index 877277d4f..b749a9232 100644 --- a/lib/pleroma/web/activity_pub/mrf/mention_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/mention_policy.ex @@ -36,7 +36,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.MentionPolicy do children: [ %{ key: :actors, - type: {:list, :string}, + type: :multiple_select, description: "A list of actors for which any post mentioning them will be dropped", suggestions: ["actor1", "actor2"] } diff --git a/lib/pleroma/web/activity_pub/mrf/normalize_markup.ex b/lib/pleroma/web/activity_pub/mrf/normalize_markup.ex index 2ad3fde0b..033035ab8 100644 --- a/lib/pleroma/web/activity_pub/mrf/normalize_markup.ex +++ b/lib/pleroma/web/activity_pub/mrf/normalize_markup.ex @@ -36,7 +36,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.NormalizeMarkup do children: [ %{ key: :scrub_policy, - type: :module, + type: :select, suggestions: [Pleroma.HTML.Scrubber.Default] } ] diff --git a/lib/pleroma/web/activity_pub/mrf/object_age_policy.ex b/lib/pleroma/web/activity_pub/mrf/object_age_policy.ex index aac24c0ec..67f662d81 100644 --- a/lib/pleroma/web/activity_pub/mrf/object_age_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/object_age_policy.ex @@ -124,7 +124,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.ObjectAgePolicy do }, %{ key: :actions, - type: {:list, :atom}, + type: :multiple_select, description: "A list of actions to apply to the post. `:delist` removes the post from public timelines; " <> "`:strip_followers` removes followers from the ActivityPub recipient list ensuring they won't be delivered to home timelines; " <> diff --git a/lib/pleroma/web/activity_pub/mrf/simple_policy.ex b/lib/pleroma/web/activity_pub/mrf/simple_policy.ex index bb3838d2c..2a1832d5f 100644 --- a/lib/pleroma/web/activity_pub/mrf/simple_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/simple_policy.ex @@ -255,63 +255,63 @@ defmodule Pleroma.Web.ActivityPub.MRF.SimplePolicy do children: [ %{ key: :media_removal, - type: {:list, :string}, + type: :multiple_select, description: "List of instances to strip media attachments from", suggestions: ["example.com", "*.example.com"] }, %{ key: :media_nsfw, label: "Media NSFW", - type: {:list, :string}, + type: :multiple_select, description: "List of instances to tag all media as NSFW (sensitive) from", suggestions: ["example.com", "*.example.com"] }, %{ key: :federated_timeline_removal, - type: {:list, :string}, + type: :multiple_select, description: "List of instances to remove from the Federated (aka The Whole Known Network) Timeline", suggestions: ["example.com", "*.example.com"] }, %{ key: :reject, - type: {:list, :string}, + type: :multiple_select, description: "List of instances to reject activities from (except deletes)", suggestions: ["example.com", "*.example.com"] }, %{ key: :accept, - type: {:list, :string}, + type: :multiple_select, description: "List of instances to only accept activities from (except deletes)", suggestions: ["example.com", "*.example.com"] }, %{ key: :followers_only, - type: {:list, :string}, + type: :multiple_select, description: "Force posts from the given instances to be visible by followers only", suggestions: ["example.com", "*.example.com"] }, %{ key: :report_removal, - type: {:list, :string}, + type: :multiple_select, description: "List of instances to reject reports from", suggestions: ["example.com", "*.example.com"] }, %{ key: :avatar_removal, - type: {:list, :string}, + type: :multiple_select, description: "List of instances to strip avatars from", suggestions: ["example.com", "*.example.com"] }, %{ key: :banner_removal, - type: {:list, :string}, + type: :multiple_select, description: "List of instances to strip banners from", suggestions: ["example.com", "*.example.com"] }, %{ key: :reject_deletes, - type: {:list, :string}, + type: :multiple_select, description: "List of instances to reject deletions from", suggestions: ["example.com", "*.example.com"] } diff --git a/lib/pleroma/web/activity_pub/mrf/subchain_policy.ex b/lib/pleroma/web/activity_pub/mrf/subchain_policy.ex index 86965d47b..73c4d8fd9 100644 --- a/lib/pleroma/web/activity_pub/mrf/subchain_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/subchain_policy.ex @@ -52,7 +52,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.SubchainPolicy do children: [ %{ key: :match_actor, - type: {:map, {:list, :string}}, + type: {:map, :multiple_select}, description: "Matches a series of regular expressions against the actor field", suggestions: [ %{ diff --git a/lib/pleroma/web/activity_pub/mrf/vocabulary_policy.ex b/lib/pleroma/web/activity_pub/mrf/vocabulary_policy.ex index ce559a239..f2efcfd3d 100644 --- a/lib/pleroma/web/activity_pub/mrf/vocabulary_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/vocabulary_policy.ex @@ -51,14 +51,14 @@ defmodule Pleroma.Web.ActivityPub.MRF.VocabularyPolicy do children: [ %{ key: :accept, - type: {:list, :string}, + type: :multiple_select, description: "A list of ActivityStreams terms to accept. If empty, all supported messages are accepted.", suggestions: ["Create", "Follow", "Mention", "Announce", "Like"] }, %{ key: :reject, - type: {:list, :string}, + type: :multiple_select, description: "A list of ActivityStreams terms to reject. If empty, no messages are rejected.", suggestions: ["Create", "Follow", "Mention", "Announce", "Like"]