mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 23:22:37 +00:00
postsrsd: fix secret generation
This commit is contained in:
parent
5396a01b6c
commit
2202bb9cf5
@ -95,7 +95,11 @@ in {
|
||||
preStart = ''
|
||||
if [ ! -e "${cfg.secretsFile}" ]; then
|
||||
echo "WARNING: secrets file not found, autogenerating!"
|
||||
mkdir -p -m750 "$(dirname "${cfg.secretsFile}")"
|
||||
DIR="$(dirname "${cfg.secretsFile}")"
|
||||
if [ ! -d "$DIR" ]; then
|
||||
mkdir -p -m750 "$DIR"
|
||||
chown "${cfg.user}:${cfg.group}" "$DIR"
|
||||
fi
|
||||
dd if=/dev/random bs=18 count=1 | base64 > "${cfg.secretsFile}"
|
||||
chmod 600 "${cfg.secretsFile}"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user