1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/galette_ynh.git synced 2024-09-03 18:36:28 +02:00
galette_ynh/scripts/upgrade
Éric Gaspar c741cbfd7b fix
2024-03-01 22:51:24 +01:00

61 lines
1.9 KiB
Bash
Executable file

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
timezone="$(cat /etc/timezone)"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Upgrading source files..."
ynh_setup_source --dest_dir="$install_dir" --keep="galette/config/config.inc.php galette/data galette/plugins"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
#=================================================
# REAPPLY SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
# Create a dedicated PHP-FPM config
ynh_add_fpm_config
# Create a dedicated NGINX config
ynh_add_nginx_config
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append
#=================================================
# SPECIFIC UPGRADE
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
chown "$app" "$install_dir/galette/config"
chmod 750 "$install_dir/galette/config"
for folder in attachments cache exports files imports logs photos templates_c tempimages
do
chown "$app" "$install_dir/galette/data/$folder"
chmod 775 "$install_dir/galette/data/$folder"
done
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Upgrade of $app completed" --last