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 version 11.3.0 (#59)

* Upgrade to version 11.3.0
This commit is contained in:
Éric Gaspar 2021-02-17 18:17:11 +01:00 committed by GitHub
parent 47e0f80b94
commit 5f7c0e4e30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 38 additions and 62 deletions

View file

@ -10,7 +10,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to
[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. [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 **Shipped version:** 11.3.0
## Screenshots ## Screenshots

View file

@ -13,16 +13,15 @@
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
upgrade=1 from_commit=f7a6d6ca2dbbd39f20d299478c28f92e83f6f53c upgrade=1 from_commit=d28c7cd4613a7455f316c91920a065676730ca46
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
incorrect_path=1
port_already_use=0 port_already_use=0
change_url=1 change_url=1
;;; Options ;;; Options
Email= Email=
Notification=none Notification=none
;;; Upgrade options ;;; Upgrade options
; commit=f7a6d6ca2dbbd39f20d299478c28f92e83f6f53c ; commit=d28c7cd4613a7455f316c91920a065676730ca46
name=Take more official review comments into account name=Upgrade to upstream version 2.9.5
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1& manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&

View file

@ -1,5 +1,5 @@
SOURCE_URL=http://piwigo.org/download/dlcounter.php?code=2.10.2 SOURCE_URL=https://piwigo.org/download/dlcounter.php?code=11.3.0
SOURCE_SUM=0de75de7da9d9b8058e208cf78d6f20852a790fca6d8231d432f3f62d12939ff SOURCE_SUM=07b0a364484c85acecf9abd6ac2b87e9c8793795b760134b4fab96be99228943
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -1,8 +1,8 @@
<?php <?php
$conf['dblayer'] = 'mysqli'; $conf['dblayer'] = 'mysqli';
$conf['db_base'] = '__DBTOCHANGE__'; $conf['db_base'] = '__DB_NAME__';
$conf['db_user'] = '__USERTOCHANGE__'; $conf['db_user'] = '__DB_NAME__';
$conf['db_password'] = '__PASSTOCHANGE__'; $conf['db_password'] = '__DB_PWD__';
$conf['db_host'] = 'localhost'; $conf['db_host'] = 'localhost';
$prefixeTable = ''; $prefixeTable = '';

View file

@ -6,7 +6,7 @@
"en": "Open source photo gallery for the web", "en": "Open source photo gallery for the web",
"fr": "Galerie de photos open source pour le web" "fr": "Galerie de photos open source pour le web"
}, },
"version": "2.10.2~ynh2", "version": "11.3.0~ynh1",
"url": "http://piwigo.org", "url": "http://piwigo.org",
"license": "GPL-2.0", "license": "GPL-2.0",
"maintainer": { "maintainer": {
@ -20,7 +20,7 @@
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
"nginx", "nginx",
"php7.0-fpm", "php7.3-fpm",
"mysql" "mysql"
], ],
"arguments": { "arguments": {
@ -69,7 +69,7 @@
"en": "Choose the application language", "en": "Choose the application language",
"fr": "Choisissez la langue de l'application" "fr": "Choisissez la langue de l'application"
}, },
"choices": ["fr", "en"], "choices": ["de", "en", "es", "fr", "it", "pt"],
"default": "en" "default": "en"
} }
] ]

View file

