Add `account_approval_required` instance setting
authorAlex Gleason <alex@alexgleason.me>
Mon, 13 Jul 2020 01:14:57 +0000 (20:14 -0500)
committerAlex Gleason <alex@alexgleason.me>
Mon, 13 Jul 2020 01:27:58 +0000 (20:27 -0500)
config/config.exs
config/description.exs
docs/configuration/cheatsheet.md
lib/pleroma/web/mastodon_api/views/instance_view.ex
test/web/mastodon_api/controllers/instance_controller_test.exs

index 6fc84efc2abae11b90bc31620b1f93b93435f185..791740663db1b0b87698812dc7a9dae499ac8eea 100644 (file)
@@ -205,6 +205,7 @@ config :pleroma, :instance,
   registrations_open: true,
   invites_enabled: false,
   account_activation_required: false,
+  account_approval_required: false,
   federating: true,
   federation_incoming_replies_max_depth: 100,
   federation_reachability_timeout_days: 7,
index b0cc8d527525be63040448659eef58f18dc7957c..e57379dee8c9f74a15675db3a0010ba80d5e6bb6 100644 (file)
@@ -665,6 +665,11 @@ config :pleroma, :config_description, [
         type: :boolean,
         description: "Require users to confirm their emails before signing in"
       },
+      %{
+        key: :account_approval_required,
+        type: :boolean,
+        description: "Require users to be manually approved by an admin before signing in"
+      },
       %{
         key: :federating,
         type: :boolean,
index f796330f1080b10ee80fbaa3c9a9684ab5477ee5..94389152eaa17269fd26a75f62c6f89bac09be03 100644 (file)
@@ -33,6 +33,7 @@ To add configuration to your config file, you can copy it from the base config.
 * `registrations_open`: Enable registrations for anyone, invitations can be enabled when false.
 * `invites_enabled`: Enable user invitations for admins (depends on `registrations_open: false`).
 * `account_activation_required`: Require users to confirm their emails before signing in.
+* `account_approval_required`: Require users to be manually approved by an admin before signing in.
 * `federating`: Enable federation with other instances.
 * `federation_incoming_replies_max_depth`: Max. depth of reply-to activities fetching on incoming federation, to prevent out-of-memory situations while fetching very long threads. If set to `nil`, threads of any depth will be fetched. Lower this value if you experience out-of-memory crashes.
 * `federation_reachability_timeout_days`: Timeout (in days) of each external federation target being unreachable prior to pausing federating to it.
index 5deb0d7ed60ba4f71edfdf49a97e1dbb7a7fad98..243067a7352c1353d2a854accb9585e5f3b8bd33 100644 (file)
@@ -39,6 +39,7 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do
       pleroma: %{
         metadata: %{
           account_activation_required: Keyword.get(instance, :account_activation_required),
+          account_approval_required: Keyword.get(instance, :account_approval_required),
           features: features(),
           federation: federation(),
           fields_limits: fields_limits()
index cc880d82ca4ab814e73cb04debee6d128bf04b65..8a41832836779d844623140b38cbbaaf9f340f1d 100644 (file)
@@ -38,6 +38,7 @@ defmodule Pleroma.Web.MastodonAPI.InstanceControllerTest do
            } = result
 
     assert result["pleroma"]["metadata"]["account_activation_required"] != nil
+    assert result["pleroma"]["metadata"]["account_approval_required"] != nil
     assert result["pleroma"]["metadata"]["features"]
     assert result["pleroma"]["metadata"]["federation"]
     assert result["pleroma"]["metadata"]["fields_limits"]