forked from kalipso/infrastructure
Changed the rest of the scripts to sops encryption
This commit is contained in:
@@ -16,13 +16,14 @@ if [ ! -e flake.nix ]
|
||||
done
|
||||
fi
|
||||
|
||||
pwpath="machines/secrets/keys/itag"
|
||||
read -p "Enter new host name: " host
|
||||
|
||||
if [ "$host" = "" ]; then exit 0
|
||||
fi
|
||||
|
||||
mkdir -p machines/secrets/keys/itag/$host
|
||||
cd machines/secrets/keys/itag/$host
|
||||
mkdir -p $pwpath/$host
|
||||
cd $pwpath/$host
|
||||
|
||||
# Generate SSH keys
|
||||
ssh-keygen -f "$host" -t ed25519 -N ""
|
||||
@@ -33,8 +34,8 @@ sops -e -i ./"$host"
|
||||
sops -e -i ./"$host"-init
|
||||
|
||||
#generate encryption key
|
||||
tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 20 > encryption.txt
|
||||
sops -e -i ./encryption.txt
|
||||
tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 20 > disk.key
|
||||
sops -e -i ./disk.key
|
||||
|
||||
# Info
|
||||
echo
|
||||
|
||||
Reference in New Issue
Block a user