1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/galette_ynh.git synced 2024-09-03 18:36:28 +02:00

Merge pull request #29 from YunoHost-Apps/fix

Fix missing $database during upgrade
This commit is contained in:
yalh76 2022-06-26 18:04:36 +02:00 committed by GitHub
commit 707ca4784e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 79 additions and 82 deletions

View file

@ -5,7 +5,7 @@ It shall NOT be edited by hand.
# Galette for YunoHost # Galette for YunoHost
[![Integration level](https://dash.yunohost.org/integration/galette.svg)](https://dash.yunohost.org/appci/app/galette) ![](https://ci-apps.yunohost.org/ci/badges/galette.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/galette.maintain.svg) [![Integration level](https://dash.yunohost.org/integration/galette.svg)](https://dash.yunohost.org/appci/app/galette) ![Working status](https://ci-apps.yunohost.org/ci/badges/galette.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/galette.maintain.svg)
[![Install Galette with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=galette) [![Install Galette with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=galette)
*[Lire ce readme en français.](./README_fr.md)* *[Lire ce readme en français.](./README_fr.md)*
@ -15,40 +15,35 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
## Overview ## Overview
Membership management web application for non profit organizations Galette is a membership management web application towards non profit organizations.
**Shipped version:** 0.9.5.2~ynh1
**Shipped version:** 0.9.5.2~ynh3
**Demo:** https://demo.galette.eu/login **Demo:** https://demo.galette.eu/login
## Screenshots ## Screenshots
![](./doc/screenshots/edit_member.png) ![Screenshot of Galette](./doc/screenshots/edit_member.png)
## Disclaimers / important information
## Configuration
1. The app will require to complete the registration process after the instllation is complete by visiting the domain on which Galette is installed.
1. The Postgresql database credentials will be sent to the admin mail. Fill these details while doing the registration process.
## Documentation and resources ## Documentation and resources
* Official app website: https://www.galette.eu * Official app website: <https://www.galette.eu>
* Official admin documentation: https://doc.galette.eu/fr/master/ * Official admin documentation: <https://doc.galette.eu/fr/master/>
* Upstream app code repository: https://github.com/galette/galette * Upstream app code repository: <https://github.com/galette/galette>
* YunoHost documentation for this app: https://yunohost.org/app_galette * YunoHost documentation for this app: <https://yunohost.org/app_galette>
* Report a bug: https://github.com/YunoHost-Apps/galette_ynh/issues * Report a bug: <https://github.com/YunoHost-Apps/galette_ynh/issues>
## Developer info ## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/galette_ynh/tree/testing). Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/galette_ynh/tree/testing).
To try the testing branch, please proceed like that. To try the testing branch, please proceed like that.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/galette_ynh/tree/testing --debug sudo yunohost app install https://github.com/YunoHost-Apps/galette_ynh/tree/testing --debug
or or
sudo yunohost app upgrade galette -u https://github.com/YunoHost-Apps/galette_ynh/tree/testing --debug sudo yunohost app upgrade galette -u https://github.com/YunoHost-Apps/galette_ynh/tree/testing --debug
``` ```
**More info regarding app packaging:** https://yunohost.org/packaging_apps **More info regarding app packaging:** <https://yunohost.org/packaging_apps>

View file

@ -1,10 +1,14 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# Galette pour YunoHost # Galette pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/galette.svg)](https://dash.yunohost.org/appci/app/galette) ![](https://ci-apps.yunohost.org/ci/badges/galette.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/galette.maintain.svg) [![Niveau d'intégration](https://dash.yunohost.org/integration/galette.svg)](https://dash.yunohost.org/appci/app/galette) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/galette.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/galette.maintain.svg)
[![Installer Galette avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=galette) [![Installer Galette avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=galette)
*[Read this readme in english.](./README.md)* *[Read this readme in english.](./README.md)*
*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer Galette rapidement et simplement sur un serveur YunoHost. > *Ce package vous permet d'installer Galette rapidement et simplement sur un serveur YunoHost.
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
@ -13,38 +17,33 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
Outil de gestion d'adhérents et de cotisation en ligne pour associations Outil de gestion d'adhérents et de cotisation en ligne pour associations
**Version incluse :** 0.9.5.2~ynh1
**Version incluse :** 0.9.5.2~ynh3
**Démo :** https://demo.galette.eu/login **Démo :** https://demo.galette.eu/login
## Captures d'écran ## Captures d'écran
![](./doc/screenshots/edit_member.png) ![Capture d'écran de Galette](./doc/screenshots/edit_member.png)
## Avertissements / informations importantes
## Configuration
1. Une fois l'installation terminée, l'application devra terminer le processus d'enregistrement en **visitant le domaine** sur lequel Galette est installé.
1. Les informations d'identification de la base de données Postgresql seront envoyées à **l'email admin**. Remplissez ces détails lors du processus d'inscription.
## Documentations et ressources ## Documentations et ressources
* Site officiel de l'app : https://www.galette.eu * Site officiel de l'app : <https://www.galette.eu>
* Documentation officielle de l'admin : https://doc.galette.eu/fr/master/ * Documentation officielle de l'admin : <https://doc.galette.eu/fr/master/>
* Dépôt de code officiel de l'app : https://github.com/galette/galette * Dépôt de code officiel de l'app : <https://github.com/galette/galette>
* Documentation YunoHost pour cette app : https://yunohost.org/app_galette * Documentation YunoHost pour cette app : <https://yunohost.org/app_galette>
* Signaler un bug : https://github.com/YunoHost-Apps/galette_ynh/issues * Signaler un bug : <https://github.com/YunoHost-Apps/galette_ynh/issues>
## Informations pour les développeurs ## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/galette_ynh/tree/testing). Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/galette_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit. Pour essayer la branche testing, procédez comme suit.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/galette_ynh/tree/testing --debug sudo yunohost app install https://github.com/YunoHost-Apps/galette_ynh/tree/testing --debug
ou ou
sudo yunohost app upgrade galette -u https://github.com/YunoHost-Apps/galette_ynh/tree/testing --debug sudo yunohost app upgrade galette -u https://github.com/YunoHost-Apps/galette_ynh/tree/testing --debug
``` ```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps **Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>

View file

@ -14,6 +14,7 @@
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
# 0.9.5~ynh1
upgrade=1 from_commit=d05248ceeffca8401dea6ac14bf7af7096345cbe upgrade=1 from_commit=d05248ceeffca8401dea6ac14bf7af7096345cbe
# 0.9.5.2~ynh1 # 0.9.5.2~ynh1
upgrade=1 from_commit=3c3d7d56540e12245f45dc7c3b9334285ac475ca upgrade=1 from_commit=3c3d7d56540e12245f45dc7c3b9334285ac475ca
@ -44,7 +45,3 @@
;;; Options ;;; Options
Email= Email=
Notification=none Notification=none
;;; Upgrade options
; commit=d05248ceeffca8401dea6ac14bf7af7096345cbe
name=Merge pull request #14
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=1

View file

@ -1 +1 @@
Outil de gestion d'adhérents et de cotisation en ligne pour associations Outil de gestion d'adhérents et de cotisation en ligne pour associations

View file

@ -6,7 +6,7 @@
"en": "Membership management web application for non profit organizations", "en": "Membership management web application for non profit organizations",
"fr": "Outil de gestion d'adhérents et de cotisation en ligne pour associations" "fr": "Outil de gestion d'adhérents et de cotisation en ligne pour associations"
}, },
"version": "0.9.5.2~ynh2", "version": "0.9.5.2~ynh3",
"url": "https://www.galette.eu", "url": "https://www.galette.eu",
"upstream": { "upstream": {
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",

View file

@ -71,7 +71,7 @@ then
ynh_psql_dump_db --database="$db_name" > db.sql ynh_psql_dump_db --database="$db_name" > db.sql
else else
ynh_print_info --message="Backing up the MySQL database..." ynh_print_info --message="Backing up the MySQL database..."
ynh_mysql_dump_db --database="$db_name" > db.sql ynh_mysql_dump_db --database="$db_name" > db.sql
fi fi
#================================================= #=================================================

View file

@ -105,14 +105,6 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
@ -122,6 +114,14 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
ynh_add_fpm_config ynh_add_fpm_config
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================

View file

@ -43,13 +43,6 @@ test ! -d $final_path \
#================================================= #=================================================
# STANDARD RESTORATION STEPS # STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER
#================================================= #=================================================
@ -69,15 +62,6 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
ynh_add_fpm_config
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================
@ -91,6 +75,22 @@ fi
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
ynh_add_fpm_config
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RESTORE THE SQL DATABASE # RESTORE THE SQL DATABASE
#================================================= #=================================================

View file

@ -54,6 +54,13 @@ ynh_abort_if_errors
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=2 ynh_script_progression --message="Ensuring downward compatibility..." --weight=2
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
# If db_name doesn't exist, create it # If db_name doesn't exist, create it
if [ -z "$db_name" ]; then if [ -z "$db_name" ]; then
db_name=$(ynh_sanitize_dbid "$app") db_name=$(ynh_sanitize_dbid "$app")
@ -72,11 +79,10 @@ if [ -z "$final_path" ]; then
ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi fi
# Cleaning legacy permissions # If database doesn't exist, create it
if ynh_legacy_permissions_exists; then if [ -z "$database" ]; then
ynh_legacy_permissions_delete_all database="pgsql"
ynh_app_setting_set --app=$app --key=database --value=$database
ynh_app_setting_delete --app=$app --key=is_public
fi fi
#================================================= #=================================================
@ -98,13 +104,13 @@ then
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
mv "$final_path" "$final_path.old" mv "$final_path" "$final_path.old"
ynh_setup_source "$final_path" ynh_setup_source --dest_dir="$final_path"
#ynh_secure_remove "$final_path"/tests
# when running automatic tests, there is no config.inc.php # when running automatic tests, there is no config.inc.php
if [ -e "$final_path.old/galette/config/config.inc.php" ]; then if [ -e "$final_path.old/galette/config/config.inc.php" ]; then
cp "$final_path.old/galette/config/config.inc.php" "$final_path/galette/config/config.inc.php" cp "$final_path.old/galette/config/config.inc.php" "$final_path/galette/config/config.inc.php"
cp -r "$final_path.old/galette/data" "$final_path/galette/data" cp -r "$final_path.old/galette/data" "$final_path/galette/data"
cp -r "$final_path.old/galette/plugins" "$final_path/galette/plugins"
fi fi
# delete temp directory # delete temp directory
@ -115,14 +121,6 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
# Create a dedicated NGINX config
ynh_add_nginx_config
#================================================= #=================================================
# UPGRADE DEPENDENCIES # UPGRADE DEPENDENCIES
#================================================= #=================================================
@ -143,6 +141,14 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config ynh_add_fpm_config
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
# Create a dedicated NGINX config
ynh_add_nginx_config
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
#================================================= #=================================================