Browse Source

refactoring

master
Sven Ullmann 1 year ago
parent
commit
298439c434
  1. 7
      plugins/git/src/commands/clone
  2. 7
      src/includes/main_functions

7
plugins/git/src/commands/clone

@ -22,6 +22,7 @@ sshDomain="$(getConfig $shortname "git.ssh_domain")"
sshPrivateKey="$(getConfig $shortname "git.ssh_private_key")"
sshPublicKey="$(getConfig $shortname "git.ssh_public_key")"
sshPrivateKeyPassphrase="$(getCryptedConfig $shortname "git.ssh_private_key_passphrase")"
workspaces_dir="$(getConfig false "project_manager.workspaces_dir")"
if [ "$url" == "" ]
then
@ -54,11 +55,7 @@ confirm
if [ ! -d "$workspaces_dir/$customer/$project" ]
then
echo
echoError "Wprkspace dir not exists"
echo
exit
mkdir -p "$workspaces_dir/$customer/$project"
fi
sshAddKey "git"
git clone "$url" "$workspaces_dir/$customer/$project"

7
src/includes/main_functions

@ -194,8 +194,7 @@ then
then
echo "$(getConfig "$shortname" "project_manager.cryptkey")"
else
escapedShortname=${shortname//./\\.}
echo "$(getConfig "$shortname" "project_manager.projects.$escapedShortname.cryptkey")"
echo "$(getConfig "$shortname" "project.cryptkey")"
fi
}
@ -210,7 +209,7 @@ then
readCryptedConfig "$shortname" "$configPath"
fi
echo "$(decrypt "$(getConfig "$shortname" "$configPath")" "$cryptkey")"
echo decrypt "$(getConfig "$shortname" "$configPath")" "$cryptkey"
}
function getConfig {
@ -287,7 +286,7 @@ then
{
local password="$(getArgument "$1" "password required" true)"
local cryptkey="$(getArgument "$2" "crypt key required" true)"
echo "$password" | openssl enc -da -nosalt -nopad -pbkdf2 -k "$cryptkey"
echo "$password" | openssl enc -d -base64 -nosalt -nopad -pbkdf2 -k "$cryptkey"
}
function randkey

Loading…
Cancel
Save