Add `account_approval_required` instance setting

This commit is contained in:
Alex Gleason 2020-07-12 20:14:57 -05:00
parent a62f17da17
commit 51ab8d0128
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
5 changed files with 9 additions and 0 deletions

View File

@ -205,6 +205,7 @@
registrations_open: true, registrations_open: true,
invites_enabled: false, invites_enabled: false,
account_activation_required: false, account_activation_required: false,
account_approval_required: false,
federating: true, federating: true,
federation_incoming_replies_max_depth: 100, federation_incoming_replies_max_depth: 100,
federation_reachability_timeout_days: 7, federation_reachability_timeout_days: 7,

View File

@ -665,6 +665,11 @@
type: :boolean, type: :boolean,
description: "Require users to confirm their emails before signing in" 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, key: :federating,
type: :boolean, type: :boolean,

View 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. * `registrations_open`: Enable registrations for anyone, invitations can be enabled when false.
* `invites_enabled`: Enable user invitations for admins (depends on `registrations_open: 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_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. * `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_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. * `federation_reachability_timeout_days`: Timeout (in days) of each external federation target being unreachable prior to pausing federating to it.

View File

@ -39,6 +39,7 @@ def render("show.json", _) do
pleroma: %{ pleroma: %{
metadata: %{ metadata: %{
account_activation_required: Keyword.get(instance, :account_activation_required), account_activation_required: Keyword.get(instance, :account_activation_required),
account_approval_required: Keyword.get(instance, :account_approval_required),
features: features(), features: features(),
federation: federation(), federation: federation(),
fields_limits: fields_limits() fields_limits: fields_limits()

View File

@ -38,6 +38,7 @@ test "get instance information", %{conn: conn} do
} = result } = result
assert result["pleroma"]["metadata"]["account_activation_required"] != nil 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"]["features"]
assert result["pleroma"]["metadata"]["federation"] assert result["pleroma"]["metadata"]["federation"]
assert result["pleroma"]["metadata"]["fields_limits"] assert result["pleroma"]["metadata"]["fields_limits"]