diff options
author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2019-06-18 01:57:32 +0000 |
---|---|---|
committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2019-06-18 01:57:32 +0000 |
commit | 3d76420512111006f678f820d1a20f866b07bdb9 (patch) | |
tree | 6459ace72932a9e716ff086183d22639f31941e5 | |
parent | 49a49d376341262032c3d1e5d037dca9554a7b4a (diff) | |
parent | 448d739b259b3fe2e7c6ff2d2f41b93d53dd01b3 (diff) | |
download | pleroma-3d76420512111006f678f820d1a20f866b07bdb9.tar.gz pleroma-3d76420512111006f678f820d1a20f866b07bdb9.zip |
Merge branch 'feature/pleroma-ctl-rpc' into 'develop'
pleroma_ctl: Run mix tasks using rpc instead of eval
See merge request pleroma/pleroma!1297
-rwxr-xr-x | rel/pleroma_ctl | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/rel/pleroma_ctl b/rel/pleroma_ctl index 2e709a8a6..ac7339762 100755 --- a/rel/pleroma_ctl +++ b/rel/pleroma_ctl @@ -1,7 +1,7 @@ #!/bin/sh # XXX: This should be removed when elixir's releases get custom command support if [ -z "$1" ] || [ "$1" = "help" ]; then - echo "Usage: $(basename "$0") COMMAND [ARGS] + echo "Usage: $(basename "$0") COMMAND [ARGS] The known commands are: @@ -11,9 +11,16 @@ if [ -z "$1" ] || [ "$1" = "help" ]; then and any mix tasks under Pleroma namespace, for example \`mix pleroma.user COMMAND\` is equivalent to \`$(basename "$0") user COMMAND\` + + By default pleroma_ctl will try calling into a running instance to execute non migration-related commands, + if for some reason this is undesired, set PLEROMA_CTL_RPC_DISABLED environment variable " else - SCRIPT=$(readlink -f "$0") - SCRIPTPATH=$(dirname "$SCRIPT") - "$SCRIPTPATH"/pleroma eval 'Pleroma.ReleaseTasks.run("'"$*"'")' + SCRIPT=$(readlink -f "$0") + SCRIPTPATH=$(dirname "$SCRIPT") + if [ "$1" = "migrate" ] || [ "$1" = "rollback" ] || [ "$1" = "create" ] || [ -n "$PLEROMA_CTL_RPC_DISABLED" ]; then + "$SCRIPTPATH"/pleroma eval 'Pleroma.ReleaseTasks.run("'"$*"'")' + else + "$SCRIPTPATH"/pleroma rpc 'Pleroma.ReleaseTasks.run("'"$*"'")' + fi fi |