mirror of
https://github.com/YunoHost-Apps/piwigo_ynh.git
synced 2024-09-03 20:06:03 +02:00
parent
09afe78325
commit
d0b7de496c
11 changed files with 55 additions and 72 deletions
|
@ -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.
|
||||
|
||||
**Shipped version:** 2.10.2
|
||||
**Shipped version:** 11.3.0
|
||||
|
||||
## Screenshots
|
||||
|
||||
|
|
|
@ -13,18 +13,15 @@
|
|||
setup_private=1
|
||||
setup_public=1
|
||||
upgrade=1
|
||||
upgrade=1 from_commit=f7a6d6ca2dbbd39f20d299478c28f92e83f6f53c
|
||||
upgrade=1 from_commit=d28c7cd4613a7455f316c91920a065676730ca46
|
||||
backup_restore=1
|
||||
multi_instance=1
|
||||
incorrect_path=1
|
||||
port_already_use=0
|
||||
change_url=1
|
||||
;;; Levels
|
||||
Level 5=auto
|
||||
;;; Options
|
||||
Email=
|
||||
Notification=none
|
||||
;;; Upgrade options
|
||||
; commit=f7a6d6ca2dbbd39f20d299478c28f92e83f6f53c
|
||||
name=Take more official review comments into account
|
||||
; commit=d28c7cd4613a7455f316c91920a065676730ca46
|
||||
name=Upgrade to upstream version 2.9.5
|
||||
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
SOURCE_URL=http://piwigo.org/download/dlcounter.php?code=2.10.2
|
||||
SOURCE_SUM=0de75de7da9d9b8058e208cf78d6f20852a790fca6d8231d432f3f62d12939ff
|
||||
SOURCE_URL=https://piwigo.org/download/dlcounter.php?code=11.3.0
|
||||
SOURCE_SUM=07b0a364484c85acecf9abd6ac2b87e9c8793795b760134b4fab96be99228943
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=zip
|
||||
SOURCE_IN_SUBDIR=true
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
$conf['dblayer'] = 'mysqli';
|
||||
$conf['db_base'] = '__DBTOCHANGE__';
|
||||
$conf['db_user'] = '__USERTOCHANGE__';
|
||||
$conf['db_password'] = '__PASSTOCHANGE__';
|
||||
$conf['db_base'] = '__DB_NAME__';
|
||||
$conf['db_user'] = '__DB_NAME__';
|
||||
$conf['db_password'] = '__DB_PWD__';
|
||||
$conf['db_host'] = 'localhost';
|
||||
|
||||
$prefixeTable = '';
|
||||
|
|
|
@ -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~ynh2",
|
||||
"version": "11.3.0~ynh1",
|
||||
"url": "http://piwigo.org",
|
||||
"license": "GPL-2.0",
|
||||
"maintainer": {
|
||||
|
@ -20,7 +20,7 @@
|
|||
"multi_instance": true,
|
||||
"services": [
|
||||
"nginx",
|
||||
"php7.0-fpm",
|
||||
"php7.3-fpm",
|
||||
"mysql"
|
||||
],
|
||||
"arguments": {
|
||||
|
@ -69,7 +69,7 @@
|
|||
"en": "Choose the application language",
|
||||
"fr": "Choisissez la langue de l'application"
|
||||
},
|
||||
"choices": ["fr", "en"],
|
||||
"choices": ["de", "en", "es", "fr", "it", "pt"],
|
||||
"default": "en"
|
||||
}
|
||||
]
|
||||
|
|
|
@ -11,14 +11,6 @@
|
|||
- [ ] Upgrade from last version tested.
|
||||
- [ ] Can be reviewed and tested.
|
||||
|
||||
## Validation
|
||||
## Package_check results
|
||||
---
|
||||
*Minor decision*
|
||||
- **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.
|
||||
* 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!"*
|
||||
|
|
|
@ -46,5 +46,5 @@ ynh_smart_mktemp () {
|
|||
ynh_die "Insufficient free space to continue..."
|
||||
fi
|
||||
|
||||
echo "$(sudo mktemp --directory --tmpdir="$tmpdir")"
|
||||
echo "$(mktemp --directory --tmpdir="$tmpdir")"
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
|
|||
# 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
|
||||
|
|
|
@ -65,8 +65,9 @@ ynh_install_app_dependencies "$pkg_dependencies"
|
|||
ynh_script_progression --message="Creating a MySQL database..."
|
||||
|
||||
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_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
|
||||
|
@ -138,7 +139,7 @@ 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
|
||||
ynh_add_fpm_config
|
||||
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_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
||||
# Reload SSOwat config
|
||||
yunohost app ssowatconf
|
||||
# Set the app as temporarily public for cURL call
|
||||
ynh_permission_update --permission="main" --add="visitors"
|
||||
|
||||
# Reload Nginx
|
||||
# Reload NGINX
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
# Generate random password for admin
|
||||
|
@ -163,10 +163,10 @@ else
|
|||
applanguage="en_UK"
|
||||
fi
|
||||
|
||||
# Configure piwigo via curl
|
||||
# Configure Piwigo via cURL
|
||||
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"
|
||||
|
||||
#=================================================
|
||||
|
@ -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"
|
||||
|
||||
# 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_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
|
||||
ynh_add_config --template="../conf/database.inc.php" --destination="$final_path/local/config/database.inc.php"
|
||||
|
||||
# Calculate and store the database config file checksum
|
||||
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
|
||||
#=================================================
|
||||
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 ]
|
||||
then
|
||||
ynh_app_setting_delete --app=$app --key=unprotected_uris
|
||||
ynh_app_setting_set --app=$app --key=protected_uris --value="/"
|
||||
ynh_permission_update --permission="main" --remove="visitors"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -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_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
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -24,6 +24,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|||
language=$(ynh_app_setting_get --app=$app --key=language)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
admin_pwd=$(ynh_app_setting_get --app=$app --key=admin_pwd)
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
|
@ -74,6 +75,13 @@ then
|
|||
ynh_app_setting_delete --app=$app --key=path_url
|
||||
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
|
||||
#=================================================
|
||||
|
@ -88,13 +96,6 @@ ynh_clean_setup () {
|
|||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# CHECK THE PATH
|
||||
#=================================================
|
||||
|
||||
# Normalize the URL path syntax
|
||||
path_url=$(ynh_normalize_url_path --path_url=$path_url)
|
||||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
#=================================================
|
||||
|
@ -120,7 +121,7 @@ fi
|
|||
#=================================================
|
||||
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
|
||||
|
||||
# Create a dedicated nginx config
|
||||
# Create a dedicated NGINX config
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
|
@ -128,7 +129,7 @@ ynh_add_nginx_config
|
|||
#=================================================
|
||||
ynh_script_progression --message="Upgrading dependencies..." --weight=6
|
||||
|
||||
ynh_install_app_dependencies "$pkg_dependencies"
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
|
@ -190,11 +191,16 @@ chmod 755 -R $final_path/_data
|
|||
#=================================================
|
||||
ynh_script_progression --message="Upgrading Piwigo with cURL..." --weight=6
|
||||
|
||||
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
||||
# Reload SSOwat config
|
||||
yunohost app ssowatconf
|
||||
# Set the app as temporarily public for cURL call
|
||||
ynh_permission_has_user --permission="main" --user="visitors"
|
||||
contains_visitors=$?
|
||||
|
||||
# Reload Nginx
|
||||
if [ $contains_visitors -eq 1 ]
|
||||
then
|
||||
ynh_permission_update --permission="main" --add="visitors"
|
||||
fi
|
||||
|
||||
# Reload NGINX
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
if [ "$language" = "fr" ] ; then
|
||||
|
@ -203,7 +209,7 @@ else
|
|||
applanguage="en_UK"
|
||||
fi
|
||||
|
||||
# Upgrade piwigo via curl
|
||||
# Upgrade Piwigo via cURL
|
||||
ynh_local_curl "/upgrade.php?language=$applanguage&now=true" "language=$applanguage" "username=$admin" "password=$admin_pwd"
|
||||
|
||||
#=================================================
|
||||
|
@ -223,13 +229,7 @@ ynh_store_file_checksum --file="$final_path/local/config/config.inc.php"
|
|||
# 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"
|
||||
|
||||
# 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_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
|
||||
ynh_add_config --template="../conf/database.inc.php" --destination="$final_path/local/config/database.inc.php"
|
||||
|
||||
# Calculate and store the database config file checksum
|
||||
ynh_store_file_checksum --file="$final_path/local/config/database.inc.php"
|
||||
|
@ -279,20 +279,19 @@ chown $app: "/var/log/${app}FailedLogins.log"
|
|||
|
||||
ynh_add_fail2ban_config --logpath="/var/log/${app}FailedLogins.log" --failregex="ip=<HOST>" --max_retry=6
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading SSOwat configuration..."
|
||||
ynh_script_progression --message="Configuring permissions..."
|
||||
|
||||
# Protect URIs if private
|
||||
# Make app public if necessary
|
||||
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="/"
|
||||
ynh_permission_update --permission="main" --remove="visitors"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue