Skip to content

doc: add a task to hash a password, and document it

Jean-Baptiste Nizet requested to merge feat/generate-hashed-password into master

@mfaure the easiest way for us, and probably also for you I think, to hash a password is to use a gradle task. This MR allows doing that and documents the way to do it. All you need to run this command is a JDK, and a clone of the git project: gradle installs everything else by itself. And it's a one-shot thing anyway: you normally do it once for the very first superadmin user(s).

I let you read the changes in the MR to see how it's done.

I didn't specify it in the documentation because it's documented in Gradle itself and is normally the first thing you learn when learning Gradle, but if you don't remember which tasks are available, you can just use

./gradlew tasks

The Amies-specific tasks are grouped in the "Amies" group, and you thus get an output like the following:

------------------------------------------------------------
Tasks runnable from root project
------------------------------------------------------------

Amies tasks
-----------
generateSecretKey - Generates a secret key that can then be used as the value of the amies.secret-key property
hashPassword - Hashes a password, ready to be used as the password of the first administrator inserted in the database.
Usage: ./gradlew hashPassword --args <password-to-hash>

Application tasks
-----------------
bootRun - Runs this project as a Spring Boot application.

Build tasks
-----------
assemble - Assembles the outputs of this project.
bootJar - Assembles an executable jar archive containing the main classes and their dependencies.
... [truncated]
Edited by Jean-Baptiste Nizet

Merge request reports