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

Fix issues with scripts

- Change an "rm -rf" to "ynh_secure_remove" for the remove script.
- Add the config file to the backup and restore scripts.
- Fix incorrect "chmod" for the restore and upgrade scripts.
- Fix missing "architecture" variable for the upgrade script.
This commit is contained in:
DorianBDev 2022-02-15 15:18:19 +01:00
parent ea9414d952
commit 7a5e59b9ed
No known key found for this signature in database
GPG key ID: 42D782AFC6A8FE39
4 changed files with 15 additions and 10 deletions

View file

@ -39,6 +39,9 @@ ynh_print_info --message="Declaring files to be backed up..."
# Frontend # Frontend
ynh_backup --src_path="$final_path" ynh_backup --src_path="$final_path"
# Config
ynh_backup --src_path="/etc/vikunja/config.yml"
# Backend # Backend
ynh_backup --src_path="/opt/vikunja" ynh_backup --src_path="/opt/vikunja"

View file

@ -98,7 +98,7 @@ ynh_system_user_delete --username=$app
ynh_script_progression --message="Removing backend..." --weight=1 ynh_script_progression --message="Removing backend..." --weight=1
# Delete /opt/vikunja # Delete /opt/vikunja
rm -rf "/opt/vikunja" ynh_secure_remove --file="/opt/vikunja"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -61,15 +61,17 @@ ynh_script_progression --message="Restoring $app main directory..." --weight=4
# Frontend # Frontend
ynh_restore_file --origin_path="$final_path" 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 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$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 # REINSTALL DEPENDENCIES

View file

@ -25,6 +25,7 @@ db_user=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
timezone="$(cat /etc/timezone)" timezone="$(cat /etc/timezone)"
secret=$(ynh_string_random --length=32) secret=$(ynh_string_random --length=32)
architecture=$YNH_ARCH
set_motd=$(ynh_app_setting_get --app=$app --key=set_motd) set_motd=$(ynh_app_setting_get --app=$app --key=set_motd)
enable_registration=$(ynh_app_setting_get --app=$app --key=enable_registration) enable_registration=$(ynh_app_setting_get --app=$app --key=enable_registration)
@ -113,12 +114,11 @@ then
cp "$back" "/opt/vikunja/vikunja" cp "$back" "/opt/vikunja/vikunja"
fi fi
chmod +x "/opt/vikunja/vikunja"
chmod 750 "$final_path" chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
chmod +x "$final_path/vikunja" chmod +x "/opt/vikunja/vikunja"
chown -R $app:www-data "$final_path/files" chown -R $app:www-data "/opt/vikunja/files"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION