|
|
@ -174,8 +174,9 @@ then |
|
|
|
|
|
|
|
if [ "$shortname" != false ] |
|
|
|
then |
|
|
|
local project="$(getConfig false "project_manager.projects.$shortname.project")" |
|
|
|
local customer="$(getConfig false "project_manager.projects.$shortname.customer")" |
|
|
|
escapedShortname=${shortname//./\\.} |
|
|
|
local project="$(getConfig false "project_manager.projects.$escapedShortname.project")" |
|
|
|
local customer="$(getConfig false "project_manager.projects.$escapedShortname.customer")" |
|
|
|
local project_dir="$project_manager_dir/data/$customer/$project" |
|
|
|
fi |
|
|
|
|
|
|
@ -189,11 +190,12 @@ then |
|
|
|
function getCryptKey |
|
|
|
{ |
|
|
|
local shortname="$(getArgument "$1" "shortname required" true)" |
|
|
|
if [ "$shortname" != false] |
|
|
|
if [ "$shortname" != false ] |
|
|
|
then |
|
|
|
echo "$(getConfig "$shortname" "project_manager.cryptkey")" |
|
|
|
else |
|
|
|
echo "$(getConfig "$shortname" "project_manager.projects.$shortname.cryptkey")" |
|
|
|
escapedShortname=${shortname//./\\.} |
|
|
|
echo "$(getConfig "$shortname" "project_manager.projects.$escapedShortname.cryptkey")" |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
@ -258,7 +260,7 @@ then |
|
|
|
echo "$(source "$configScript" has "$shortname" "$configPath")" |
|
|
|
} |
|
|
|
|
|
|
|
function readyCryptedConfig |
|
|
|
function readCryptedConfig |
|
|
|
{ |
|
|
|
local shortname="$(getArgument "$1" "shortname required" true)" |
|
|
|
local configPath="$(getArgument "$2" "configPath required" true)" |
|
|
@ -278,14 +280,14 @@ then |
|
|
|
{ |
|
|
|
local password="$(getArgument "$1" "password required" true)" |
|
|
|
local cryptkey="$(getArgument "$2" "crypt key required" true)" |
|
|
|
echo "$password" | openssl enc -base64 -aes-256-cbc -nosalt -nopad -pbkdf2 -k "$cryptkey" |
|
|
|
echo "$password" | openssl enc -base64 -nosalt -nopad -pbkdf2 -k "$cryptkey" |
|
|
|
} |
|
|
|
|
|
|
|
function decrypt |
|
|
|
{ |
|
|
|
local password="$(getArgument "$1" "password required" true)" |
|
|
|
local cryptkey="$(getArgument "$2" "crypt key required" true)" |
|
|
|
echo "$password" | openssl enc -da -aes-256-cbc -nosalt -nopad -pbkdf2 -k "$cryptkey" |
|
|
|
echo "$password" | openssl enc -da -nosalt -nopad -pbkdf2 -k "$cryptkey" |
|
|
|
} |
|
|
|
|
|
|
|
function randkey |
|
|
@ -341,8 +343,9 @@ then |
|
|
|
} |
|
|
|
|
|
|
|
function configureJsonFile { |
|
|
|
local jsonPath="$(getArgument "$1" "json file path required" true)" |
|
|
|
local shortname="$(getArgument "$1" "shortname is required" true)" |
|
|
|
local jsonPath="$(getArgument "$2" "json file path required" true)" |
|
|
|
local configScript="$project_manager_dir/src/includes/configure-json-file" |
|
|
|
source "$configScript" "$jsonPath" |
|
|
|
source "$configScript" "$shortname" "$jsonPath" |
|
|
|
} |
|
|
|
fi |