From e1830024d3f0133a1e75f409d229b6becc846084 Mon Sep 17 00:00:00 2001 From: mastereur <22839524+mastereur@users.noreply.github.com> Date: Wed, 30 Nov 2022 08:31:35 +0100 Subject: [PATCH 1/5] Add check for install.lock file #87 --- scripts/install | 6 ++++++ scripts/upgrade | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/scripts/install b/scripts/install index db105ea..5f72bf4 100644 --- a/scripts/install +++ b/scripts/install @@ -250,6 +250,12 @@ ynh_store_file_checksum --file="$final_path/htdocs/conf/conf.php" ynh_script_progression --message="Configuring permissions..." --weight=1 # Set permissions on app files +if [ ! -f $datadir/install.lock ]; then + echo 'This is a lock file to prevent use of install pages (set with permission 440)' > "$datadir/install.lock" + chown $app:$app "$datadir/install.lock" + chmod 440 "$datadir/install.lock" +fi + chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" diff --git a/scripts/upgrade b/scripts/upgrade index cc68717..2d34b7d 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -303,6 +303,12 @@ ynh_use_logrotate --non-append ynh_script_progression --message="Configuring permissions..." --weight=1 # Set permissions on app files +if [ ! -f $datadir/install.lock ]; then + echo 'This is a lock file to prevent use of install pages (set with permission 440)' > "$datadir/install.lock" + chown $app:$app "$datadir/install.lock" + chmod 440 "$datadir/install.lock" +fi + chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" From 20ac11c71be94128d8097079102caaaf1337a17d Mon Sep 17 00:00:00 2001 From: mastereur <22839524+mastereur@users.noreply.github.com> Date: Wed, 7 Dec 2022 17:49:46 +0100 Subject: [PATCH 2/5] Update to 16.0.2 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index eb3f6c8..a096529 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 Dolibarr ERP & CRM is a modern software for managing your professional or associative activity (contacts, invoices, orders, stocks, agenda, etc.). -**Shipped version:** 16.0.1~ynh1 +**Shipped version:** 16.0.2~ynh1 **Demo:** https://www.dolibarr.org/onlinedemo diff --git a/README_fr.md b/README_fr.md index 2a4a565..60c3c57 100644 --- a/README_fr.md +++ b/README_fr.md @@ -17,7 +17,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Dolibarr ERP & CRM est un logiciel moderne de gestion de votre activité professionnelle ou associative (contacts, factures, commandes, stocks, agenda, etc.). -**Version incluse :** 16.0.1~ynh1 +**Version incluse :** 16.0.2~ynh1 **Démo :** https://www.dolibarr.org/onlinedemo diff --git a/manifest.json b/manifest.json index 31045d5..cb2043c 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Manage the various aspects of your business or association", "fr": "Gérez les différents aspects de votre activité pro ou associative" }, - "version": "16.0.1~ynh1", + "version": "16.0.2~ynh1", "url": "https://www.dolibarr.org/", "upstream": { "license": "GPL-3.0-or-later", diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index f7a8a92..83d3724 100644 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,7 +1,7 @@ #!/bin/bash # Target version of the Dolibarr update -next_version="16.0.1" +next_version="16.0.2" # Dolibarr tarball checksum -dolibarr_source_sha256="f3614cf7b08c80d1aed4ebe0434008b2b03867d12b85df45b682c217ecb16573" \ No newline at end of file +dolibarr_source_sha256="df627de530c80418b8e1cdce26f7b4f30355646435e2be30a947fcbfb09edb25" \ No newline at end of file From 6c09ca5f0c5c74b2ed0ef26bf63783ee6ed37f3c Mon Sep 17 00:00:00 2001 From: mastereur <22839524+mastereur@users.noreply.github.com> Date: Wed, 7 Dec 2022 17:51:28 +0100 Subject: [PATCH 3/5] Update to 16.0.3 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a096529..9a777ca 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 Dolibarr ERP & CRM is a modern software for managing your professional or associative activity (contacts, invoices, orders, stocks, agenda, etc.). -**Shipped version:** 16.0.2~ynh1 +**Shipped version:** 16.0.3~ynh1 **Demo:** https://www.dolibarr.org/onlinedemo diff --git a/README_fr.md b/README_fr.md index 60c3c57..ec95764 100644 --- a/README_fr.md +++ b/README_fr.md @@ -17,7 +17,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Dolibarr ERP & CRM est un logiciel moderne de gestion de votre activité professionnelle ou associative (contacts, factures, commandes, stocks, agenda, etc.). -**Version incluse :** 16.0.2~ynh1 +**Version incluse :** 16.0.3~ynh1 **Démo :** https://www.dolibarr.org/onlinedemo diff --git a/manifest.json b/manifest.json index cb2043c..cd01006 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Manage the various aspects of your business or association", "fr": "Gérez les différents aspects de votre activité pro ou associative" }, - "version": "16.0.2~ynh1", + "version": "16.0.3~ynh1", "url": "https://www.dolibarr.org/", "upstream": { "license": "GPL-3.0-or-later", diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 83d3724..67585b6 100644 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,7 +1,7 @@ #!/bin/bash # Target version of the Dolibarr update -next_version="16.0.2" +next_version="16.0.3" # Dolibarr tarball checksum -dolibarr_source_sha256="df627de530c80418b8e1cdce26f7b4f30355646435e2be30a947fcbfb09edb25" \ No newline at end of file +dolibarr_source_sha256="52010375412c780b378145633a4e18abf6bde4c8e89a4cc1ad56d98fcd6120fd" \ No newline at end of file From fd6522218a9e481872bb7cd29f44bcfdedc74a86 Mon Sep 17 00:00:00 2001 From: mastereur <22839524+mastereur@users.noreply.github.com> Date: Wed, 7 Dec 2022 17:59:08 +0100 Subject: [PATCH 4/5] Remove last member option in files #88 --- hooks/post_user_create | 18 +++++++++--------- scripts/install | 6 +++--- scripts/upgrade | 1 - 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/hooks/post_user_create b/hooks/post_user_create index c240023..f25b005 100644 --- a/hooks/post_user_create +++ b/hooks/post_user_create @@ -1,7 +1,7 @@ #!/bin/bash app=__APP__ src_path=__FINALPATH__ -member=__MEMBER__ +# member=__MEMBER__ # Sync users if sudo php $src_path/scripts/user/sync_users_ldap2dolibarr.php commitiferror --server=localhost -y; then @@ -11,11 +11,11 @@ else fi # If YNH users should also be members, sync members -if [ $member -eq 1 ]; -then - if sudo php $src_path/scripts/members/sync_members_ldap2dolibarr.php commitiferror 1 --server=localhost -y; then - echo ldap member update ok - else - echo ldap member update ended with error - fi -fi +# if [ $member -eq 1 ]; +# then + # if sudo php $src_path/scripts/members/sync_members_ldap2dolibarr.php commitiferror 1 --server=localhost -y; then + # echo ldap member update ok + # else + # echo ldap member update ended with error + # fi +# fi diff --git a/scripts/install b/scripts/install index 5f72bf4..5d0e122 100644 --- a/scripts/install +++ b/scripts/install @@ -23,7 +23,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN -member=0 +#member=0 #is_public=0 phpversion=$YNH_PHP_VERSION @@ -49,7 +49,7 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin #ynh_app_setting_set --app=$app --key=is_public --value=$is_public -ynh_app_setting_set --app=$app --key=member --value=$member +#ynh_app_setting_set --app=$app --key=member --value=$member ynh_app_setting_set --app=$app --key=version --value=$(ynh_app_upstream_version "../manifest.json") #================================================= @@ -232,7 +232,7 @@ ynh_replace_string --match_string="dolibarr_main_authentication='dolibarr'" --re #================================================= fhook=../hooks/post_user_create ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$fhook" -ynh_replace_string --match_string="__MEMBER__" --replace_string="$member" --target_file="$fhook" +#ynh_replace_string --match_string="__MEMBER__" --replace_string="$member" --target_file="$fhook" ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$fhook" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2d34b7d..bc53361 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,7 +19,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) admin=$(ynh_app_setting_get --app=$app --key=admin) -member=$(ynh_app_setting_get --app=$app --key=member) 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) From 3ee4187d60ab05f1c4af0cbbf014002cf136b04d Mon Sep 17 00:00:00 2001 From: mastereur <22839524+mastereur@users.noreply.github.com> Date: Wed, 7 Dec 2022 18:07:35 +0100 Subject: [PATCH 5/5] Fix file access --- scripts/install | 4 ++-- scripts/upgrade | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 5d0e122..b67eb56 100644 --- a/scripts/install +++ b/scripts/install @@ -250,10 +250,10 @@ ynh_store_file_checksum --file="$final_path/htdocs/conf/conf.php" ynh_script_progression --message="Configuring permissions..." --weight=1 # Set permissions on app files -if [ ! -f $datadir/install.lock ]; then +if [ ! -f "$datadir/install.lock" ]; then echo 'This is a lock file to prevent use of install pages (set with permission 440)' > "$datadir/install.lock" chown $app:$app "$datadir/install.lock" - chmod 440 "$datadir/install.lock" + chmod 440 "$datadir/install.lock" fi chmod 750 "$final_path" diff --git a/scripts/upgrade b/scripts/upgrade index bc53361..b825249 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -302,10 +302,10 @@ ynh_use_logrotate --non-append ynh_script_progression --message="Configuring permissions..." --weight=1 # Set permissions on app files -if [ ! -f $datadir/install.lock ]; then +if [ ! -f "$datadir/install.lock" ]; then echo 'This is a lock file to prevent use of install pages (set with permission 440)' > "$datadir/install.lock" chown $app:$app "$datadir/install.lock" - chmod 440 "$datadir/install.lock" + chmod 440 "$datadir/install.lock" fi chmod 750 "$final_path"