Closed yroseau closed 5 years ago
I find It curious that kuzzle is using role/profile enforcement from the command line, especially for the reset command where our data, including role & profile may not be in a consistent state.
@yroseau > the error seems explicit to me, apart from the -1
user (anonymous) which, I concede, is not explicit. The error message should be improved a bit.
@lethak > The current CLI strategy is to use the Kuzzle API, as any other client would. So rights are indeed checked and, if no credentials are provided, the CLI is executed as the anonymous user. We did that as a security measure, as many other management tools do.
But you can provide a username and a password to the CLI (options -U <username> -P <password>
) as stated by this usage help:
$ bin/kuzzle
Usage: kuzzle [options] [command]
Options:
-V, --version output the version number
-p, --port <port> Kuzzle port number
-h, --host <host> Kuzzle host
-U, --username <username> Admin username
-P, --password <password> Admin password
-d, --debug make errors more verbose
-C, --noColors do not use ANSI coloring
-h, --help output usage information
Commands:
createFirstAdmin create the first administrator user
clearCache clear internal caches in Redis
reset [options] reset all users, profiles, roles and documents validation specifications
resetSecurity [options] reset all users, profiles and roles
resetDatabase [options] remove all data stored on Kuzzle
shutdown gracefully exits after processing remaining requests
start [options] start a Kuzzle instance
dump create a dump of current state of kuzzle
loadMappings <file> load database mappings into Kuzzle
loadFixtures <file> load database fixtures into Kuzzle
loadSecurities <file> load roles, profiles and users into Kuzzle
I checked kuzzle reset --help
but did not think global options where not showing.
Thanks for explaining.
@lethak > I just checked it too, and this is a good point: global options should be added to command help messages.
I'll add a PR for this, thanks for the heads up :+1:
The command
./bin/kuzzle reset
throws an exception. Tested with Kuzzle 1.4.x