about summary refs log tree commit diff
path: root/tools
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-07-01T20·29+0100
committertazjin <mail@tazj.in>2020-07-01T20·39+0000
commit29984bb6f909551b1951196757d99792a2570450 (patch)
treeac47794999907ed980d7ca402ef41de4130848c5 /tools
parenta1556d71e6cc1f49a4f7e78c058f69daad02fcc0 (diff)
feat(tools/hash-password): Add a wrapper script for slappasswd r/1151
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/hash-password.nix7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/hash-password.nix b/tools/hash-password.nix
new file mode 100644
index 000000000000..9893d521787e
--- /dev/null
+++ b/tools/hash-password.nix
@@ -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}'
+''