X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fapplication_requirements.ex;h=a56311a65e623f7352ea5e2013e5646ae306cfef;hb=2e59cdd80f3e3d14c59aeba1fde2f8f9b8305e1f;hp=b977257a388ec40fe0560e770451c067492a077a;hpb=7d5c3883acafc2c84f65f38dd639d4999f14215a;p=akkoma
diff --git a/lib/pleroma/application_requirements.ex b/lib/pleroma/application_requirements.ex
index b977257a3..a56311a65 100644
--- a/lib/pleroma/application_requirements.ex
+++ b/lib/pleroma/application_requirements.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.ApplicationRequirements do
@@ -24,6 +24,7 @@ defmodule Pleroma.ApplicationRequirements do
|> check_migrations_applied!()
|> check_welcome_message_config!()
|> check_rum!()
+ |> check_repo_pool_size!()
|> handle_result()
end
@@ -33,15 +34,16 @@ defmodule Pleroma.ApplicationRequirements do
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
- """)
+ Logger.warn("""
+ To send welcome emails, you need to enable the mailer.
+ Welcome emails will NOT be sent with the current config.
- {:error, "The mail disabled."}
- else
- :ok
+ Enable the mailer:
+ config :pleroma, Pleroma.Emails.Mailer, enabled: true
+ """)
end
+
+ :ok
end
defp check_welcome_message_config!(result), do: result
@@ -50,18 +52,21 @@ defmodule Pleroma.ApplicationRequirements do
#
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.\n" <>
- "Please set config :pleroma, :instance, account_activation_required: false\n" <>
- "Otherwise setup and enable Mailer."
- )
+ not Pleroma.Emails.Mailer.enabled?() do
+ Logger.warn("""
+ Account activation is required, but the mailer is disabled.
+ Users will NOT be able to confirm their accounts with this config.
+ Either disable account activation or enable the mailer.
- {:error,
- "Account activation enabled, but Mailer is disabled. Cannot send confirmation emails."}
- else
- :ok
+ Disable account activation:
+ config :pleroma, :instance, account_activation_required: false
+
+ Enable the mailer:
+ config :pleroma, Pleroma.Emails.Mailer, enabled: true
+ """)
end
+
+ :ok
end
def check_confirmation_accounts!(result), do: result
@@ -159,9 +164,12 @@ defmodule Pleroma.ApplicationRequirements do
defp check_system_commands!(:ok) do
filter_commands_statuses = [
- check_filter(Pleroma.Upload.Filters.Exiftool, "exiftool"),
- check_filter(Pleroma.Upload.Filters.Mogrify, "mogrify"),
- check_filter(Pleroma.Upload.Filters.Mogrifun, "mogrify")
+ check_filter(Pleroma.Upload.Filter.Exiftool, "exiftool"),
+ check_filter(Pleroma.Upload.Filter.Mogrify, "mogrify"),
+ check_filter(Pleroma.Upload.Filter.Mogrifun, "mogrify"),
+ check_filter(Pleroma.Upload.Filter.AnalyzeMetadata, "mogrify"),
+ check_filter(Pleroma.Upload.Filter.AnalyzeMetadata, "convert"),
+ check_filter(Pleroma.Upload.Filter.AnalyzeMetadata, "ffprobe")
]
preview_proxy_commands_status =
@@ -188,6 +196,30 @@ defmodule Pleroma.ApplicationRequirements do
defp check_system_commands!(result), do: result
+ defp check_repo_pool_size!(:ok) do
+ if Pleroma.Config.get([Pleroma.Repo, :pool_size], 10) != 10 and
+ not Pleroma.Config.get([:dangerzone, :override_repo_pool_size], false) do
+ Logger.error("""
+ !!!CONFIG WARNING!!!
+
+ The database pool size has been altered from the recommended value of 10.
+
+ Please revert or ensure your database is tuned appropriately and then set
+ `config :pleroma, :dangerzone, override_repo_pool_size: true`.
+
+ If you are experiencing database timeouts, please check the "Optimizing
+ your PostgreSQL performance" section in the documentation. If you still
+ encounter issues after that, please open an issue on the tracker.
+ """)
+
+ {:error, "Repo.pool_size different than recommended value."}
+ else
+ :ok
+ end
+ end
+
+ defp check_repo_pool_size!(result), do: result
+
defp check_filter(filter, command_required) do
filters = Config.get([Pleroma.Upload, :filters])