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

Merge pull request #22 from DorianBDev/arm

Fix non-working backend
This commit is contained in:
Éric Gaspar 2022-02-20 15:51:45 +01:00 committed by GitHub
commit 2489a762dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 48 additions and 15 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,15 @@ ynh_print_info --message="Declaring files to be backed up..."
# BACKUP THE APP MAIN DIR
#=================================================
# Frontend
ynh_backup --src_path="$final_path"
# Config
ynh_backup --src_path="/etc/vikunja/config.yml"
# 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
ynh_secure_remove --file="/opt/vikunja"
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -59,12 +59,19 @@ 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"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
chmod +x "$final_path/vikunja"
# Config
ynh_restore_file --origin_path="/etc/vikunja/config.yml"
# Backend
ynh_restore_file --origin_path="/opt/vikunja"
chmod +x "/opt/vikunja/vikunja"
chown -R $app:www-data "/opt/vikunja/files"
#=================================================
# REINSTALL DEPENDENCIES

View file

@ -25,6 +25,7 @@ db_user=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
timezone="$(cat /etc/timezone)"
secret=$(ynh_string_random --length=32)
architecture=$YNH_ARCH
set_motd=$(ynh_app_setting_get --app=$app --key=set_motd)
enable_registration=$(ynh_app_setting_get --app=$app --key=enable_registration)
@ -102,17 +103,22 @@ 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"
# 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 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
chmod +x "$final_path/vikunja"
chown -R $app:www-data "$final_path/files"
chmod +x "/opt/vikunja/vikunja"
chown -R $app:www-data "/opt/vikunja/files"
#=================================================
# NGINX CONFIGURATION