cburschka / cadence

A strophe.js-powered XMPP web client for chatrooms.
6 stars 2 forks source link

Administration command overhaul #411

Closed cburschka closed 8 years ago

cburschka commented 8 years ago

The /admin command (and its xmpp backend) is horrible right now. We hardcode the http://jabber.org/protocol/admin# prefix and the target component, there is no way to discover commands, and a lot of this stuff should be outsourced to a plugin.

The problem here is that there is no user-friendly way to do, eg., /admin restart, because on servers that implement XEP-0133 the associated node would be eg. http://jabber.org/protocol/admin#restart while on ejabberd it's something like running nodes/ejabberd@localhost/restart.

So we need a way to allow admins to specify full nodes (which can then be aliased and stuff) while also aliasing a set of default XEP-0133 command nodes. When listing commands, the 0133 ones should be listed as their alias.

Also, /admin attempts to execute a command non-interactively by filling the form with default values, but that fails horribly on forms with, eg., a required list-single field where we simply attempt to pick all the options. The correct way would be to be interactive by default (maybe use --quiet for the opposite), to pick the first option in a list-single field, and to simply refuse quiet mode in forms that have other required text fields.

cburschka commented 8 years ago

Most of this is already in, but there is no good support for non-interactive --quiet mode yet. The field values should be passable via CLI arguments, and --help should load the form and show the accepted arguments.