diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0fd9273 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.clicada \ No newline at end of file diff --git a/install.sh b/install.sh index 1098156..355055e 100644 --- a/install.sh +++ b/install.sh @@ -34,8 +34,13 @@ if [ ! -z $INSTALL_EVM ]; then fi temp_dir=`mktemp -d` git clone -b $branch https://git.grassecon.net/grassrootseconomics/cic-staff-installer.git $temp_dir -cd $temp_dir - -export BASH_DEBUG_LEVEL=4 # all=1 trace=2 debug=3 info=4 warn=5 error=6 +if [ ! -z $verbose ]; then + export BASH_DEBUG_LEVEL=${BASH_DEBUG_LEVEL:-1} # all=1 trace=2 debug=3 info=4 warn=5 error=6 +else + export BASH_DEBUG_LEVEL=${BASH_DEBUG_LEVEL:-4} # all=1 trace=2 debug=3 info=4 warn=5 error=6 +fi export BASH_DEBUG=1 -bash setup.sh \ No newline at end of file +# export CIC_ROOT_CA_FILE=$temp_dir/keys/ge.ca +pushd $temp_dir +bash setup.sh +popd \ No newline at end of file diff --git a/setup.sh b/setup.sh index 4cd3510..b55b81f 100644 --- a/setup.sh +++ b/setup.sh @@ -34,6 +34,7 @@ get_default_enviroment(){ for c in ${config_directives[@]}; do v=${!c} + dbg $dbg_debug "CIC_ROOT_CA_FILE $CIC_ROOT_CA_FILE" if [ -z "$v" ]; then d=`mktemp -d` curl -X GET --cacert $CIC_ROOT_CA_FILE $CIC_ROOT_URL/$c -o $d/$c @@ -113,7 +114,7 @@ update_requirements(){ if [ $update -gt 0 ]; then dbg $dbg_debug "installing application files" - pip3 install --user --index-url $PIP_INDEX_URL --extra-index-url $PIP_EXTRA_INDEX_URL $PIP_EXTRA_ARGS $debug_flag -r requirements.txt + pip install --index-url $PIP_INDEX_URL --extra-index-url $PIP_EXTRA_INDEX_URL $PIP_EXTRA_ARGS $debug_flag -r requirements.txt update_path $HOME/.local/bin fi } @@ -170,7 +171,9 @@ PIP_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL:-https://pip.grassrootseconomics.net} PIP_INDEX_URL=${PIP_INDEX_URL:-"https://pypi.org/simple"} CIC_SETUP_TRUSTED_FINGERPRINT=${CIC_SETUP_TRUSTED_FINGERPRINT:-0826EDA1702D1E87C6E2875121D2E7BB88C2A746} CIC_ROOT_URL=${CIC_ROOT_URL:-https://root.grassrootseconomics.net/env/dev} -CIC_ROOT_CA_FILE=${CIC_ROOT_CA_FILE:-keys/ge.ca} + +default_root_ca_file=`realpath ./keys/ge.ca` +CIC_ROOT_CA_FILE=${CIC_ROOT_CA_FILE:-$default_root_ca_file} if [ "$UID" -eq 0 ]; then dbg $dbg_error "This cannot be run as root" @@ -183,6 +186,8 @@ fi mkdir -vp $HOME/.local/bin dbg $dbg_debug "importing keys" + + setup_cic_gpg # check if we have existing setup if [ ! -e "$HOME/.config/cic/staff-client/.envinit" ]; then diff --git a/uninstall.sh b/uninstall.sh index 48de10b..613fc21 100644 --- a/uninstall.sh +++ b/uninstall.sh @@ -23,7 +23,6 @@ ${red}WARNING:${reset} The following will be DELETED if present: $HOME/.config/environment.d/01-cic-cache-server.conf $HOME/.config/environment.d/01-cic-cache-tracker.conf $HOME/.local/bin/cic_cache_server_start.sh - $HOME/.local/bin/migrate_cic_cache.py Would you still like to continue? (y/n):" read confirmed @@ -34,7 +33,7 @@ if [ "$confirmed" == "y" ]; then systemctl --user stop cic-cache-server systemctl --user disable cic-cache-tracker systemctl --user disable cic-cache-server - pip3 uninstall clicada cic cic-cache + pip uninstall -y clicada cic cic-cache echo "Deleting..." rm -rf $HOME/.local/share/cic/cache rm -rf $HOME/.local/share/cic/clicada @@ -48,7 +47,6 @@ if [ "$confirmed" == "y" ]; then rm $HOME/.config/environment.d/01-cic-cache-server.conf rm $HOME/.config/environment.d/01-cic-cache-tracker.conf rm $HOME/.local/bin/cic_cache_server_start.sh - rm $HOME/.local/bin/migrate_cic_cache.py echo "${green}Done${reset}" else echo "Aborting"