diff --git a/README.md b/README.md index 54cec76..78871d2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Piwigo for YunoHost -[![Integration level](https://dash.yunohost.org/integration/piwigo.svg)](https://dash.yunohost.org/appci/app/piwigo) +[![Integration level](https://dash.yunohost.org/integration/piwigo.svg)](https://dash.yunohost.org/appci/app/piwigo) ![](https://ci-apps.yunohost.org/ci/badges/piwigo.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/piwigo.maintain.svg) [![Install Piwigo with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=piwigo) > *This package allow you to install Piwigo quickly and simply on a YunoHost server. @@ -8,18 +8,16 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview -[Piwigo](http://piwigo.org) is a photo gallery software for the web, built by an active community of users and developers -Extensions make Piwigo easily customizable. Icing on the cake, Piwigo is free and opensource. +[Piwigo](http://piwigo.org) is a photo gallery software for the web, built by an active community of users and developers. Extensions make Piwigo easily customizable. **Shipped version:** 2.10.2 ## Screenshots -![](http://piwigo.org/screenshots/homepage/piwigo-batch-manager.png) +![](sources/screenshot_Piwigo.jpg) ## Demo -* [YunoHost demo](https://demo.yunohost.org/piwigo/) * [Official demo](http://piwigo.org/demo/) ## Configuration @@ -31,11 +29,9 @@ 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 + * private mode: limit access to YunoHost users * public mode: * SSO for YunoHost users * allow other users management, and guest mode @@ -43,9 +39,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 +55,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/manifest.json b/manifest.json index 4a66ac9..a8f55db 100644 --- a/manifest.json +++ b/manifest.json @@ -3,10 +3,10 @@ "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", + "version": "2.10.2~ynh2", "url": "http://piwigo.org", "license": "GPL-2.0", "maintainer": { @@ -15,7 +15,7 @@ "url": "" }, "requirements": { - "yunohost": ">= 3.5.0" + "yunohost": ">= 3.8.1" }, "multi_instance": true, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index a113f98..64778a9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,9 @@ # COMMON VARIABLES #================================================= -pkg_dependencies="php-gd php-imagick imagemagick" +YNH_PHP_VERSION="7.3" + +pkg_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-imagick imagemagick" #================================================= # EXPERIMENTAL HELPERS 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/backup b/scripts/backup index 6457b45..d3cfaab 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 Piwigo. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index eb90e04..9533ac5 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -50,23 +50,23 @@ 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 -# 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 @@ -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 @@ -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 b9a029e..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 @@ -96,9 +95,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 +135,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 +# Create a dedicated PHP-FPM config +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION +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 +172,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 +219,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 +247,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 +255,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..38fb466 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="Restoring Piwigo 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" @@ -98,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 @@ -109,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 @@ -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..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 @@ -78,7 +77,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 +118,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 +141,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 +188,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 +209,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 +268,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 +296,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 +304,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 Piwigo completed" --last diff --git a/sources/screenshot_Piwigo.jpg b/sources/screenshot_Piwigo.jpg new file mode 100644 index 0000000..09c80ae Binary files /dev/null and b/sources/screenshot_Piwigo.jpg differ