Pleroma crashes too hard when the account activation settings are invalid
A customer just experienced this: https://gitlab.com/tribes-host/tribes/-/issues/68
After enabling account activation (but not entering email details) in AdminFE then restarting the site (through AdminFE), it refused to come back online:
15:23:34.008 [error] Account activation enabled, but no Mailer settings enabled.
Please set config :pleroma, :instance, account_activation_required: false
Otherwise setup and enable Mailer.
15:23:34.010 [info] Application pleroma exited: exited in: Pleroma.Application.start(:normal, [])
** (EXIT) an exception was raised:
** (Pleroma.ApplicationRequirements.VerifyError) Account activation enabled, but Mailer is disabled. Cannot send confirmation emails.
(pleroma 2.1.2) lib/pleroma/application_requirements.ex:27: Pleroma.ApplicationRequirements.handle_result/1
(pleroma 2.1.2) lib/pleroma/application.ex:47: Pleroma.Application.start/2
(kernel 6.5.2.1) application_master.erl:277: :application_master.start_it_old/4
To fix this I had to psql into the database and TRUNCATE TABLE config;
I think Pleroma should just display a warning, and the code should handle an invalid config instead of crashing the whole server on startup. That makes it impossible to recover it from AdminFE.