chore: clean up #2

Open
williamluke wants to merge 18 commits from lum/kitabu into master
4 changed files with 18 additions and 9 deletions
Showing only changes of commit 6636270fcc - Show all commits

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.clicada

View File

@ -34,8 +34,13 @@ if [ ! -z $INSTALL_EVM ]; then
fi fi
temp_dir=`mktemp -d` temp_dir=`mktemp -d`
git clone -b $branch https://git.grassecon.net/grassrootseconomics/cic-staff-installer.git $temp_dir git clone -b $branch https://git.grassecon.net/grassrootseconomics/cic-staff-installer.git $temp_dir
cd $temp_dir if [ ! -z $verbose ]; then
export BASH_DEBUG_LEVEL=${BASH_DEBUG_LEVEL:-1} # all=1 trace=2 debug=3 info=4 warn=5 error=6
export BASH_DEBUG_LEVEL=4 # 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 export BASH_DEBUG=1
# export CIC_ROOT_CA_FILE=$temp_dir/keys/ge.ca
pushd $temp_dir
bash setup.sh bash setup.sh
popd

View File

@ -34,6 +34,7 @@ get_default_enviroment(){
for c in ${config_directives[@]}; do for c in ${config_directives[@]}; do
v=${!c} v=${!c}
dbg $dbg_debug "CIC_ROOT_CA_FILE $CIC_ROOT_CA_FILE"
if [ -z "$v" ]; then if [ -z "$v" ]; then
d=`mktemp -d` d=`mktemp -d`
curl -X GET --cacert $CIC_ROOT_CA_FILE $CIC_ROOT_URL/$c -o $d/$c 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 if [ $update -gt 0 ]; then
dbg $dbg_debug "installing application files" 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 update_path $HOME/.local/bin
fi 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"} PIP_INDEX_URL=${PIP_INDEX_URL:-"https://pypi.org/simple"}
CIC_SETUP_TRUSTED_FINGERPRINT=${CIC_SETUP_TRUSTED_FINGERPRINT:-0826EDA1702D1E87C6E2875121D2E7BB88C2A746} CIC_SETUP_TRUSTED_FINGERPRINT=${CIC_SETUP_TRUSTED_FINGERPRINT:-0826EDA1702D1E87C6E2875121D2E7BB88C2A746}
CIC_ROOT_URL=${CIC_ROOT_URL:-https://root.grassrootseconomics.net/env/dev} 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 if [ "$UID" -eq 0 ]; then
dbg $dbg_error "This cannot be run as root" dbg $dbg_error "This cannot be run as root"
@ -183,6 +186,8 @@ fi
mkdir -vp $HOME/.local/bin mkdir -vp $HOME/.local/bin
dbg $dbg_debug "importing keys" dbg $dbg_debug "importing keys"
setup_cic_gpg setup_cic_gpg
# check if we have existing setup # check if we have existing setup
if [ ! -e "$HOME/.config/cic/staff-client/.envinit" ]; then if [ ! -e "$HOME/.config/cic/staff-client/.envinit" ]; then

View File

@ -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-server.conf
$HOME/.config/environment.d/01-cic-cache-tracker.conf $HOME/.config/environment.d/01-cic-cache-tracker.conf
$HOME/.local/bin/cic_cache_server_start.sh $HOME/.local/bin/cic_cache_server_start.sh
$HOME/.local/bin/migrate_cic_cache.py
Would you still like to continue? (y/n):" Would you still like to continue? (y/n):"
read confirmed read confirmed
@ -34,7 +33,7 @@ if [ "$confirmed" == "y" ]; then
systemctl --user stop cic-cache-server systemctl --user stop cic-cache-server
systemctl --user disable cic-cache-tracker systemctl --user disable cic-cache-tracker
systemctl --user disable cic-cache-server systemctl --user disable cic-cache-server
pip3 uninstall clicada cic cic-cache pip uninstall -y clicada cic cic-cache
echo "Deleting..." echo "Deleting..."
rm -rf $HOME/.local/share/cic/cache rm -rf $HOME/.local/share/cic/cache
rm -rf $HOME/.local/share/cic/clicada 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-server.conf
rm $HOME/.config/environment.d/01-cic-cache-tracker.conf rm $HOME/.config/environment.d/01-cic-cache-tracker.conf
rm $HOME/.local/bin/cic_cache_server_start.sh rm $HOME/.local/bin/cic_cache_server_start.sh
rm $HOME/.local/bin/migrate_cic_cache.py
echo "${green}Done${reset}" echo "${green}Done${reset}"
else else
echo "Aborting" echo "Aborting"