A free, open, self-hosted app platform (GNU AGPLv3): one-click app deploys, Traefik reverse proxy with automatic SSL, rootless Docker support, gluetun VPN routing, and a web dashboard to manage it all. Free & open forever to self-host; optional paid hosted services fund it. See PROMISE.md. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: librelad <librelad@digitalangels.vip>
36 lines
1.3 KiB
Bash
Executable File
36 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
generateSSHSetupKeyPair()
|
|
{
|
|
local username="$1"
|
|
local flag="$2"
|
|
|
|
local private_key_file="${CFG_INSTALL_NAME}_sshkey_$username"
|
|
local private_key_path="${ssh_dir}private"
|
|
local private_key_full="$private_key_path/$private_key_file"
|
|
|
|
local public_key_file="$private_key_file.pub"
|
|
local public_key_path="${ssh_dir}public"
|
|
local public_key_full="$public_key_path/$public_key_file"
|
|
|
|
# Check if the directory exists; if not, create it
|
|
if [ ! -d "$private_key_path" ]; then
|
|
local result=$(createFolders "loud" $docker_install_user $private_key_path)
|
|
checkSuccess "Creating $(basename "$private_key_path") folder"
|
|
fi
|
|
if [ ! -d "$public_key_path" ]; then
|
|
local result=$(createFolders "loud" $docker_install_user $public_key_path)
|
|
checkSuccess "Creating $(basename "$public_key_path") folder"
|
|
fi
|
|
|
|
# Check if the private key does not exist
|
|
if [ ! -f "$private_key_full" ]; then
|
|
generateSSHKeyPair "$username" "$private_key_path" "$private_key_full" "$public_key_full" install;
|
|
fi
|
|
|
|
# Check if the public key does not exist
|
|
if [ ! -f "$public_key_full" ]; then
|
|
generateSSHKeyPair "$username" "$private_key_path" "$private_key_full" "$public_key_full" install;
|
|
fi
|
|
}
|