Refactor/mix tasks
While working on making Pleroma available as a Hex package, I did some refactoring of Pleroma's Mix tasks:
-
Move Mix tasks into a
pleroma
namespace, to avoid collisions with dependent packages. -
Rename and condense tasks into two
pleroma.user
andpleroma.gen.instance
tasks for consistency with Hex and Phoenix. -
Add additional functionality to the tasks to make them more user-friendly. Arguments with sensible defaults were demoted to flags and in the interactive
generate_config
(renamed topleroma.gen.instance
), flags were added to allow non-interactive use, though interactive use remains the primary interface. That task also now prompts the user for database parameters. -
Add documentation to both tasks such that
mix help
now shows useful information. -
Replace use of IO.puts in tasks with Mix.shell() equivalents to make the behavior more consistent with Mix tasks in other packages, and such that variables like MIX_QUIET are respected. The only exception is in
mix pleroma.user reset_password
, wherein the URL must always be printed regardless of the value of MIX_QUIET since that's its entire purpose. -
Update the readme to reflect these changes.
Also, if this MR is accepted, the wiki will have to be updated, which I'm willing to do as well, except for the Japanese version as I don't know Japanese.