feat(tools/hash-password): Add a wrapper script for slappasswd

This wrapper script correctly invokes slappasswd for generating ARGON2
hashes.

People without Nix will need to figure this out on their own.

Change-Id: I264715ba4932855b868bef70cc9102515b3d129e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/833
Tested-by: BuildkiteCI
Reviewed-by: BuildkiteCI
Reviewed-by: Kane York <rikingcoding@gmail.com>
This commit is contained in:
Vincent Ambo 2020-07-01 21:29:35 +01:00 committed by tazjin
parent a1556d71e6
commit 29984bb6f9
3 changed files with 11 additions and 0 deletions

View file

@ -49,6 +49,9 @@ case "${TARGET_TOOL}" in
gerrit)
attr="tools.gerrit-cli"
;;
hash-password)
attr="tools.hash-password"
;;
*)
echo "The tool '${TARGET_TOOL}' is currently not installed in this repository."
exit 1

1
bin/hash-password Symbolic link
View file

@ -0,0 +1 @@
__dispatch.sh

7
tools/hash-password.nix Normal file
View file

@ -0,0 +1,7 @@
# Utility for invoking slappasswd with the correct options for
# creating an ARGON2 password hash.
{ pkgs, ... }:
pkgs.writeShellScriptBin "hash-password" ''
${pkgs.openldap}/bin/slappasswd -o module-load=pw-argon2 -h '{ARGON2}'
''