X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fapplication_requirements.ex;h=16f62b6f5d43e00caa18e612479f66e82bffcaae;hb=da3f9b9988d2cee4baa6018e6450b2d6027e1ce3;hp=b4d8ff23bd09e7359e0ee9125e2a9173df943574;hpb=7991ddad582537f34b4964125195961e596b8687;p=akkoma diff --git a/lib/pleroma/application_requirements.ex b/lib/pleroma/application_requirements.ex index b4d8ff23b..16f62b6f5 100644 --- a/lib/pleroma/application_requirements.ex +++ b/lib/pleroma/application_requirements.ex @@ -16,6 +16,7 @@ defmodule Pleroma.ApplicationRequirements do @spec verify!() :: :ok | VerifyError.t() def verify! do :ok + |> check_confirmation_accounts! |> check_migrations_applied!() |> check_welcome_message_config!() |> check_rum!() @@ -41,6 +42,24 @@ defmodule Pleroma.ApplicationRequirements do defp check_welcome_message_config!(result), do: result + # Checks account confirmation email + # + def check_confirmation_accounts!(:ok) do + if Pleroma.Config.get([:instance, :account_activation_required]) && + not Pleroma.Config.get([Pleroma.Emails.Mailer, :enabled]) do + Logger.error( + "Account activation enabled, but no Mailer settings enabled.\nPlease set config :pleroma, :instance, account_activation_required: false\nOtherwise setup and enable Mailer." + ) + + {:error, + "Account activation enabled, but Mailer is disabled. Cannot send confirmation emails."} + else + :ok + end + end + + def check_confirmation_accounts!(result), do: result + # Checks for pending migrations. # def check_migrations_applied!(:ok) do