1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/vikunja_ynh.git synced 2024-09-03 18:06:26 +02:00

Fix non-working backend

The bug occurred because the downloaded backend's file type was wrong. It was used as a binary file rather a zip file.

This commit also adds a clearer separation between backend and frontend in the scripts.
This commit is contained in:
DorianBDev 2022-02-14 17:46:52 +01:00
parent 5db94d1c5d
commit ea9414d952
No known key found for this signature in database
GPG key ID: 42D782AFC6A8FE39
8 changed files with 39 additions and 11 deletions

View file

@ -2,5 +2,6 @@ SOURCE_URL=https://dl.vikunja.io/api/0.18.1/vikunja-v0.18.1-linux-amd64-full
SOURCE_SUM=fd259ae3c717bea715e96d0806ac08f2bd462068277ab2b62ebee36fe946f0e2
SOURCE_SUM_PRG=sha256sum
SOURCE_IN_SUBDIR=false
SOURCE_FORMAT=zip
SOURCE_FILENAME=vikunja
SOURCE_EXTRACT=false
SOURCE_EXTRACT=true

View file

@ -2,5 +2,6 @@ SOURCE_URL=https://dl.vikunja.io/api/0.18.1/vikunja-v0.18.1-linux-arm64-full
SOURCE_SUM=c54c6d70b348c1697ff8519d522f2b1e3c58ffb4401ac1f4c2e729913b392a27
SOURCE_SUM_PRG=sha256sum
SOURCE_IN_SUBDIR=false
SOURCE_FORMAT=zip
SOURCE_FILENAME=vikunja
SOURCE_EXTRACT=false
SOURCE_EXTRACT=true

View file

@ -2,5 +2,6 @@ SOURCE_URL=https://dl.vikunja.io/api/0.18.1/vikunja-v0.18.1-linux-arm-7-full
SOURCE_SUM=79548e506538319f8aab07a5630c3c2032906b34386a83c26d1a6cfc9993b39c
SOURCE_SUM_PRG=sha256sum
SOURCE_IN_SUBDIR=false
SOURCE_FORMAT=zip
SOURCE_FILENAME=vikunja
SOURCE_EXTRACT=false
SOURCE_EXTRACT=true

View file

@ -36,8 +36,12 @@ ynh_print_info --message="Declaring files to be backed up..."
# BACKUP THE APP MAIN DIR
#=================================================
# Frontend
ynh_backup --src_path="$final_path"
# Backend
ynh_backup --src_path="/opt/vikunja"
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================

View file

@ -91,28 +91,30 @@ ynh_psql_test_if_first_run
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
# INSTALL FRONTEND
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=1
ynh_script_progression --message="Setting up frontend..." --weight=1
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" --source_id="front"
ynh_setup_source --dest_dir="$final_path/vikunja" --source_id="$architecture"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
# INSTALL BACKEND
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=1
ynh_script_progression --message="Setting up backend..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
mkdir -p "/opt/vikunja"
mkdir -p "/opt/vikunja/files"
ynh_setup_source --dest_dir="/opt/vikunja" --source_id="$architecture"
tempdir="$(mktemp -d)"
ynh_setup_source --dest_dir=$tempdir --source_id="$architecture"
back="$(find $tempdir -name "vikunja-*" \! -name "*.sha256")"
cp "$back" "/opt/vikunja/vikunja"
chmod +x "/opt/vikunja/vikunja"
chown -R $app:www-data "/opt/vikunja/files"

View file

@ -92,6 +92,14 @@ ynh_script_progression --message="Removing the dedicated system user..." --weigh
# Delete a system user
ynh_system_user_delete --username=$app
#=================================================
# REMOVE BACKEND
#=================================================
ynh_script_progression --message="Removing backend..." --weight=1
# Delete /opt/vikunja
rm -rf "/opt/vikunja"
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -59,8 +59,13 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
ynh_script_progression --message="Restoring $app main directory..." --weight=4
# Frontend
ynh_restore_file --origin_path="$final_path"
# Backend
ynh_restore_file --origin_path="/opt/vikunja"
chmod +x "/opt/vikunja/vikunja"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"

View file

@ -102,12 +102,18 @@ then
ynh_script_progression --message="Upgrading source files..." --weight=5
# Download, check integrity, uncompress and patch the source from app.src
# Frontend
ynh_setup_source --dest_dir="$final_path" --source_id="front" --keep="/etc/vikunja/config.yml"
ynh_setup_source --dest_dir="$final_path" --source_id="$architecture"
mkdir -p "/opt/vikunja/files"
# Backend
mkdir -p "/opt/vikunja/files"
tempdir="$(mktemp -d)"
ynh_setup_source --dest_dir=$tempdir --source_id="$architecture"
back="$(find $tempdir -name "vikunja-*" \! -name "*.sha256")"
cp "$back" "/opt/vikunja/vikunja"
fi
chmod +x "/opt/vikunja/vikunja"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"