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

Upgrade to PHP7.3

This commit is contained in:
ericgaspar 2020-10-02 22:47:47 +02:00
parent 74ce9c3834
commit 3062eb2400
No known key found for this signature in database
GPG key ID: 574F281483054D44
10 changed files with 54 additions and 52 deletions

View file

@ -43,9 +43,8 @@ this package:
#### Supported architectures
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/piwigo%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/piwigo/)
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/piwigo%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/piwigo/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/piwigo%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/piwigo/)
* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/piwigo%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/piwigo/)
## Limitations
@ -60,8 +59,7 @@ this package:
---
Developers infos
----------------
## Developers infos
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/piwigo_ynh/tree/testing).

View file

@ -14,7 +14,7 @@ location __PATH__/ {
default_type text/html;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock;
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user if_not_empty;

View file

@ -33,7 +33,7 @@ group = __USER__
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = /var/run/php/php7.0-fpm-__NAMETOCHANGE__.sock
listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock
; Set listen(2) backlog.
; Default Value: 511 (-1 on FreeBSD and OpenBSD)

View file

@ -4,7 +4,11 @@
# COMMON VARIABLES
#=================================================
pkg_dependencies="php-gd php-imagick imagemagick"
YNH_PHP_VERSION="7.3"
pkg_dependencies="imagemagick"
extra_php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-imagick"
#=================================================
# EXPERIMENTAL HELPERS

View file

@ -19,58 +19,55 @@ ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..." --weight=2
ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# STANDARD BACKUP STEPS
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Backing up the main app directory..."
ynh_backup --src_path="$final_path"
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Backing up nginx web server configuration..."
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Backing up php-fpm configuration..."
ynh_backup --src_path="/etc/php/7.0/fpm/pool.d/$app.conf"
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#=================================================
# BACKUP THE MYSQL DATABASE
#=================================================
ynh_script_progression --message="Backing up the MySQL database..."
ynh_print_info --message="Backing up the MySQL database..."
ynh_mysql_dump_db --database="$db_name" > db.sql
#=================================================
# BACKUP FAIL2BAN CONFIGURATION
#=================================================
ynh_script_progression --message="Backing up fail2ban configuration..."
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP THE DATA DIRECTORY
#=================================================
ynh_script_progression --message="Backing up data directory..."
ynh_backup --src_path="/home/yunohost.app/${app}/upload" --is_big
@ -78,4 +75,4 @@ ynh_backup --src_path="/home/yunohost.app/${app}/upload" --is_big
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."

View file

@ -50,7 +50,7 @@ fi
#=================================================
# MODIFY URL IN NGINX CONF FILE
#=================================================
ynh_script_progression --message="Updating nginx web server configuration..." --weight=2
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
@ -81,7 +81,7 @@ fi
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading nginx web server..."
ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload

View file

@ -96,9 +96,9 @@ ynh_system_user_create --username=$app
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring nginx web server..."
ynh_script_progression --message="Configuring NGINX web server..."
# Create a dedicated nginx config
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
@ -136,15 +136,16 @@ ynh_secure_remove --file="$tmpdir"
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring php-fpm..." --weight=2
ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
# Create a dedicated php-fpm config
ynh_add_fpm_config
ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies"
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# SETUP APPLICATION WITH CURL
#=================================================
ynh_script_progression --message="Installing piwigo with Curl..." --weight=5
ynh_script_progression --message="Installing Piwigo with cURL..." --weight=5
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
# Reload SSOwat config
@ -172,7 +173,7 @@ ynh_local_curl "/install.php?language=$applanguage" "install=true" "dbuser=$db_n
#=================================================
# CONFIGURE PIWIGO
#=================================================
ynh_script_progression --message="Configuring piwigo..."
ynh_script_progression --message="Configuring Piwigo..."
# Change local config
cp ../conf/config.inc.php $final_path/local/config/
@ -219,7 +220,7 @@ UPDATE piwigo_ldap_login_config SET value='0' WHERE param = 'ld_group_user_activ
#=================================================
# CONFIGURE FAIL2BAN
#=================================================
ynh_script_progression --message="Configuring fail2ban..." --weight=6
ynh_script_progression --message="Configuring Fail2Ban..." --weight=6
# Configure and activate log_failed_logins plugin
ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< "INSERT INTO plugins (id,state,version) VALUES ('log_failed_logins','active','1.2');"
@ -247,7 +248,7 @@ fi
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading nginx web server..."
ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload
@ -255,4 +256,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of $app completed" --last
ynh_script_progression --message="Installation of Piwigo completed" --last

View file

@ -41,7 +41,7 @@ ynh_mysql_remove_db --db_user=$db_name --db_name=$db_name
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_script_progression --message="Removing app main directory..."
ynh_script_progression --message="Removing Piwigo main directory..."
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
@ -49,23 +49,23 @@ ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing nginx web server configuration..." --weight=2
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=2
# Remove the dedicated nginx config
# Remove the dedicated NGINX config
ynh_remove_nginx_config
#=================================================
# REMOVE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Removing php-fpm configuration..."
ynh_script_progression --message="Removing PHP-FPM configuration..."
# Remove the dedicated php-fpm config
# Remove the dedicated PHP-FPM config
ynh_remove_fpm_config
#=================================================
# REMOVE FAIL2BAN CONFIGURATION
#=================================================
ynh_script_progression --message="Removing fail2ban configuration..." --weight=8
ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=8
ynh_remove_fail2ban_config
@ -83,4 +83,4 @@ ynh_system_user_delete --username=$app
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed" --last
ynh_script_progression --message="Removal of Piwigo completed" --last

View file

@ -28,6 +28,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# CHECK IF THE APP CAN BE RESTORED
@ -50,7 +51,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring the app main directory..."
ynh_script_progression --message="RestoringPiwigo main directory..."
ynh_restore_file --origin_path="$final_path"
@ -74,13 +75,14 @@ ynh_system_user_create --username=$app
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=10
ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf"
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#=================================================
# RESTORE THE FAIL2BAN CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the fail2ban configuration..." --weight=7
ynh_script_progression --message="Restoring the Fail2Ban configuration..." --weight=7
ynh_restore_file "/etc/fail2ban/jail.d/$app.conf"
ynh_restore_file "/etc/fail2ban/filter.d/$app.conf"
@ -126,13 +128,13 @@ chown -R $app: /home/yunohost.app/$app
#=================================================
# RELOAD NGINX AND PHP-FPM
#=================================================
ynh_script_progression --message="Reloading nginx web server and php-fpm..." --weight=2
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=2
ynh_systemd_action --service_name=php7.0-fpm --action=reload
ynh_systemd_action --service_name=php${phpversion}-fpm --action=reload
ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Restoration completed for $app" --last
ynh_script_progression --message="Restoration completed for Piwigo" --last

View file

@ -78,7 +78,7 @@ fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=6
ynh_script_progression --message="Backing up Piwigo before upgrading (may take a while)..." --weight=6
# Backup the current version of the app
ynh_backup_before_upgrade
@ -119,7 +119,7 @@ fi
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
# Create a dedicated nginx config
ynh_add_nginx_config
@ -142,9 +142,9 @@ ynh_system_user_create --username=$app
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=3
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=3
# Create a dedicated php-fpm config
# Create a dedicated PHP-FPM config
ynh_add_fpm_config
#=================================================
@ -189,7 +189,7 @@ chmod 755 -R $final_path/_data
#=================================================
# UPGRADE APPLICATION WITH CURL
#=================================================
ynh_script_progression --message="Upgrading piwigo with Curl..." --weight=6
ynh_script_progression --message="Upgrading Piwigo with cURL..." --weight=6
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
# Reload SSOwat config
@ -210,7 +210,7 @@ ynh_local_curl "/upgrade.php?language=$applanguage&now=true" "language=$applangu
#=================================================
# CONFIGURE PIWIGO
#=================================================
ynh_script_progression --message="Configuring piwigo..."
ynh_script_progression --message="Configuring Piwigo..."
# Make a backup of the original config file if modified
ynh_backup_if_checksum_is_different --file="$final_path/local/config/config.inc.php"
@ -269,7 +269,7 @@ fi
#=================================================
# UPGRADE FAIL2BAN
#=================================================
ynh_script_progression --message="Reconfiguring fail2ban..." --weight=8
ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=8
# Configure and activate log_failed_logins plugin
ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< "INSERT INTO plugins (id,state,version) VALUES ('log_failed_logins','active','1.2');" 2>&1 > /dev/null || ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< "UPDATE plugins SET state='active' WHERE id='log_failed_logins';"
@ -297,7 +297,7 @@ fi
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading nginx web server..."
ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload
@ -305,4 +305,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Upgrade of $app completed" --last
ynh_script_progression --message="Upgrade of Pixigo completed" --last