2015-11-03 23:22:02 +01:00
|
|
|
#!/bin/bash
|
2018-02-27 22:35:57 +01:00
|
|
|
|
2018-03-07 23:33:32 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2023-11-11 14:14:26 +01:00
|
|
|
|
2021-07-22 15:51:13 +02:00
|
|
|
timezone="$(cat /etc/timezone)"
|
2021-01-05 23:31:12 +01:00
|
|
|
|
2018-03-07 23:33:32 +01:00
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
2024-03-01 22:51:24 +01:00
|
|
|
ynh_script_progression --message="Upgrading source files..."
|
2018-03-07 23:33:32 +01:00
|
|
|
|
2024-03-01 22:51:24 +01:00
|
|
|
ynh_setup_source --dest_dir="$install_dir" --keep="galette/config/config.inc.php galette/data galette/plugins"
|
2018-03-07 23:33:32 +01:00
|
|
|
|
2023-11-11 14:01:42 +01:00
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R $app:www-data "$install_dir"
|
2021-07-23 07:46:48 +02:00
|
|
|
|
2019-09-25 22:51:37 +02:00
|
|
|
#=================================================
|
2023-11-11 14:37:54 +01:00
|
|
|
# REAPPLY SYSTEM CONFIGURATIONS
|
2019-09-25 22:51:37 +02:00
|
|
|
#=================================================
|
2023-11-11 14:37:54 +01:00
|
|
|
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
|
2019-09-25 22:51:37 +02:00
|
|
|
|
2021-01-05 23:31:12 +01:00
|
|
|
# Create a dedicated PHP-FPM config
|
2021-11-14 15:32:27 +01:00
|
|
|
ynh_add_fpm_config
|
2019-09-25 22:51:37 +02:00
|
|
|
|
2022-06-26 14:53:49 +02:00
|
|
|
# Create a dedicated NGINX config
|
|
|
|
ynh_add_nginx_config
|
|
|
|
|
2023-11-11 14:14:26 +01:00
|
|
|
# Use logrotate to manage app-specific logfile(s)
|
|
|
|
ynh_use_logrotate --non-append
|
|
|
|
|
2018-03-07 23:33:32 +01:00
|
|
|
#=================================================
|
|
|
|
# SPECIFIC UPGRADE
|
|
|
|
#=================================================
|
|
|
|
# SECURE FILES AND DIRECTORIES
|
|
|
|
#=================================================
|
|
|
|
|
2023-11-11 14:01:42 +01:00
|
|
|
chown "$app" "$install_dir/galette/config"
|
|
|
|
chmod 750 "$install_dir/galette/config"
|
2018-03-20 23:34:46 +01:00
|
|
|
|
2018-03-07 23:33:32 +01:00
|
|
|
for folder in attachments cache exports files imports logs photos templates_c tempimages
|
|
|
|
do
|
2023-11-11 14:01:42 +01:00
|
|
|
chown "$app" "$install_dir/galette/data/$folder"
|
|
|
|
chmod 775 "$install_dir/galette/data/$folder"
|
2018-03-07 23:33:32 +01:00
|
|
|
done
|
|
|
|
|
2021-01-05 23:31:12 +01:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Upgrade of $app completed" --last
|