Merge pull request 'Moved hash generation engine to the backend' (#9) from development into preproduction

Reviewed-on: https://git.selfprivacy.org/ilchub/selfprivacy-nixos-infect/pulls/9
This commit is contained in:
ilchub 2021-04-21 13:02:31 +03:00
commit e446e63140

View file

@ -5,6 +5,7 @@
set -e -o pipefail set -e -o pipefail
makeConf() { makeConf() {
export HASHED_PASSWORD=$( mkpasswd -m sha-512 "$PASSWORD" )
# Skip everything if main config already present # Skip everything if main config already present
[[ -e /etc/nixos/configuration.nix ]] && return 0 [[ -e /etc/nixos/configuration.nix ]] && return 0
# NB <<"EOF" quotes / $ ` in heredocs, <<EOF does not # NB <<"EOF" quotes / $ ` in heredocs, <<EOF does not
@ -118,7 +119,7 @@ makeConf() {
users.users = { users.users = {
"$LUSER" = { "$LUSER" = {
isNormalUser = true; isNormalUser = true;
hashedPassword = "\$6\$$SALT\$$HASHED_PASSWORD"; hashedPassword = "$HASHED_PASSWORD";
}; };
}; };
} }
@ -1319,7 +1320,7 @@ infect() {
[ "$PROVIDER" = "digitalocean" ] && doNetConf=y # digitalocean requires detailed network config to be generated [ "$PROVIDER" = "digitalocean" ] && doNetConf=y # digitalocean requires detailed network config to be generated
apt update apt update
apt install -y git apt install -y git whois
prepareEnv prepareEnv
makeSwap # smallest (512MB) droplet needs extra memory! makeSwap # smallest (512MB) droplet needs extra memory!
checkEnv checkEnv