From 66adc5013680176b05a7cdf2ccd93866b222f6a9 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Tue, 12 Sep 2023 18:06:41 +0200 Subject: [PATCH 01/23] Update upgrade fix old files should be removed --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 94a536b..d32d1db 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -38,7 +38,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep="association.sqlite squelettes/ data/ skel-dist/ config.local.user.php" + ynh_setup_source --dest_dir="$install_dir" --keep="association.sqlite squelettes data skel-dist config.local.user.php" --full_replace=1 fi chmod -R o-rwx "$install_dir" From 26d3e9d258f7fd552d7e5e1546bdd87cce8f8ad7 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Tue, 12 Sep 2023 18:10:51 +0200 Subject: [PATCH 02/23] Update manifest.toml candidate release rc9 --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index b24be98..7914923 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Paheko" description.en = "Software to manage association" description.fr = "Logiciel libre de gestion d'association" -version = "1.3.0~ynh6" +version = "1.3.0~ynh7" maintainers = ["rodinux"] From e90f60d14738bfd4d5560b8a9a95ce7249419736 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 12 Sep 2023 16:10:55 +0000 Subject: [PATCH 03/23] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3420e4f..3354cb4 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Paheko (we chose the name Paheko, a word from the Māori language meaning "to co 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.3.0~ynh6 +**Shipped version:** 1.3.0~ynh7 **Demo:** https://paheko.cloud/essai/ diff --git a/README_fr.md b/README_fr.md index 1cbd6c5..75cdedb 100644 --- a/README_fr.md +++ b/README_fr.md @@ -30,7 +30,7 @@ Paheko (Nous avons choisi le nom Paheko, un mot de la langue Māori qui signifie ![Logo Paheko](https://master.garradin.eu/garradin-devient-paheko/logo_v3_small-fs8.png) -**Version incluse :** 1.3.0~ynh6 +**Version incluse :** 1.3.0~ynh7 **Démo :** https://paheko.cloud/essai/ From 68e00d39be72ffb212145d07de57e2ba2a56b27d Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Tue, 12 Sep 2023 18:46:08 +0200 Subject: [PATCH 04/23] Update upgrade fix the namespace Paheko; on files --- scripts/upgrade | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index d32d1db..10f9d8c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -71,11 +71,10 @@ if ynh_compare_current_package_version --comparison lt --version 1.1.15~ynh1; th chmod 750 "$install_dir/config.local.user.php" ynh_add_config --template="config.local.user.php" --destination="$install_dir/config.local.user.php" fi -if ynh_compare_current_package_version --comparison le --version 1.2.12~ynh1; then +if ynh_compare_current_package_version --comparison ge --version 1.2.11~ynh2; then ynh_replace_string --match_string="namespace Garradin;" --replace_string="namespace Paheko;" --target_file="$install_dir/config.local.user.php" fi ynh_add_config --template="config.local.php" --destination="$install_dir/config.local.php" -ynh_add_config --template="config.local.yunohost.php" --destination="$install_dir/config.local.yunohost.php" # NOTE: Don't overwrite config.local.user.php # Permissions on files and directories From 72283326a66babdf50ecfea0405b56034b474671 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Tue, 12 Sep 2023 22:46:29 +0200 Subject: [PATCH 05/23] Update upgrade try fix --- scripts/upgrade | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 10f9d8c..b831b54 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -38,7 +38,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep="association.sqlite squelettes data skel-dist config.local.user.php" --full_replace=1 + ynh_setup_source --dest_dir="$install_dir" --keep="association.sqlite data skel-dist config.local.user.php" --full_replace=1 fi chmod -R o-rwx "$install_dir" @@ -71,11 +71,13 @@ if ynh_compare_current_package_version --comparison lt --version 1.1.15~ynh1; th chmod 750 "$install_dir/config.local.user.php" ynh_add_config --template="config.local.user.php" --destination="$install_dir/config.local.user.php" fi -if ynh_compare_current_package_version --comparison ge --version 1.2.11~ynh2; then +if ynh_compare_current_package_version --comparison le --version 1.2.11~ynh3; then ynh_replace_string --match_string="namespace Garradin;" --replace_string="namespace Paheko;" --target_file="$install_dir/config.local.user.php" fi -ynh_add_config --template="config.local.php" --destination="$install_dir/config.local.php" + # NOTE: Don't overwrite config.local.user.php +ynh_add_config --template="config.local.php" --destination="$install_dir/config.local.php" +ynh_add_config --template="config.local.yunohost.php" --destination="$install_dir/config.local.yunohost.php" # Permissions on files and directories chmod -R o-rwx "$install_dir" From 7a3af8d6a9c5ec9202d5cd22dd5b97fed5b88f99 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Tue, 12 Sep 2023 22:59:33 +0200 Subject: [PATCH 06/23] Update upgrade try fix keep the association.sqlite DB --- scripts/upgrade | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index b831b54..5fec1a8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,6 +29,12 @@ if [[ -z "${secret_key:-}" ]]; then ynh_app_setting_set --app=$app --key=secret_key --value=$secret_key fi +#================================================= +# BACKUP SQLITE DATABASE +#================================================= +ynh_script_progression --message="Backup of the DB in temporary file...." --weight=5 +cp -a $install_dir/data/association.sqlite /tmp/ + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -79,6 +85,9 @@ fi ynh_add_config --template="config.local.php" --destination="$install_dir/config.local.php" ynh_add_config --template="config.local.yunohost.php" --destination="$install_dir/config.local.yunohost.php" +# Restore the sqlite DB +mv /tmp/association.sqlite $install_dir/data + # Permissions on files and directories chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" From 96ddeb53d52b4dd9dc6214985544c36e18da5d8d Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Sat, 16 Sep 2023 08:59:19 +0200 Subject: [PATCH 07/23] better method for upgrade --- scripts/upgrade | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5fec1a8..c433912 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,7 +33,8 @@ fi # BACKUP SQLITE DATABASE #================================================= ynh_script_progression --message="Backup of the DB in temporary file...." --weight=5 -cp -a $install_dir/data/association.sqlite /tmp/ + +cp -R $install_dir/data /tmp/data #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -44,7 +45,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep="association.sqlite data skel-dist config.local.user.php" --full_replace=1 + ynh_setup_source --dest_dir="$install_dir" --keep="data config.local.user.php" --full_replace=1 fi chmod -R o-rwx "$install_dir" @@ -86,7 +87,7 @@ ynh_add_config --template="config.local.php" --destination="$install_dir/config. ynh_add_config --template="config.local.yunohost.php" --destination="$install_dir/config.local.yunohost.php" # Restore the sqlite DB -mv /tmp/association.sqlite $install_dir/data +rsync -a /tmp/data/ $install_dir/data/ # Permissions on files and directories chmod -R o-rwx "$install_dir" @@ -113,6 +114,6 @@ sleep 5 # END OF SCRIPT #================================================= # remove directory duplicated -ynh_secure_remove --file="$install_dir/data/data" +ynh_secure_remove --file="tmp/data" ynh_script_progression --message="Upgrade of $app completed" --last From 25f2fa92ef1e0cde2859f18004084e2c910f8a12 Mon Sep 17 00:00:00 2001 From: rodinux Date: Mon, 18 Sep 2023 14:49:44 +0200 Subject: [PATCH 08/23] secure temporary directory for data --- scripts/upgrade | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index c433912..b8055ca 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -34,7 +34,9 @@ fi #================================================= ynh_script_progression --message="Backup of the DB in temporary file...." --weight=5 -cp -R $install_dir/data /tmp/data +# copy data directory backup +file=$(mktemp -d $app_dataXXX --suffix=BKP) +cp -a $install_dir/data /var/www/$file #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -45,7 +47,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep="data config.local.user.php" --full_replace=1 + ynh_setup_source --dest_dir="$install_dir" --keep="association.sqlite data config.local.user.php" --full_replace=1 fi chmod -R o-rwx "$install_dir" @@ -86,8 +88,8 @@ fi ynh_add_config --template="config.local.php" --destination="$install_dir/config.local.php" ynh_add_config --template="config.local.yunohost.php" --destination="$install_dir/config.local.yunohost.php" -# Restore the sqlite DB -rsync -a /tmp/data/ $install_dir/data/ +# Sync data directory backup +rsync -R /var/www/$file/ $install_dir/data/ # Permissions on files and directories chmod -R o-rwx "$install_dir" @@ -110,10 +112,11 @@ sleep 5 ynh_local_curl "/index.php" sleep 5 +# remove data directory backup +ynh_secure_remove --file="/var/www/$file" + #================================================= # END OF SCRIPT #================================================= -# remove directory duplicated -ynh_secure_remove --file="tmp/data" ynh_script_progression --message="Upgrade of $app completed" --last From 7a203f035bc1640afa43d8b8c354ddfcd74b0175 Mon Sep 17 00:00:00 2001 From: rodinux Date: Mon, 18 Sep 2023 15:30:39 +0200 Subject: [PATCH 09/23] secure temporary directory for data --- scripts/upgrade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index b8055ca..934fbae 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -36,7 +36,7 @@ ynh_script_progression --message="Backup of the DB in temporary file...." --weig # copy data directory backup file=$(mktemp -d $app_dataXXX --suffix=BKP) -cp -a $install_dir/data /var/www/$file +rsync -R $install_dir/data/ /var/www/$tmp_data_backup/ #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -89,7 +89,7 @@ ynh_add_config --template="config.local.php" --destination="$install_dir/config. ynh_add_config --template="config.local.yunohost.php" --destination="$install_dir/config.local.yunohost.php" # Sync data directory backup -rsync -R /var/www/$file/ $install_dir/data/ +rsync -R /var/www/$tmp_data_backup/ $install_dir/data/ # Permissions on files and directories chmod -R o-rwx "$install_dir" @@ -113,7 +113,7 @@ ynh_local_curl "/index.php" sleep 5 # remove data directory backup -ynh_secure_remove --file="/var/www/$file" +ynh_secure_remove --file="/var/www/$tmp_data_backup" #================================================= # END OF SCRIPT From 56b6acbd0444bcd463a91fb6ce759a01b6b9f757 Mon Sep 17 00:00:00 2001 From: rodinux Date: Mon, 18 Sep 2023 16:41:12 +0200 Subject: [PATCH 10/23] secure temporary directory for data --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 934fbae..e7da054 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -35,7 +35,7 @@ fi ynh_script_progression --message="Backup of the DB in temporary file...." --weight=5 # copy data directory backup -file=$(mktemp -d $app_dataXXX --suffix=BKP) +tmp_data_backup=$(mktemp -d $app_dataXXX --suffix=BKP) rsync -R $install_dir/data/ /var/www/$tmp_data_backup/ #================================================= From c1f585851eda643952947eceb2c4311e0116eefd Mon Sep 17 00:00:00 2001 From: rodinux Date: Mon, 18 Sep 2023 17:27:41 +0200 Subject: [PATCH 11/23] secure temporary directory for data --- scripts/upgrade | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index e7da054..4faa08e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -36,7 +36,8 @@ ynh_script_progression --message="Backup of the DB in temporary file...." --weig # copy data directory backup tmp_data_backup=$(mktemp -d $app_dataXXX --suffix=BKP) -rsync -R $install_dir/data/ /var/www/$tmp_data_backup/ +echo "$tmp_data_backup" +rsync -a $install_dir/data/ $tmp_data_backup/ #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -89,7 +90,7 @@ ynh_add_config --template="config.local.php" --destination="$install_dir/config. ynh_add_config --template="config.local.yunohost.php" --destination="$install_dir/config.local.yunohost.php" # Sync data directory backup -rsync -R /var/www/$tmp_data_backup/ $install_dir/data/ +rsync -a /var/www/$tmp_data_backup/ $install_dir/data/ # Permissions on files and directories chmod -R o-rwx "$install_dir" From ab39a4a5e25f4b3a299537f2f02dc659b3699f20 Mon Sep 17 00:00:00 2001 From: rodinux Date: Mon, 18 Sep 2023 17:28:06 +0200 Subject: [PATCH 12/23] secure temporary directory for data --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 4faa08e..55bf1c5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -90,7 +90,7 @@ ynh_add_config --template="config.local.php" --destination="$install_dir/config. ynh_add_config --template="config.local.yunohost.php" --destination="$install_dir/config.local.yunohost.php" # Sync data directory backup -rsync -a /var/www/$tmp_data_backup/ $install_dir/data/ +rsync -a $tmp_data_backup/ $install_dir/data/ # Permissions on files and directories chmod -R o-rwx "$install_dir" From 5624b22dc54a82959d9748fa7bd25e62bd731a02 Mon Sep 17 00:00:00 2001 From: rodinux Date: Mon, 18 Sep 2023 17:40:29 +0200 Subject: [PATCH 13/23] secure temporary directory for data --- scripts/upgrade | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 55bf1c5..7354487 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -36,7 +36,6 @@ ynh_script_progression --message="Backup of the DB in temporary file...." --weig # copy data directory backup tmp_data_backup=$(mktemp -d $app_dataXXX --suffix=BKP) -echo "$tmp_data_backup" rsync -a $install_dir/data/ $tmp_data_backup/ #================================================= @@ -48,7 +47,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep="association.sqlite data config.local.user.php" --full_replace=1 + ynh_setup_source --dest_dir="$install_dir" --keep="config.local.user.php" --full_replace=1 fi chmod -R o-rwx "$install_dir" @@ -114,7 +113,7 @@ ynh_local_curl "/index.php" sleep 5 # remove data directory backup -ynh_secure_remove --file="/var/www/$tmp_data_backup" +ynh_secure_remove --file="$tmp_data_backup" #================================================= # END OF SCRIPT From 7ff27b65a1374abd7dad46c90cceb1a4aaf7594d Mon Sep 17 00:00:00 2001 From: rodinux Date: Mon, 18 Sep 2023 20:17:56 +0200 Subject: [PATCH 14/23] try fix temporally secure folder with mktemp --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 7354487..3f98542 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -35,7 +35,7 @@ fi ynh_script_progression --message="Backup of the DB in temporary file...." --weight=5 # copy data directory backup -tmp_data_backup=$(mktemp -d $app_dataXXX --suffix=BKP) +tmp_data_backup=$(mktemp -d) rsync -a $install_dir/data/ $tmp_data_backup/ #================================================= From e58b73096ffc75ecac7698c8aff715223347d73f Mon Sep 17 00:00:00 2001 From: rodinux Date: Mon, 18 Sep 2023 20:36:06 +0200 Subject: [PATCH 15/23] more readable process upgrade --- scripts/upgrade | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 3f98542..7f39c5d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,7 +30,7 @@ if [[ -z "${secret_key:-}" ]]; then fi #================================================= -# BACKUP SQLITE DATABASE +# BACKUP SQLITE DATABASE AND DATAS #================================================= ynh_script_progression --message="Backup of the DB in temporary file...." --weight=5 @@ -88,9 +88,19 @@ fi ynh_add_config --template="config.local.php" --destination="$install_dir/config.local.php" ynh_add_config --template="config.local.yunohost.php" --destination="$install_dir/config.local.yunohost.php" +#================================================= +# RESTORE BACKUP SQLITE DATABASE AND DATAS +#================================================= +ynh_script_progression --message="Restore datas..." --weight=5 + # Sync data directory backup rsync -a $tmp_data_backup/ $install_dir/data/ +#================================================= +# FIX PERMISSIONS +#================================================= +ynh_script_progression --message="Fix permissions..." --weight=2 + # Permissions on files and directories chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" From 17b4730143caca50f5563820a47760d353bcc57e Mon Sep 17 00:00:00 2001 From: rodinux Date: Mon, 18 Sep 2023 20:39:34 +0200 Subject: [PATCH 16/23] add a tag version --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 7914923..200f639 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Paheko" description.en = "Software to manage association" description.fr = "Logiciel libre de gestion d'association" -version = "1.3.0~ynh7" +version = "1.3.0~ynh9" maintainers = ["rodinux"] From f7be51ecc1541277398cee1fd750dc1d6d00324c Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 18 Sep 2023 18:39:46 +0000 Subject: [PATCH 17/23] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3354cb4..401fccd 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Paheko (we chose the name Paheko, a word from the Māori language meaning "to co 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.3.0~ynh7 +**Shipped version:** 1.3.0~ynh9 **Demo:** https://paheko.cloud/essai/ diff --git a/README_fr.md b/README_fr.md index 75cdedb..1e0d3b8 100644 --- a/README_fr.md +++ b/README_fr.md @@ -30,7 +30,7 @@ Paheko (Nous avons choisi le nom Paheko, un mot de la langue Māori qui signifie ![Logo Paheko](https://master.garradin.eu/garradin-devient-paheko/logo_v3_small-fs8.png) -**Version incluse :** 1.3.0~ynh7 +**Version incluse :** 1.3.0~ynh9 **Démo :** https://paheko.cloud/essai/ From ca062df330927d2854ce72714211f51c6ded63f9 Mon Sep 17 00:00:00 2001 From: rodinux Date: Mon, 18 Sep 2023 23:21:45 +0200 Subject: [PATCH 18/23] try also keep the file config.local.user.php --- conf/config.local.php | 4 ++-- scripts/install | 4 ++-- scripts/restore | 5 +++++ scripts/upgrade | 19 ++++++++++++------- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/conf/config.local.php b/conf/config.local.php index 0080731..8fb3a75 100644 --- a/conf/config.local.php +++ b/conf/config.local.php @@ -3,7 +3,7 @@ /** * NE PAS MODIFIER CE FICHIER. Il est regénéré automatiquement à chaque mise à jour de Yunohost * - * Pour ajouter vos configurations personnalisées, rendez-vous dans le fichier config.local.user.php + * Pour ajouter vos configurations personnalisées, rendez-vous dans le fichier data/config.local.user.php */ require '__INSTALL_DIR__/config.local.yunohost.php'; -require '__INSTALL_DIR__/config.local.user.php'; +require '__INSTALL_DIR__/data/config.local.user.php'; diff --git a/scripts/install b/scripts/install index d76907c..eaf582e 100644 --- a/scripts/install +++ b/scripts/install @@ -50,7 +50,7 @@ ynh_app_setting_set --app=$app --key=secret_key --value=$secret_key # Install configuration files ynh_add_config --template="config.local.php" --destination="$install_dir/config.local.php" ynh_add_config --template="config.local.yunohost.php" --destination="$install_dir/config.local.yunohost.php" -ynh_add_config --template="config.local.user.php" --destination="$install_dir/config.local.user.php" +ynh_add_config --template="config.local.user.php" --destination="$install_dir/data/config.local.user.php" # Permissions on files and directories chmod -R o-rwx "$install_dir" @@ -61,7 +61,7 @@ find "$install_dir/data" -type d -exec chmod 770 {} + find "$install_dir/data" -type f -exec chmod 660 {} + chmod 440 "$install_dir/config.local.php" chmod 440 "$install_dir/config.local.yunohost.php" -chmod 660 "$install_dir/config.local.user.php" +chmod 660 "$install_dir/data/config.local.user.php" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index c1ab315..dc0c5de 100644 --- a/scripts/restore +++ b/scripts/restore @@ -26,7 +26,12 @@ find "$install_dir/data" -type d -exec chmod 770 {} + find "$install_dir/data" -type f -exec chmod 660 {} + chmod 440 "$install_dir/config.local.php" chmod 440 "$install_dir/config.local.yunohost.php" + +if ynh_compare_current_package_version --comparison le --version 1.2.11~ynh4; then chmod 660 "$install_dir/config.local.user.php" +else +chmod 660 "$install_dir/data/config.local.user.php" +fi #================================================= # RESTORE THE PHP-FPM CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 7f39c5d..80f47d4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -38,6 +38,10 @@ ynh_script_progression --message="Backup of the DB in temporary file...." --weig tmp_data_backup=$(mktemp -d) rsync -a $install_dir/data/ $tmp_data_backup/ +if ynh_compare_current_package_version --comparison le --version 1.2.11~ynh4; then + mv $install_dir/config.local.user.php $tmp_data_backup/ +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -47,7 +51,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep="config.local.user.php" --full_replace=1 + ynh_setup_source --dest_dir="$install_dir" --full_replace=1 fi chmod -R o-rwx "$install_dir" @@ -77,11 +81,8 @@ ynh_add_nginx_config ynh_script_progression --message="Updating a configuration file..." --weight=5 if ynh_compare_current_package_version --comparison lt --version 1.1.15~ynh1; then - chmod 750 "$install_dir/config.local.user.php" - ynh_add_config --template="config.local.user.php" --destination="$install_dir/config.local.user.php" -fi -if ynh_compare_current_package_version --comparison le --version 1.2.11~ynh3; then - ynh_replace_string --match_string="namespace Garradin;" --replace_string="namespace Paheko;" --target_file="$install_dir/config.local.user.php" + chmod 750 "$install_dir/data/config.local.user.php" + ynh_add_config --template="config.local.user.php" --destination="$install_dir/data/config.local.user.php" fi # NOTE: Don't overwrite config.local.user.php @@ -96,6 +97,10 @@ ynh_script_progression --message="Restore datas..." --weight=5 # Sync data directory backup rsync -a $tmp_data_backup/ $install_dir/data/ +if ynh_compare_current_package_version --comparison le --version 1.2.11~ynh4; then + ynh_replace_string --match_string="namespace Garradin;" --replace_string="namespace Paheko;" --target_file="$install_dir/data/config.local.user.php" +fi + #================================================= # FIX PERMISSIONS #================================================= @@ -110,7 +115,7 @@ find "$install_dir/data" -type d -exec chmod 770 {} + find "$install_dir/data" -type f -exec chmod 660 {} + chmod 440 "$install_dir/config.local.php" chmod 440 "$install_dir/config.local.yunohost.php" -chmod 660 "$install_dir/config.local.user.php" +chmod 660 "$install_dir/data/config.local.user.php" #================================================= # FINALISE UPGRADE From a67f02f5b555a387f6e117e7c8b4f49b19c73ed0 Mon Sep 17 00:00:00 2001 From: rodinux Date: Mon, 18 Sep 2023 23:46:38 +0200 Subject: [PATCH 19/23] try also keep the file config.local.user.php --- scripts/upgrade | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 80f47d4..b98d9a0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -39,9 +39,16 @@ tmp_data_backup=$(mktemp -d) rsync -a $install_dir/data/ $tmp_data_backup/ if ynh_compare_current_package_version --comparison le --version 1.2.11~ynh4; then + ynh_replace_string --match_string="namespace Garradin;" --replace_string="namespace Paheko;" --target_file="$install_dir/config.local.user.php" mv $install_dir/config.local.user.php $tmp_data_backup/ fi +if ynh_compare_current_package_version --comparison le --version 1.3.0~ynh8; then + ynh_replace_string --match_string="namespace Garradin;" --replace_string="namespace Paheko;" --target_file="$install_dir/config.local.user.php" + mv $install_dir/config.local.user.php $tmp_data_backup/ +fi + + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -97,9 +104,6 @@ ynh_script_progression --message="Restore datas..." --weight=5 # Sync data directory backup rsync -a $tmp_data_backup/ $install_dir/data/ -if ynh_compare_current_package_version --comparison le --version 1.2.11~ynh4; then - ynh_replace_string --match_string="namespace Garradin;" --replace_string="namespace Paheko;" --target_file="$install_dir/data/config.local.user.php" -fi #================================================= # FIX PERMISSIONS From 4a3f1bd230e9b9de73d6846ad5838d2e1f4e6e81 Mon Sep 17 00:00:00 2001 From: rodinux Date: Tue, 19 Sep 2023 00:01:17 +0200 Subject: [PATCH 20/23] try also keep the file config.local.user.php --- scripts/restore | 2 +- scripts/upgrade | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/restore b/scripts/restore index dc0c5de..cfd17f9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -27,7 +27,7 @@ find "$install_dir/data" -type f -exec chmod 660 {} + chmod 440 "$install_dir/config.local.php" chmod 440 "$install_dir/config.local.yunohost.php" -if ynh_compare_current_package_version --comparison le --version 1.2.11~ynh4; then +if ynh_compare_current_package_version --comparison le --version 1.3.0~ynh8; then chmod 660 "$install_dir/config.local.user.php" else chmod 660 "$install_dir/data/config.local.user.php" diff --git a/scripts/upgrade b/scripts/upgrade index b98d9a0..e10c8a6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -38,13 +38,12 @@ ynh_script_progression --message="Backup of the DB in temporary file...." --weig tmp_data_backup=$(mktemp -d) rsync -a $install_dir/data/ $tmp_data_backup/ -if ynh_compare_current_package_version --comparison le --version 1.2.11~ynh4; then +if ynh_compare_current_package_version --comparison le --version 1.2.11~ynh1; then ynh_replace_string --match_string="namespace Garradin;" --replace_string="namespace Paheko;" --target_file="$install_dir/config.local.user.php" mv $install_dir/config.local.user.php $tmp_data_backup/ fi -if ynh_compare_current_package_version --comparison le --version 1.3.0~ynh8; then - ynh_replace_string --match_string="namespace Garradin;" --replace_string="namespace Paheko;" --target_file="$install_dir/config.local.user.php" +if ynh_compare_current_package_version --comparison le --version 1.3.0~ynh9; then mv $install_dir/config.local.user.php $tmp_data_backup/ fi From ff4718b26f65ac8ac62b188692e731056ec862a6 Mon Sep 17 00:00:00 2001 From: rodinux Date: Tue, 19 Sep 2023 00:43:08 +0200 Subject: [PATCH 21/23] version cadidate release RC-12 --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 200f639..541429e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -42,8 +42,8 @@ ram.runtime = "50M" [resources] [resources.sources.main] - url = "https://fossil.kd2.org/paheko/uv/paheko-1.3.0-rc9.tar.gz" - sha256 = "575dd8c632a4bc684d450b5cb2491a459506b3b34311d963ccedebe120e94158" + url = "https://fossil.kd2.org/paheko/uv/paheko-1.3.0-rc12.tar.gz" + sha256 = "29c599a7fa086ca6e81617853ddeeb6b6a80b8c5444000e90222af5a1ec99870" [resources.system_user] From 150a2380aaeec612bcf0f40f85a829fd4b487393 Mon Sep 17 00:00:00 2001 From: rodinux Date: Tue, 19 Sep 2023 22:14:39 +0200 Subject: [PATCH 22/23] fix how keep the file config.local.user.php on data folder path --- scripts/restore | 7 ++----- scripts/upgrade | 10 ++++------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/scripts/restore b/scripts/restore index cfd17f9..c42af40 100644 --- a/scripts/restore +++ b/scripts/restore @@ -26,11 +26,8 @@ find "$install_dir/data" -type d -exec chmod 770 {} + find "$install_dir/data" -type f -exec chmod 660 {} + chmod 440 "$install_dir/config.local.php" chmod 440 "$install_dir/config.local.yunohost.php" - -if ynh_compare_current_package_version --comparison le --version 1.3.0~ynh8; then -chmod 660 "$install_dir/config.local.user.php" -else -chmod 660 "$install_dir/data/config.local.user.php" +if [[ -f "$install_dir/config.local.user.php" ]]; then + chmod 660 "$install_dir/config.local.user.php" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index e10c8a6..439ad51 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -38,16 +38,14 @@ ynh_script_progression --message="Backup of the DB in temporary file...." --weig tmp_data_backup=$(mktemp -d) rsync -a $install_dir/data/ $tmp_data_backup/ -if ynh_compare_current_package_version --comparison le --version 1.2.11~ynh1; then - ynh_replace_string --match_string="namespace Garradin;" --replace_string="namespace Paheko;" --target_file="$install_dir/config.local.user.php" - mv $install_dir/config.local.user.php $tmp_data_backup/ +if [[ -f "$install_dir/config.local.user.php" ]]; then + cp -a $install_dir/config.local.user.php $tmp_data_backup/ fi -if ynh_compare_current_package_version --comparison le --version 1.3.0~ynh9; then - mv $install_dir/config.local.user.php $tmp_data_backup/ +if [[ $(grep "Garradin" $tmp_data_backup/config.local.user.php) ]] ; then + ynh_replace_string --match_string="namespace Garradin;" --replace_string="namespace Paheko;" --target_file="$tmp_data_backup/config.local.user.php" fi - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= From 59171b24886848ca78ccea04bf51f72a01bff394 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 19 Sep 2023 21:04:42 +0000 Subject: [PATCH 23/23] Auto-update README --- README.md | 2 -- README_fr.md | 1 - 2 files changed, 3 deletions(-) diff --git a/README.md b/README.md index ef63382..401fccd 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,8 @@ Paheko (we chose the name Paheko, a word from the Māori language meaning "to co 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.3.0~ynh9 - **Demo:** https://paheko.cloud/essai/ ## Screenshots diff --git a/README_fr.md b/README_fr.md index 9bdcf9f..1e0d3b8 100644 --- a/README_fr.md +++ b/README_fr.md @@ -32,7 +32,6 @@ Paheko (Nous avons choisi le nom Paheko, un mot de la langue Māori qui signifie **Version incluse :** 1.3.0~ynh9 - **Démo :** https://paheko.cloud/essai/ ## Captures d’écran