diff --git a/README.md b/README.md index 39f59f7..b4530af 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Garradin (word meaning money in an aboriginal dialect of northern Australia, pronounced "gar-a-dine" em) is software for associative management. It is the tool of choice for managing an association, a sports club, an NGO, etc. It is designed to meet the needs of a small to medium-sized structure: management of members, accounting, website, note-taking in meetings, archiving and sharing of the association's operating documents, discussion between members, etc. etc. . -**Shipped version:** 1.1.10~ynh1 +**Shipped version:** 1.1.12~ynh1 **Demo:** https://garradin.eu/essai/ @@ -29,7 +29,7 @@ Garradin (word meaning money in an aboriginal dialect of northern Australia, pro * Official app website: http://garradin.eu * Official admin documentation: https://fossil.kd2.org/garradin/wiki?name=Documentation -* Upstream app code repository: https://fossil.kd2.org/garradin/wiki?name=Garradin +* Upstream app code repository: https://fossil.kd2.org/garradin/dir?ci=tip * YunoHost documentation for this app: https://yunohost.org/app_garradin * Report a bug: https://github.com/YunoHost-Apps/garradin_ynh/issues diff --git a/README_fr.md b/README_fr.md index e76169a..53abf20 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Garradin (mot signifiant argent dans un dialecte aborigène du nord de l'Australie, prononcé « gar-a-dine »em) est un logiciel de gestion associative. Il est l'outil de prédilection pour gérer une association, un club sportif, une ONG, etc. Il est conçu pour répondre aux besoins d'une structure de petite à moyenne taille : gestion des adhérents, comptabilité, site web, prise de notes en réunion, archivage et partage des documents de fonctionnement de l'association, discussion entre adhérents, etc etc. -**Version incluse :** 1.1.10~ynh1 +**Version incluse :** 1.1.12~ynh1 **Démo :** https://garradin.eu/essai/ @@ -25,7 +25,7 @@ Garradin (mot signifiant argent dans un dialecte aborigène du nord de l'Austral * Site officiel de l'app : http://garradin.eu * Documentation officielle de l'admin : https://fossil.kd2.org/garradin/wiki?name=Documentation -* Dépôt de code officiel de l'app : https://fossil.kd2.org/garradin/wiki?name=Garradin +* Dépôt de code officiel de l'app : https://fossil.kd2.org/garradin/dir?ci=tip * Documentation YunoHost pour cette app : https://yunohost.org/app_garradin * Signaler un bug : https://github.com/YunoHost-Apps/garradin_ynh/issues diff --git a/check_process b/check_process index 5eda0e2..c6f654f 100644 --- a/check_process +++ b/check_process @@ -11,7 +11,7 @@ setup_private=1 setup_public=1 upgrade=1 - #upgrade=1 from_commit=a36dd8b13d85078ddcee0d6d3146feb107d3e042 + upgrade=1 from_commit=2be21892a9b479710405a6ecd74ffb0541e0d202 backup_restore=1 multi_instance=1 change_url=1 @@ -19,6 +19,6 @@ Email= Notification=none ;;; Upgrade options - ; commit=a36dd8b13d85078ddcee0d6d3146feb107d3e042 - name=Merge pull request #55 from yunohost-bot/issue-and-pr-template + ; commit=2be21892a9b479710405a6ecd74ffb0541e0d202 + name=Merge pull request #55 from yunohost-bot/issue-and-pr-template manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& diff --git a/conf/1.1.0.src b/conf/1.1.0.src new file mode 100644 index 0000000..59679fe --- /dev/null +++ b/conf/1.1.0.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://fossil.kd2.org/garradin/uv/garradin-1.1.0.tar.bz2 +SOURCE_SUM=8689c62754d3b7920cf59786379e085a591fc1763dd3ec8fd13736e916c659bd +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.bz2 +SOURCE_IN_SUBDIR=true \ No newline at end of file diff --git a/conf/app.src b/conf/app.src index 3e30ce9..777018e 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://fossil.kd2.org/garradin/uv/garradin-1.1.10.tar.bz2 -SOURCE_SUM=56785921ce99d8424871bf340a3225016fede10345e3ce9fe51e47facc2e88cc +SOURCE_URL=https://fossil.kd2.org/garradin/uv/garradin-1.1.12.tar.bz2 +SOURCE_SUM=5f1994d6f39feac1f261ca1bce84a3f312def53e47a8faa197cd41ef657d5ab9 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.bz2 SOURCE_IN_SUBDIR=true diff --git a/images/compta.png b/images/compta.png deleted file mode 100644 index 4b4b1fb..0000000 Binary files a/images/compta.png and /dev/null differ diff --git a/images/documents.png b/images/documents.png deleted file mode 100644 index f184044..0000000 Binary files a/images/documents.png and /dev/null differ diff --git a/images/edition-site-v1.1.png b/images/edition-site-v1.1.png deleted file mode 100644 index 18e5c6d..0000000 Binary files a/images/edition-site-v1.1.png and /dev/null differ diff --git a/images/emails.png b/images/emails.png deleted file mode 100644 index 6e28824..0000000 Binary files a/images/emails.png and /dev/null differ diff --git a/images/membre-v1.1.png b/images/membre-v1.1.png deleted file mode 100644 index 0a32291..0000000 Binary files a/images/membre-v1.1.png and /dev/null differ diff --git a/images/membre.png b/images/membre.png deleted file mode 100644 index e4f0c8d..0000000 Binary files a/images/membre.png and /dev/null differ diff --git a/images/site.jpg b/images/site.jpg deleted file mode 100644 index a864faa..0000000 Binary files a/images/site.jpg and /dev/null differ diff --git a/images/wiki.png b/images/wiki.png deleted file mode 100644 index de1159b..0000000 Binary files a/images/wiki.png and /dev/null differ diff --git a/manifest.json b/manifest.json index cf151b2..254473c 100644 --- a/manifest.json +++ b/manifest.json @@ -6,14 +6,14 @@ "en": "Software to manage association", "fr": "Logiciel libre de gestion d'association" }, - "version": "1.1.10~ynh1", + "version": "1.1.12~ynh1", "url": "http://garradin.eu", "upstream": { "license": "GPL-3.0-or-later", "website": "http://garradin.eu", "demo": "https://garradin.eu/essai/", "admindoc": "https://fossil.kd2.org/garradin/wiki?name=Documentation", - "code": "https://fossil.kd2.org/garradin/wiki?name=Garradin" + "code": "https://fossil.kd2.org/garradin/dir?ci=tip" }, "license": "GPL-3.0-or-later", "maintainer": { @@ -26,7 +26,7 @@ "multi_instance": true, "services": [ "nginx", - "php7.3-fpm" + "php7.4-fpm" ], "arguments": { "install" : [ diff --git a/scripts/remove b/scripts/remove index 7780ced..57814f7 100644 --- a/scripts/remove +++ b/scripts/remove @@ -40,8 +40,11 @@ ynh_remove_nginx_config #================================================= ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=2 +# Remove the app dependencies installed along with php-fpm +ynh_remove_app_dependencies + # Remove the dedicated PHP-FPM config -ynh_remove_fpm_config --package="$extra_php_dependencies" +ynh_remove_fpm_config #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index f066255..c73a7b2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,11 +25,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) # CHECK VERSION #================================================= -if ynh_compare_current_package_version --comparison lt --version 0.9.8.1~ynh1; then - upgrade_type="0.9.8" -else - upgrade_type=$(ynh_check_app_version_changed) -fi +upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP @@ -83,11 +79,11 @@ fi # UPGRADE TO 0.9.8 if necessary #================================================= -if [ "$upgrade_type" == "0.9.8" ] +if ynh_compare_current_package_version --comparison lt --version 0.9.8.1~ynh1 then ynh_script_progression --message="Upgrading upgrade to 0.9.8" --weight=5 # Download, check integrity, uncompress and patch the source from 0.9.8.src - ynh_setup_source --dest_dir="$final_path" --source_id="0.9.8" + ynh_setup_source --keep="config.local.php" --dest_dir="$final_path" --source_id="0.9.8" # Set permissions on app files ynh_system_user_create --username=$app ynh_add_nginx_config @@ -101,41 +97,75 @@ then if [ -d "$backup_squelettes" ] then cp -ar $backup_squelettes $final_path/www/squelettes - ynh_secure_remove $backup_squelettes fi if [ -e "$backup_bdd" ] then cp -a $backup_bdd $final_path/association.sqlite - ynh_secure_remove $backup_bdd fi chown -R $app:$app $final_path - - key=$(ynh_string_random --length=50) - cp -a $final_path/config.dist.php $final_path/config.local.php - ynh_replace_string --match_string="const SECRET_KEY = '3xUhIgGwuovRKOjVsVPQ5yUMfXUSIOX2GKzcebsz5OINrYC50r';" --replace_string="const SECRET_KEY = '$key';" --target_file="$final_path/config.local.php" - if [ "$path_url" == "/" ]; then - ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url';" --target_file="$final_path/config.local.php" - else - ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" - fi chmod 755 $final_path - # Create the visitors permission if needed - visitors_enabled=$(ynh_permission_has_user "main" "visitors" && echo 0 || echo 1) - if [[ $visitors_enabled -eq 0 ]]; then + # Temporarily enable visitors for curl if needed + visitors_enabled=$(ynh_permission_has_user "main" "visitors" && echo yes || echo no) + if [[ $visitors_enabled == "no" ]]; then ynh_permission_update --permission "main" --add "visitors" fi - ynh_systemd_action --service_name=nginx --action=reload # Finalize the upgrade ynh_local_curl "/index.php" sleep 5 ynh_local_curl "/index.php" - upgrade_type="UPGRADE_APP" - if [[ $visitors_enabled -eq 0 ]]; then + if [[ $visitors_enabled == "no" ]]; then + ynh_permission_update --permission "main" --remove "visitors" + fi +fi +#================================================= +# UPGRADE TO 1.1.0 if necessary +#================================================= + +if ynh_compare_current_package_version --comparison lt --version 1.1.0~ynh1 +then + ynh_script_progression --message="Upgrading upgrade to 1.1.0" --weight=5 + # Download, check integrity, uncompress and patch the source from 0.9.8.src + ynh_setup_source --keep="config.local.php" --dest_dir="$final_path" --source_id="1.1.0" + # Set permissions on app files + ynh_system_user_create --username=$app + ynh_add_nginx_config + ynh_add_fpm_config --package="$extra_php_dependencies" + phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) + ynh_script_progression --message="restore data..." --weight=10 + + backup_bdd=/tmp/association.sqlite + backup_squelettes=/tmp/squelettes + + if [ -d "$backup_squelettes" ] + then + cp -ar $backup_squelettes $final_path/www/squelettes + fi + + if [ -e "$backup_bdd" ] + then + cp -a $backup_bdd $final_path/association.sqlite + fi + + chown -R $app:$app $final_path + chmod 755 $final_path + + # Temporarily enable visitors for curl if needed + visitors_enabled=$(ynh_permission_has_user "main" "visitors" && echo yes || echo no) + if [[ $visitors_enabled == "no" ]]; then + ynh_permission_update --permission "main" --add "visitors" + fi + + # Finalize the upgrade + ynh_local_curl "/index.php" + sleep 5 + ynh_local_curl "/index.php" + + if [[ $visitors_enabled == "no" ]]; then ynh_permission_update --permission "main" --remove "visitors" fi fi @@ -156,7 +186,7 @@ ynh_script_progression --message="Upgrading source files..." --weight=5 if [ "$upgrade_type" == "UPGRADE_APP" ] then # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --keep="config.local.php" --dest_dir="$final_path" fi #================================================= @@ -200,15 +230,6 @@ fi #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=5 -key=$(ynh_string_random --length=50) -cp -a $final_path/config.dist.php $final_path/config.local.php -ynh_replace_string --match_string="const SECRET_KEY = '3xUhIgGwuovRKOjVsVPQ5yUMfXUSIOX2GKzcebsz5OINrYC50r';" --replace_string="const SECRET_KEY = '$key';" --target_file="$final_path/config.local.php" -if [ "$path_url" == "/" ]; then -ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url';" --target_file="$final_path/config.local.php" -else -ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" -fi - # Permissions on files and directories chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path"