@ -11,14 +11,6 @@
- [ ] Upgrade from last version tested. - [ ] Upgrade from last version tested.
- [ ] Can be reviewed and tested. - [ ] Can be reviewed and tested.
## Validation ## Package_check results
--- ---
*Minor decision* * An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"*
- **Upgrade previous version** :
- [ ] **Code review** :
- [ ] **Approval (LGTM)** :
- [ ] **Approval (LGTM)** :
- **CI succeeded** :
[![Build Status](https://ci-apps-hq.yunohost.org/jenkins/job/piwigo_ynh%20PR-NUM-/badge/icon)](https://ci-apps-hq.yunohost.org/jenkins/job/piwigo_ynh%20PR-NUM-/)
*Please replace '-NUM-' in this link by the PR number.*
When the PR is marked as ready to merge, you have to wait for 3 days before really merging it.

View file

@ -69,7 +69,7 @@ ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
# BACKUP THE DATA DIRECTORY # BACKUP THE DATA DIRECTORY
#================================================= #=================================================
ynh_backup --src_path="/home/yunohost.app/${app}/upload" --is_big ynh_backup --src_path="/home/yunohost.app/$app/upload" --is_big
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -65,8 +65,9 @@ ynh_install_app_dependencies "$pkg_dependencies"
ynh_script_progression --message="Creating a MySQL database..." ynh_script_progression --message="Creating a MySQL database..."
db_name=$(ynh_sanitize_dbid --db_name=$app) db_name=$(ynh_sanitize_dbid --db_name=$app)
db_user=$db_name
ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name
ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -138,7 +139,7 @@ ynh_secure_remove --file="$tmpdir"
ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION ynh_add_fpm_config
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
@ -146,11 +147,10 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
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="/" # Set the app as temporarily public for cURL call
# Reload SSOwat config ynh_permission_update --permission="main" --add="visitors"
yunohost app ssowatconf
# Reload Nginx # Reload NGINX
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
# Generate random password for admin # Generate random password for admin
@ -163,10 +163,10 @@ else
applanguage="en_UK" applanguage="en_UK"
fi fi
# Configure piwigo via curl # Configure Piwigo via cURL
mail="$(ynh_user_get_info --username=$admin --key=mail)" mail="$(ynh_user_get_info --username=$admin --key=mail)"
# Installation with curl # Installation with cURL
ynh_local_curl "/install.php?language=$applanguage" "install=true" "dbuser=$db_name" "dbpasswd=$db_pwd" "dbname=$db_name" "admin_name=$admin" "admin_pass1=$adm_pwd" "admin_pass2=$adm_pwd" "admin_mail=$mail" ynh_local_curl "/install.php?language=$applanguage" "install=true" "dbuser=$db_name" "dbpasswd=$db_pwd" "dbname=$db_name" "admin_name=$admin" "admin_pass1=$adm_pwd" "admin_pass2=$adm_pwd" "admin_mail=$mail"
#================================================= #=================================================
@ -181,11 +181,7 @@ cp ../conf/config.inc.php $final_path/local/config/
ynh_store_file_checksum --file="$final_path/local/config/config.inc.php" ynh_store_file_checksum --file="$final_path/local/config/config.inc.php"
# Setup database in local/config/database.inc.php # Setup database in local/config/database.inc.php
ynh_replace_string --match_string="__DBTOCHANGE__" --replace_string="$db_name" --target_file=../conf/database.inc.php ynh_add_config --template="../conf/database.inc.php" --destination="$final_path/local/config/database.inc.php"
ynh_replace_string --match_string="__USERTOCHANGE__" --replace_string="$db_name" --target_file=../conf/database.inc.php
ynh_replace_string --match_string="__PASSTOCHANGE__" --replace_string="$db_pwd" --target_file=../conf/database.inc.php
cp ../conf/database.inc.php $final_path/local/config/database.inc.php
# Calculate and store the database config file checksum # Calculate and store the database config file checksum
ynh_store_file_checksum --file="$final_path/local/config/database.inc.php" ynh_store_file_checksum --file="$final_path/local/config/database.inc.php"
@ -235,13 +231,12 @@ ynh_add_fail2ban_config --logpath="/var/log/${app}FailedLogins.log" --failregex=
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Configuring SSOwat..." ynh_script_progression --message="Configuring permissions..."
# Protect URIs if private # Make app public if necessary
if [ $is_public -eq 0 ] if [ $is_public -eq 0 ]
then then
ynh_app_setting_delete --app=$app --key=unprotected_uris ynh_permission_update --permission="main" --remove="visitors"
ynh_app_setting_set --app=$app --key=protected_uris --value="/"
fi fi
#================================================= #=================================================

View file

@ -130,7 +130,7 @@ chown -R $app: /home/yunohost.app/$app
#================================================= #=================================================
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=php${phpversion}-fpm --action=reload ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================

View file

@ -24,6 +24,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
language=$(ynh_app_setting_get --app=$app --key=language) language=$(ynh_app_setting_get --app=$app --key=language)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
admin_pwd=$(ynh_app_setting_get --app=$app --key=admin_pwd) admin_pwd=$(ynh_app_setting_get --app=$app --key=admin_pwd)
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
@ -74,6 +75,13 @@ then
ynh_app_setting_delete --app=$app --key=path_url ynh_app_setting_delete --app=$app --key=path_url
fi fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
@ -121,7 +129,7 @@ ynh_add_nginx_config
#================================================= #=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=6 ynh_script_progression --message="Upgrading dependencies..." --weight=6
ynh_install_app_dependencies "$pkg_dependencies" ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
@ -216,13 +224,7 @@ ynh_store_file_checksum --file="$final_path/local/config/config.inc.php"
# Make a backup of the original database config file if modified # Make a backup of the original database config file if modified
ynh_backup_if_checksum_is_different --file="$final_path/local/config/database.inc.php" ynh_backup_if_checksum_is_different --file="$final_path/local/config/database.inc.php"
# Setup database in local/config/database.inc.php ynh_add_config --template="../conf/database.inc.php" --destination="$final_path/local/config/database.inc.php"
ynh_replace_string --match_string="__DBTOCHANGE__" --replace_string="$db_name" --target_file=../conf/database.inc.php
ynh_replace_string --match_string="__USERTOCHANGE__" --replace_string="$db_name" --target_file=../conf/database.inc.php
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
ynh_replace_string --match_string="__PASSTOCHANGE__" --replace_string="$db_pwd" --target_file=../conf/database.inc.php
cp ../conf/database.inc.php $final_path/local/config/database.inc.php
# Calculate and store the database config file checksum # Calculate and store the database config file checksum
ynh_store_file_checksum --file="$final_path/local/config/database.inc.php" ynh_store_file_checksum --file="$final_path/local/config/database.inc.php"
@ -274,18 +276,6 @@ ynh_add_fail2ban_config --logpath="/var/log/${app}FailedLogins.log" --failregex=
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Upgrading SSOwat configuration..."
# Protect URIs if private
if [ $is_public -eq 0 ]
then
ynh_app_setting_delete --app=$app --key=unprotected_uris
ynh_app_setting_set --app=$app --key=protected_uris --value="/"
fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================