added warning to use old keys
This commit is contained in:
parent
db0224d174
commit
7991ddad58
5 changed files with 51 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ defmodule Pleroma.ApplicationRequirements do
|
|||
def verify! do
|
||||
:ok
|
||||
|> check_migrations_applied!()
|
||||
|> check_welcome_message_config!()
|
||||
|> check_rum!()
|
||||
|> handle_result()
|
||||
end
|
||||
|
|
@ -24,6 +25,22 @@ defmodule Pleroma.ApplicationRequirements do
|
|||
defp handle_result(:ok), do: :ok
|
||||
defp handle_result({:error, message}), do: raise(VerifyError, message: message)
|
||||
|
||||
defp check_welcome_message_config!(:ok) do
|
||||
if Pleroma.Config.get([:welcome, :email, :enabled], false) and
|
||||
not Pleroma.Emails.Mailer.enabled?() do
|
||||
Logger.error("""
|
||||
To send welcome email do you need to enable mail.
|
||||
\nconfig :pleroma, Pleroma.Emails.Mailer, enabled: true
|
||||
""")
|
||||
|
||||
{:error, "The mail disabled."}
|
||||
else
|
||||
:ok
|
||||
end
|
||||
end
|
||||
|
||||
defp check_welcome_message_config!(result), do: result
|
||||
|
||||
# Checks for pending migrations.
|
||||
#
|
||||
def check_migrations_applied!(:ok) do
|
||||
|
|
|
|||
|
|
@ -55,6 +55,24 @@ defmodule Pleroma.Config.DeprecationWarnings do
|
|||
mrf_user_allowlist()
|
||||
check_old_mrf_config()
|
||||
check_media_proxy_whitelist_config()
|
||||
check_welcome_message_config()
|
||||
end
|
||||
|
||||
def check_welcome_message_config do
|
||||
instance_config = Pleroma.Config.get([:instance])
|
||||
|
||||
use_old_config =
|
||||
Keyword.has_key?(instance_config, :welcome_user_nickname) or
|
||||
Keyword.has_key?(instance_config, :welcome_message)
|
||||
|
||||
if use_old_config do
|
||||
Logger.error("""
|
||||
!!!DEPRECATION WARNING!!!
|
||||
Your config is using old namespaces for Welcome messages configuration. You are need to change to new namespaces:
|
||||
\n* `config :pleroma, :instance, welcome_user_nickname` is now `config :pleroma, :welcome, :direct_message, :sender_nickname`
|
||||
\n* `config :pleroma, :instance, welcome_message` is now `config :pleroma, :welcome, :direct_message, :message`
|
||||
""")
|
||||
end
|
||||
end
|
||||
|
||||
def check_old_mrf_config do
|
||||
|
|
|
|||
|
|
@ -737,6 +737,7 @@ defmodule Pleroma.User do
|
|||
{:ok, :noop}
|
||||
end
|
||||
end
|
||||
|
||||
def send_welcome_email(_), do: {:ok, :noop}
|
||||
|
||||
def try_send_confirmation_email(%User{} = user) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue