From 3062eb240016aca76a24250676256ea4ae345759 Mon Sep 17 00:00:00 2001 From: ericgaspar <junk.eg@free.fr> Date: Fri, 2 Oct 2020 22:47:47 +0200 Subject: [PATCH 1/7] Upgrade to PHP7.3 --- README.md | 6 ++---- conf/nginx.conf | 2 +- conf/php-fpm.conf | 2 +- scripts/_common.sh | 6 +++++- scripts/backup | 21 +++++++++------------ scripts/change_url | 4 ++-- scripts/install | 19 ++++++++++--------- scripts/remove | 14 +++++++------- scripts/restore | 14 ++++++++------ scripts/upgrade | 18 +++++++++--------- 10 files changed, 54 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index 54cec76..e2183c1 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,8 @@ this package: #### Supported architectures -* x86-64b - [](https://ci-apps.yunohost.org/ci/apps/piwigo/) +* x86-64 - [](https://ci-apps.yunohost.org/ci/apps/piwigo/) * ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/piwigo/) -* Jessie x86-64b - [](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). diff --git a/conf/nginx.conf b/conf/nginx.conf index 68d3796..212efee 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -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; diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index 948989e..45646cf 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -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) diff --git a/scripts/_common.sh b/scripts/_common.sh index a113f98..7844459 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -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 diff --git a/scripts/backup b/scripts/backup index 6457b45..6ae658e 100644 --- a/scripts/backup +++ b/scripts/backup @@ -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)." diff --git a/scripts/change_url b/scripts/change_url index eb90e04..25f9100 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -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 diff --git a/scripts/install b/scripts/install index b9a029e..0c542fa 100644 --- a/scripts/install +++ b/scripts/install @@ -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 diff --git a/scripts/remove b/scripts/remove index a10e8f4..c63a0b9 100644 --- a/scripts/remove +++ b/scripts/remove @@ -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 diff --git a/scripts/restore b/scripts/restore index e8dd68a..2db8998 100644 --- a/scripts/restore +++ b/scripts/restore @@ -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 diff --git a/scripts/upgrade b/scripts/upgrade index 8dfc93d..60b8060 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 From b8cf85be2603b1444db9769c21ab0c8f822bb182 Mon Sep 17 00:00:00 2001 From: ericgaspar <junk.eg@free.fr> Date: Fri, 2 Oct 2020 22:51:31 +0200 Subject: [PATCH 2/7] Update README.md --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e2183c1..1e0825b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Piwigo for YunoHost -[](https://dash.yunohost.org/appci/app/piwigo) +[](https://dash.yunohost.org/appci/app/piwigo)   [](https://install-app.yunohost.org/?app=piwigo) > *This package allow you to install Piwigo quickly and simply on a YunoHost server. @@ -31,9 +31,7 @@ Extensions make Piwigo easily customizable. Icing on the cake, Piwigo is free an ## YunoHost specific features -In addition to Piwigo core features, the following are made available with -this package: - +In addition to Piwigo core features, the following are made available with this package: * Integrate with YunoHost users and SSO: * private mode: limit access to Yunohost users * public mode: From ccd21535079e4554be71625c00e42573c418c023 Mon Sep 17 00:00:00 2001 From: ericgaspar <junk.eg@free.fr> Date: Fri, 2 Oct 2020 22:53:18 +0200 Subject: [PATCH 3/7] Update manifest.json --- manifest.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index 4a66ac9..7b3e1f6 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,8 @@ "id": "piwigo", "packaging_format": 1, "description": { - "en": "photo gallery", - "fr": "Galerie photo" + "en": "Open source photo gallery for the web", + "fr": "Galerie de photos open source pour le web" }, "version": "2.10.2~ynh1", "url": "http://piwigo.org", @@ -15,7 +15,7 @@ "url": "" }, "requirements": { - "yunohost": ">= 3.5.0" + "yunohost": ">= 3.8.1" }, "multi_instance": true, "services": [ From c80c54e973a9b4a8d8ad89f77116b13ac8687ed3 Mon Sep 17 00:00:00 2001 From: ericgaspar <junk.eg@free.fr> Date: Fri, 2 Oct 2020 22:55:23 +0200 Subject: [PATCH 4/7] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 1e0825b..dbdf327 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Piwigo for YunoHost -[](https://dash.yunohost.org/appci/app/piwigo)   +[](https://dash.yunohost.org/appci/app/piwigo)   [](https://install-app.yunohost.org/?app=piwigo) > *This package allow you to install Piwigo quickly and simply on a YunoHost server. @@ -19,7 +19,6 @@ Extensions make Piwigo easily customizable. Icing on the cake, Piwigo is free an ## Demo -* [YunoHost demo](https://demo.yunohost.org/piwigo/) * [Official demo](http://piwigo.org/demo/) ## Configuration From bc33bc83f425adba610cd9c156f6a970017a4c0b Mon Sep 17 00:00:00 2001 From: ericgaspar <junk.eg@free.fr> Date: Sat, 3 Oct 2020 08:37:51 +0200 Subject: [PATCH 5/7] Fix --- manifest.json | 2 +- scripts/_common.sh | 4 +--- scripts/backup | 2 +- scripts/change_url | 10 +++++----- scripts/install | 4 ++-- scripts/restore | 4 ++-- scripts/upgrade | 2 +- 7 files changed, 13 insertions(+), 15 deletions(-) diff --git a/manifest.json b/manifest.json index 7b3e1f6..a8f55db 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Open source photo gallery for the web", "fr": "Galerie de photos open source pour le web" }, - "version": "2.10.2~ynh1", + "version": "2.10.2~ynh2", "url": "http://piwigo.org", "license": "GPL-2.0", "maintainer": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 7844459..64778a9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,9 +6,7 @@ YNH_PHP_VERSION="7.3" -pkg_dependencies="imagemagick" - -extra_php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-imagick" +pkg_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-imagick imagemagick" #================================================= # EXPERIMENTAL HELPERS diff --git a/scripts/backup b/scripts/backup index 6ae658e..d3cfaab 100644 --- a/scripts/backup +++ b/scripts/backup @@ -75,4 +75,4 @@ ynh_backup --src_path="/home/yunohost.app/${app}/upload" --is_big # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." +ynh_print_info --message="Backup script completed for Piwigo. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index 25f9100..9533ac5 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -54,19 +54,19 @@ ynh_script_progression --message="Updating NGINX web server configuration..." -- nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf -# Change the path in the nginx config file +# Change the path in the NGINX config file if [ $change_path -eq 1 ] then - # Make a backup of the original nginx config file if modified + # Make a backup of the original NGINX config file if modified ynh_backup_if_checksum_is_different --file="$nginx_conf_path" # Set global variables for nginx helper domain="$old_domain" path_url="$new_path" - # Create a dedicated nginx config + # Create a dedicated NGINX config ynh_add_nginx_config fi -# Change the domain for nginx +# Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location @@ -89,4 +89,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --last +ynh_script_progression --message="Change of URL completed for Piwigo" --last diff --git a/scripts/install b/scripts/install index 0c542fa..d5d14e8 100644 --- a/scripts/install +++ b/scripts/install @@ -138,8 +138,8 @@ ynh_secure_remove --file="$tmpdir" #================================================= ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 -# Create a dedicated php-fpm config -ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" +# Create a dedicated PHP-FPM config +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/restore b/scripts/restore index 2db8998..373ad40 100644 --- a/scripts/restore +++ b/scripts/restore @@ -100,7 +100,7 @@ ynh_systemd_action --action=restart --service_name=fail2ban ynh_script_progression --message="Reinstalling dependencies..." --weight=40 # Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies "$pkg_dependencies" #================================================= # RESTORE THE DATA DIRECTORY @@ -111,7 +111,7 @@ ynh_script_progression --message="Restoring data directory..." ynh_restore_file --origin_path="/home/yunohost.app/$app/upload" --not_mandatory # Create app folders -mkdir -p "/home/yunohost.app/$app/upload" +mkdir -p /home/yunohost.app/$app/upload # Create temporary data folder mkdir -p /home/yunohost.app/$app/_data diff --git a/scripts/upgrade b/scripts/upgrade index 60b8060..27b5115 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -305,4 +305,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of Pixigo completed" --last +ynh_script_progression --message="Upgrade of Piwigo completed" --last From 7672ba34c27788c4b7aad5bb40b10ce68224eb87 Mon Sep 17 00:00:00 2001 From: ericgaspar <junk.eg@free.fr> Date: Sat, 3 Oct 2020 09:39:41 +0200 Subject: [PATCH 6/7] Remove ynh_local_curl --- scripts/_ynh_local_curl | 45 ----------------------------------------- scripts/install | 1 - scripts/upgrade | 1 - 3 files changed, 47 deletions(-) delete mode 100644 scripts/_ynh_local_curl diff --git a/scripts/_ynh_local_curl b/scripts/_ynh_local_curl deleted file mode 100644 index ad0d1f7..0000000 --- a/scripts/_ynh_local_curl +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# Curl abstraction to help with POST requests to local pages (such as installation forms) -# For multiple calls, cookies are persisted between each call for the same app -# -# $domain and $path_url should be defined externally (and correspond to the domain.tld and the /path (of the app?)) -# -# example: ynh_local_curl "/install.php?installButton" "foo=$var1" "bar=$var2" -# -# usage: ynh_local_curl "page_uri" "key1=value1" "key2=value2" ... -# | arg: page_uri - Path (relative to $path_url) of the page where POST data will be sent -# | arg: key1=value1 - (Optionnal) POST key and corresponding value -# | arg: key2=value2 - (Optionnal) Another POST key and corresponding value -# | arg: ... - (Optionnal) More POST keys and values -# -# Requires YunoHost version 2.6.4 or higher. -ynh_local_curl () { - # Define url of page to curl - local local_page=$(ynh_normalize_url_path $1) - local full_path=$path_url$local_page - - if [ "${path_url}" == "/" ]; then - full_path=$local_page - fi - - local full_page_url=https://localhost$full_path - - # Concatenate all other arguments with '&' to prepare POST data - local POST_data="" - local arg="" - for arg in "${@:2}" - do - POST_data="${POST_data}${arg}&" - done - if [ -n "$POST_data" ] - then - # Add --data arg and remove the last character, which is an unecessary '&' - POST_data="--data ${POST_data::-1}" - fi - - # Wait untils nginx has fully reloaded (avoid curl fail with http2) - sleep 2 - - # Curl the URL - curl --silent --show-error -kL -H "Host: $domain" --resolve $domain:443:127.0.0.1 $POST_data "$full_page_url" --cookie-jar /tmp/ynh-$app-cookie.txt --cookie /tmp/ynh-$app-cookie.txt -} diff --git a/scripts/install b/scripts/install index d5d14e8..c191ca6 100644 --- a/scripts/install +++ b/scripts/install @@ -8,7 +8,6 @@ source _common.sh source /usr/share/yunohost/helpers -source _ynh_local_curl #================================================= # MANAGE SCRIPT FAILURE diff --git a/scripts/upgrade b/scripts/upgrade index 27b5115..25d4da6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -8,7 +8,6 @@ source _common.sh source /usr/share/yunohost/helpers -source _ynh_local_curl #================================================= # LOAD SETTINGS From 8fe35475e87e2203ad7c513cd3f339086cfb9faf Mon Sep 17 00:00:00 2001 From: ericgaspar <junk.eg@free.fr> Date: Tue, 20 Oct 2020 12:28:31 +0200 Subject: [PATCH 7/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dbdf327..724f1fb 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Extensions make Piwigo easily customizable. Icing on the cake, Piwigo is free an ## Screenshots - + ## Demo