Merge branch 'feature/mrf-vocabulary' into 'develop'
authorrinpatch <rinpatch@sdf.org>
Tue, 13 Aug 2019 22:51:15 +0000 (22:51 +0000)
committerrinpatch <rinpatch@sdf.org>
Tue, 13 Aug 2019 22:51:15 +0000 (22:51 +0000)
MRF Vocabulary

See merge request pleroma/pleroma!1559

1  2 
CHANGELOG.md
config/config.exs
docs/config.md

diff --combined CHANGELOG.md
index f0783d48970f1cfc59ed6b3db2084c08b9221733,d998a405066f4bed76a1905c0cea2771dc1dcaef..7548a546a4ac9773214b0fb7280076ad23fb3c56
@@@ -47,6 -47,7 +47,7 @@@ The format is based on [Keep a Changelo
  - MRF: Support for priming the mediaproxy cache (`Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy`)
  - MRF: Support for excluding specific domains from Transparency.
  - MRF: Support for filtering posts based on who they mention (`Pleroma.Web.ActivityPub.MRF.MentionPolicy`)
+ - MRF: Support for filtering posts based on ActivityStreams vocabulary (`Pleroma.Web.ActivityPub.MRF.VocabularyPolicy`)
  - MRF (Simple Policy): Support for wildcard domains.
  - Support for wildcard domains in user domain blocks setting.
  - Configuration: `quarantined_instances` support wildcard domains.
@@@ -69,7 -70,6 +70,7 @@@
  - Added synchronization of following/followers counters for external users
  - Configuration: `enabled` option for `Pleroma.Emails.Mailer`, defaulting to `false`.
  - Configuration: Pleroma.Plugs.RateLimiter `bucket_name`, `params` options.
 +- Configuration: `user_bio_length` and `user_name_length` options.
  - Addressable lists
  - Twitter API: added rate limit for `/api/account/password_reset` endpoint.
  - ActivityPub: Add an internal service actor for fetching ActivityPub objects.
diff --combined config/config.exs
index b7047a039afb06a63c639f265a20dc28a0a40b65,17799af59a118a8a62ac34c1475dd78a2d879381..75866112058d1a61f1cd5ab1e54f0e11b02281e4
@@@ -253,8 -253,6 +253,8 @@@ config :pleroma, :instance
    skip_thread_containment: true,
    limit_to_local_content: :unauthenticated,
    dynamic_configuration: false,
 +  user_bio_length: 5000,
 +  user_name_length: 100,
    external_user_synchronization: true
  
  config :pleroma, :markup,
@@@ -338,6 -336,10 +338,10 @@@ config :pleroma, :mrf_keyword
  
  config :pleroma, :mrf_subchain, match_actor: %{}
  
+ config :pleroma, :mrf_vocabulary,
+   accept: [],
+   reject: []
  config :pleroma, :rich_media,
    enabled: true,
    ignore_hosts: [],
diff --combined docs/config.md
index e5c3f08faedad5bfe7a413fa3a7438eea44dfe9d,d1fa501ead4fdea31d2d82c8962f4c4aa8955ada..20311db541a75dfc9edb53f8ccd8125550dff29a
@@@ -103,6 -103,7 +103,7 @@@ config :pleroma, Pleroma.Emails.Mailer
    * `Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicy`: Rejects posts from likely spambots by rejecting posts from new users that contain links.
    * `Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy`: Crawls attachments using their MediaProxy URLs so that the MediaProxy cache is primed.
    * `Pleroma.Web.ActivityPub.MRF.MentionPolicy`: Drops posts mentioning configurable users. (see `:mrf_mention` section)
+   * `Pleroma.Web.ActivityPub.MRF.VocabularyPolicy`: Restricts activities to a configured set of vocabulary. (see `:mrf_vocabulary` section)
  * `public`: Makes the client API in authentificated mode-only except for user-profiles. Useful for disabling the Local Timeline and The Whole Known Network.
  * `quarantined_instances`: List of ActivityPub instances where private(DMs, followers-only) activities will not be send.
  * `managed_config`: Whenether the config for pleroma-fe is configured in this config or in ``static/config.json``
  * `safe_dm_mentions`: If set to true, only mentions at the beginning of a post will be used to address people in direct messages. This is to prevent accidental mentioning of people when talking about them (e.g. "@friend hey i really don't like @enemy"). Default: `false`.
  * `healthcheck`: If set to true, system data will be shown on ``/api/pleroma/healthcheck``.
  * `remote_post_retention_days`: The default amount of days to retain remote posts when pruning the database.
 +* `user_bio_length`: A user bio maximum length (default: `5000`)
 +* `user_name_length`: A user name maximum length (default: `100`)
  * `skip_thread_containment`: Skip filter out broken threads. The default is `false`.
  * `limit_to_local_content`: Limit unauthenticated users to search for local statutes and users only. Possible values: `:unauthenticated`, `:all` and `false`. The default is `:unauthenticated`.
  * `dynamic_configuration`: Allow transferring configuration to DB with the subsequent customization from Admin api.
@@@ -278,6 -277,10 +279,10 @@@ config :pleroma, :mrf_subchain
  ## :mrf_mention
  * `actors`: A list of actors, for which to drop any posts mentioning.
  
+ ## :mrf_vocabulary
+ * `accept`: A list of ActivityStreams terms to accept.  If empty, all supported messages are accepted.
+ * `reject`: A list of ActivityStreams terms to reject.  If empty, no messages are rejected.
  ## :media_proxy
  * `enabled`: Enables proxying of remote media to the instance’s proxy
  * `base_url`: The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host/CDN fronts.