diff --git a/README.md b/README.md index 787c9c2..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~ynh8 +**Shipped version:** 1.3.0~ynh9 **Demo:** https://paheko.cloud/essai/ diff --git a/README_fr.md b/README_fr.md index f32bed2..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~ynh8 +**Version incluse :** 1.3.0~ynh9 **Démo :** https://paheko.cloud/essai/ 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/manifest.toml b/manifest.toml index 8e88f00..541429e 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~ynh8" +version = "1.3.0~ynh9" maintainers = ["rodinux"] @@ -42,8 +42,8 @@ ram.runtime = "50M" [resources] [resources.sources.main] - url = "https://fossil.kd2.org/paheko/uv/paheko-1.3.0-rc10.tar.gz" - sha256 = "1cfe7d0c97276e3fc846bedc9e2c913bb61ab82f67775f1e41a4c52e4ad2d7b6" + url = "https://fossil.kd2.org/paheko/uv/paheko-1.3.0-rc12.tar.gz" + sha256 = "29c599a7fa086ca6e81617853ddeeb6b6a80b8c5444000e90222af5a1ec99870" [resources.system_user] 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..c42af40 100644 --- a/scripts/restore +++ b/scripts/restore @@ -26,7 +26,9 @@ 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" +if [[ -f "$install_dir/config.local.user.php" ]]; then + chmod 660 "$install_dir/config.local.user.php" +fi #================================================= # RESTORE THE PHP-FPM CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 614bab4..7c88dfc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -35,7 +35,16 @@ fi ynh_script_progression --message="Backup of the DB in temporary file...." --weight=5 # copy data directory backup -cp -a $install_dir/data /tmp/data +tmp_data_backup=$(mktemp -d) +rsync -a $install_dir/data/ $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 [[ $(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 @@ -45,8 +54,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] 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 +# Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$install_dir" --full_replace=1 fi chmod -R o-rwx "$install_dir" @@ -76,8 +85,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" + 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 @@ -90,7 +99,7 @@ ynh_add_config --template="config.local.yunohost.php" --destination="$install_di ynh_script_progression --message="Restore datas..." --weight=5 # Sync data directory backup -rsync -R /tmp/data/ $install_dir/data/ +rsync -a $tmp_data_backup/ $install_dir/data/ #================================================= # FIX PERMISSIONS @@ -106,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 @@ -118,8 +127,8 @@ sleep 5 ynh_local_curl "/index.php" sleep 5 -# remove directory duplicated -ynh_secure_remove --file="/tmp/data" +# remove data directory backup +ynh_secure_remove --file="$tmp_data_backup" #================================================= # END OF SCRIPT