1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/archivebox_ynh.git synced 2024-09-03 18:15:54 +02:00

more cleanup

This commit is contained in:
yalh76 2022-09-22 00:10:01 +02:00
parent 4e0d631827
commit d79d55aae9
2 changed files with 22 additions and 20 deletions

View file

@ -143,8 +143,6 @@ pushd $final_path
ynh_npm ci
popd
ynh_node_path=$ynh_node
#=================================================
# CREATE DATA DIRECTORY
#=================================================
@ -160,10 +158,10 @@ chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"
#=================================================
# CREATE ARCHIVEBOX CONFIG
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
# copy configuration file
ynh_add_config --template="../conf/ArchiveBox.conf" --destination="$datadir/ArchiveBox.conf"
# permissions
@ -176,10 +174,11 @@ chown -R $app:www-data "$datadir"
#=================================================
ynh_script_progression --message="Initializing Archivebox" --weight=1
cd $datadir && ynh_exec_as $app $archivebox_cmd init
pushd $datadir
ynh_exec_as $app $archivebox_cmd init
ynh_script_progression --message="Checking if admin superuser already exists: $admin" --weight=1
USER_EXISTS=$(cd $datadir && ynh_exec_as $app $archivebox_cmd manage shell -c "from django.contrib.auth.models import User; print(User.objects.filter(username='$admin').count())")
USER_EXISTS=$(ynh_exec_as $app $archivebox_cmd manage shell -c "from django.contrib.auth.models import User; print(User.objects.filter(username='$admin').count())")
ynh_script_progression --message="Found users: $USER_EXISTS" --weight=1
if [ $USER_EXISTS -eq 1 ]
@ -212,7 +211,8 @@ EOF
fi
ynh_script_progression --message="Finishing Archivebox Setup" --weight=1
cd $datadir && ynh_exec_as $app $ynh_node_load_PATH $archivebox_cmd init --setup
ynh_exec_as $app $ynh_node_load_PATH $archivebox_cmd init --setup
popd
#=================================================
# SETUP SYSTEMD

View file

@ -99,10 +99,10 @@ ynh_add_nginx_config
# UPGRADE VIA PIP
#=================================================
ynh_use_nodejs
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading via pip" --weight=1
ynh_use_nodejs
python3 -m venv "${final_path}/venv"
cp ../conf/requirements.txt "$final_path/requirements.txt"
chown -R "$app" "$final_path"
@ -121,7 +121,9 @@ then
# rerun archivebox setup (its idempotent, so it should be ok during upgrade)
ynh_script_progression --message="Finishing Archivebox Setup" --weight=1
cd $datadir && ynh_exec_as $app $ynh_node_load_PATH $archivebox_cmd init --setup
pushd $datadir
ynh_exec_as $app $ynh_node_load_PATH $archivebox_cmd init --setup
popd
fi
chmod 750 "$final_path"