Gathered SSH stuff to avoid error.
This commit is contained in:
@@ -68,6 +68,10 @@ necessary_credentials_with_config() {
|
||||
}
|
||||
|
||||
setup_ssh() {
|
||||
echo -e "\n\n ✅ Generating new SSH for numbus-admin..."
|
||||
mkdir -p extra-files/home/numbus-admin/.ssh/
|
||||
ssh-keygen -t "ed25519" -C "numbus-admin@numbus-server" -f "extra-files/home/numbus-admin/.ssh/id_ed25519" -N "" -q
|
||||
|
||||
REMOTE_PASS=$(gum input --password --placeholder "Enter password for 'nixos' on '$TARGET_HOST'")
|
||||
if [ -z "$REMOTE_PASS" ]; then
|
||||
echo " ❌ Password is required to proceed. Aborting."
|
||||
@@ -132,7 +136,6 @@ hardware_detection() {
|
||||
|
||||
files_generation() {
|
||||
echo -e "\n\n ✅ Generating necessary folder tree..."
|
||||
mkdir -p extra-files/home/numbus-admin/.ssh/
|
||||
mkdir -p extra-files/var/lib/sops-nix/
|
||||
mkdir -p extra-files/etc/nixos/secrets/
|
||||
mkdir -p extra-files/mnt/config-storage/traefik/config/conf
|
||||
@@ -141,9 +144,6 @@ files_generation() {
|
||||
mkdir -p extra-files/mnt/data-storage/nextcloud
|
||||
mkdir -p extra-files/mnt/data-storage/immich
|
||||
|
||||
echo -e "\n\n ✅ Generating new SSH for numbus-admin..."
|
||||
ssh-keygen -t "ed25519" -C "numbus-admin@numbus-server" -f "extra-files/home/numbus-admin/.ssh/id_ed25519" -N "" -q
|
||||
|
||||
echo -e "\n\n ✅ Generating sops-nix keys..."
|
||||
ssh-to-age -private-key -i extra-files/home/numbus-admin/.ssh/id_ed25519 > extra-files/var/lib/sops-nix/key.txt
|
||||
SOPS_PUBLIC_KEY=$(age-keygen -y extra-files/var/lib/sops-nix/key.txt)
|
||||
|
||||
Reference in New Issue
Block a user