Refactor Mix tasks
1. Move Mix tasks into a `pleroma` namespace, to avoid collisions with dependent packages. 2. Rename and condense tasks into two `pleroma.user` and `pleroma.gen.instance` tasks for consistency with Hex and Phoenix. 3. 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 to `pleroma.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. 4. Documentation has been added to both tasks such that `mix help` now shows useful information. 5. Finally, use of IO.puts in tasks has been replaced 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.
This commit is contained in:
parent
e416469a40
commit
8a1dc0de92
13 changed files with 385 additions and 215 deletions
30
lib/mix/tasks/pleroma/sample_config.eex
Normal file
30
lib/mix/tasks/pleroma/sample_config.eex
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# Pleroma instance configuration
|
||||
|
||||
# NOTE: This file should not be committed to a repo or otherwise made public
|
||||
# without removing sensitive information.
|
||||
|
||||
use Mix.Config
|
||||
|
||||
config :pleroma, Pleroma.Web.Endpoint,
|
||||
url: [host: "<%= domain %>", scheme: "https", port: 443],
|
||||
secret_key_base: "<%= secret %>"
|
||||
|
||||
config :pleroma, :instance,
|
||||
name: "<%= name %>",
|
||||
email: "<%= email %>",
|
||||
limit: 5000,
|
||||
registrations_open: true,
|
||||
dedupe_media: false
|
||||
|
||||
config :pleroma, :media_proxy,
|
||||
enabled: false,
|
||||
redirect_on_failure: true
|
||||
#base_url: "https://cache.pleroma.social"
|
||||
|
||||
config :pleroma, Pleroma.Repo,
|
||||
adapter: Ecto.Adapters.Postgres,
|
||||
username: "<%= dbuser %>",
|
||||
password: "<%= dbpass %>",
|
||||
database: "<%= dbname %>",
|
||||
hostname: "<%= dbhost %>",
|
||||
pool_size: 10
|
||||
Loading…
Add table
Add a link
Reference in a new issue