From a27723e8721aa626555bd3fa41641faf9a0c0d81 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 26 Dec 2020 18:07:29 +0100 Subject: [PATCH 01/29] Upgrade to v.3.0.0 --- README.md | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 531ad06..66ea36b 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview Grocy is a web-based self-hosted groceries & household management solution for your home. -**Shipped version:** 2.7.1 +**Shipped version:** 3.0.0 ## Screenshots diff --git a/conf/app.src b/conf/app.src index c73adaa..0174290 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/grocy/grocy/releases/download/v2.7.1/grocy_2.7.1.zip -SOURCE_SUM=f95cc2cc279a6445738ef9b5cc05a8cee438348d343081a76a6aa74464f76129 +SOURCE_URL=https://github.com/grocy/grocy/releases/download/v3.0.0/grocy_3.0.0.zip +SOURCE_SUM=3bb0e4b1f03de481ef2c9c91ad61bc88409c5140ec3adcad77bf24a0d65d4331 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=false diff --git a/manifest.json b/manifest.json index 6303a02..9b6231b 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Issue tracker that provides a balance between simplicity and power", "fr": "Gestionnaire de ticket avec un équilibre entre simplicité et puissance" }, - "version": "2.7.1~ynh1", + "version": "3.0.0~ynh1", "url": "https://github.com/grocy/grocy", "license": "MIT", "maintainer": { From a136314b1af79b513fa092970fdbf9c9f103e551 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 26 Dec 2020 18:33:59 +0100 Subject: [PATCH 02/29] Fix --- manifest.json | 6 +++--- scripts/install | 10 +++++++--- scripts/restore | 19 +++++++++++++------ scripts/upgrade | 18 +++++++----------- 4 files changed, 30 insertions(+), 23 deletions(-) diff --git a/manifest.json b/manifest.json index 9b6231b..9675e40 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,8 @@ "id": "grocy", "packaging_format": 1, "description": { - "en": "Issue tracker that provides a balance between simplicity and power", - "fr": "Gestionnaire de ticket avec un équilibre entre simplicité et puissance" + "en": "Web-based self-hosted groceries & household management solution for your home", + "fr": "Solution Web auto-hébergée de gestion d'épicerie et de gestion de la maison" }, "version": "3.0.0~ynh1", "url": "https://github.com/grocy/grocy", @@ -48,7 +48,7 @@ "en": "Choose the application language", "fr": "Choisissez la langue de l'application" }, - "choices": ["fr", "en"], + "choices": ["de", "en", "es", "fr", "it", "pt"], "default": "fr" }, { diff --git a/scripts/install b/scripts/install index d666990..340ef04 100644 --- a/scripts/install +++ b/scripts/install @@ -88,10 +88,7 @@ phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion) cp -a ../conf/config-dist.php "$final_path/data/config.php" -#ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/data/config.php" -#ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$final_path/data/config.php" ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/data/config.php" -#ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/data/config.php" #================================================= # STORE THE CONFIG FILE CHECKSUM @@ -108,6 +105,13 @@ ynh_store_file_checksum --file="$final_path/data/config.php" # Set permissions to app files chown -R $app: $final_path +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 + +yunohost service add $app --description="Self-hosted groceries & household management" --log="/var/log/$app/$app.log" + #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/restore b/scripts/restore index 0c671a5..310e62d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -61,6 +61,16 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei # Create the dedicated user (if not existing) ynh_system_user_create --username=$app +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring PHP-FPM configuration..." + +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +# Recreate a dedicated PHP-FPM config +ynh_add_fpm_config --package="$extra_php_dependencies" + #================================================= # RESTORE USER RIGHTS #================================================= @@ -69,14 +79,11 @@ ynh_system_user_create --username=$app chown -R $app: $final_path #================================================= -# RESTORE THE PHP-FPM CONFIGURATION +# INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Restoring PHP-FPM configuration..." +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - -# Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +yunohost service add $app --description="Self-hosted groceries & household management" --log="/var/log/$app/$app.log" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index d9f323f..3a27844 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -34,15 +34,6 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 -fi - # If final_path doesn't exist, create it if [ -z "$final_path" ]; then final_path=/var/www/$app @@ -112,10 +103,15 @@ ynh_add_fpm_config --package="$extra_php_dependencies" cp -a ../conf/config-dist.php "$final_path/config-dist.php" -#ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/data/config.php" -#ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$final_path/data/config.php" ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/data/config.php" +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 + +yunohost service add $app --description="Self-hosted groceries & household management" --log="/var/log/$app/$app.log" + #================================================= # RELOAD NGINX #================================================= From 3426cd48f154fa9482bc328736cc573296cff225 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 26 Dec 2020 18:37:01 +0100 Subject: [PATCH 03/29] Fix --- check_process | 2 +- scripts/remove | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/check_process b/check_process index c309eb9..f22c51d 100644 --- a/check_process +++ b/check_process @@ -12,7 +12,7 @@ is_public=1 (PUBLIC|public=1|private=0) ; Checks pkg_linter=1 - setup_sub_dir=1 + setup_sub_dir=0 setup_root=1 setup_nourl=0 setup_private=1 diff --git a/scripts/remove b/scripts/remove index 220a43d..10b1f03 100644 --- a/scripts/remove +++ b/scripts/remove @@ -24,18 +24,13 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # STOP AND REMOVE SERVICE #================================================= -ynh_script_progression --message="Stopping and removing the systemd service" --weight=1 -# Remove the dedicated systemd config -ynh_remove_systemd_config - -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies +# Remove the service from the list of services known by Yunohost (added from `yunohost service add`) +if ynh_exec_warn_less yunohost service status $app >/dev/null +then + ynh_script_progression --message="Removing $app service integration..." --weight=1 + yunohost service remove $app +fi #================================================= # REMOVE APP MAIN DIR From b388c4f0884ebd8a9d49c23b39b57478c106ea02 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 26 Dec 2020 18:47:23 +0100 Subject: [PATCH 04/29] Add README_fr --- README.md | 2 +- README_fr.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 README_fr.md diff --git a/README.md b/README.md index 66ea36b..b7a1033 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Grocy for YunoHost [![Integration level](https://dash.yunohost.org/integration/grocy.svg)](https://dash.yunohost.org/appci/app/grocy) ![](https://ci-apps.yunohost.org/ci/badges/grocy.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/grocy.maintain.svg) -[![Install Mantis with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=grocy) +[![Install Grocy with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=grocy) *[Lire ce readme en français.](./README_fr.md)* diff --git a/README_fr.md b/README_fr.md new file mode 100644 index 0000000..3287b27 --- /dev/null +++ b/README_fr.md @@ -0,0 +1,73 @@ +# Grocy pour YunoHost + +[![Niveau d'intégration](https://dash.yunohost.org/integration/grocy.svg)](https://dash.yunohost.org/appci/app/grocy) ![](https://ci-apps.yunohost.org/ci/badges/grocy.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/grocy.maintain.svg) +[![Install Grocy with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=grocy) + +*[Read this readme in english.](./README.md)* + +> *Ce package vous permet d'installer Grocy rapidement et simplement sur un serveur YunoHost. +Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.* + +## Vue d'ensemble +Grocy is a web-based self-hosted groceries & household management solution for your home. + +**Version incluse :** 3.0.0 + +## Captures d'écran + +![](https://grocy.info/img/grocy-desktop-en.png) + +## Démo + +* [Démo officielle](https://en.demo.grocy.info/stockoverview) + +## Configuration + + Default login + user: **admin** + password: **admin** + +## Documentation + + * Documentation officielle : Lien vers la documentation officielle de cette application. + * Documentation YunoHost : Si une documentation spécifique est nécessaire, n'hésitez pas à contribuer. + +## Caractéristiques spécifiques YunoHost + +#### Support multi-utilisateur + +* L'authentification LDAP et HTTP est-elle prise en charge ? +* L'application peut-elle être utilisée par plusieurs utilisateurs ? + +#### Supported architectures + +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/grocy%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/grocy/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/grocy%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/grocy/) + +## Limitations + +* Limitations connues. + +## Informations additionnelles + +* Autres informations que vous souhaitez ajouter sur cette application. + +## Liens + + * Signaler un bug : https://github.com/YunoHost-Apps/grocy_ynh/issues + * Site de l'application : https://grocy.info/ + * Dépôt de l'application principale : https://github.com/grocy/grocy + * Site web YunoHost : https://yunohost.org/ + +--- + +## Informations pour les développeurs + +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/grocy_ynh/tree/testing). + +Pour essayer la branche testing, procédez comme suit. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/grocy_ynh/tree/testing --debug +or +sudo yunohost app upgrade grocy -u https://github.com/YunoHost-Apps/grocy_ynh/tree/testing --debug +``` From 8466f412ba3571b6a878dd6ec50a939b526802af Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 26 Dec 2020 18:53:38 +0100 Subject: [PATCH 05/29] Fix --- conf/nginx.conf | 6 ++++-- scripts/upgrade | 16 ++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 0ab9560..2e4bbf2 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,5 @@ -location / { +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +location __PATH__/ { # Path to source alias __FINALPATH__/public/ ; @@ -10,7 +11,8 @@ location / { index index.php; - try_files $uri __PATH__/index.php; + #try_files $uri __PATH__/index.php; + try_files $uri __PATH__/index.php$is_args$query_string; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; diff --git a/scripts/upgrade b/scripts/upgrade index 3a27844..d485a90 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,7 +21,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) language=$(ynh_app_setting_get --app=$app --key=language) -phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION @@ -82,13 +82,6 @@ ynh_script_progression --message="Making sure dedicated system user exists..." - # Create a dedicated user (if not existing) ynh_system_user_create --username=$app -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions to app files -chown -R $app: $final_path - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -97,6 +90,13 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 # Create a dedicated php-fpm config ynh_add_fpm_config --package="$extra_php_dependencies" +#================================================= +# SECURE FILES AND DIRECTORIES +#================================================= + +# Set permissions to app files +chown -R $app: $final_path + #================================================= # MODIFY A CONFIG FILE #================================================= From e3a52e3181bad26e5e0f48204b40ba464a3a2029 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 26 Dec 2020 18:55:12 +0100 Subject: [PATCH 06/29] Update nginx.conf --- conf/nginx.conf | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 2e4bbf2..8cb9e61 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,5 +1,4 @@ -#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location __PATH__/ { +location / { # Path to source alias __FINALPATH__/public/ ; @@ -11,9 +10,8 @@ location __PATH__/ { index index.php; - #try_files $uri __PATH__/index.php; - try_files $uri __PATH__/index.php$is_args$query_string; - + try_files $uri __PATH__/index.php; + location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; From 0f421c514505a4f445e43440e37c0c61da085286 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 26 Dec 2020 19:05:38 +0100 Subject: [PATCH 07/29] Fix --- scripts/install | 1 + scripts/restore | 1 + scripts/upgrade | 18 ++++++++++++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 340ef04..845e4c1 100644 --- a/scripts/install +++ b/scripts/install @@ -104,6 +104,7 @@ ynh_store_file_checksum --file="$final_path/data/config.php" # Set permissions to app files chown -R $app: $final_path +chmod -R 755 $final_path/data #================================================= # INTEGRATE SERVICE IN YUNOHOST diff --git a/scripts/restore b/scripts/restore index 310e62d..ae4d2e8 100644 --- a/scripts/restore +++ b/scripts/restore @@ -77,6 +77,7 @@ ynh_add_fpm_config --package="$extra_php_dependencies" # Restore permissions on app files chown -R $app: $final_path +chmod -R 755 $final_path/data #================================================= # INTEGRATE SERVICE IN YUNOHOST diff --git a/scripts/upgrade b/scripts/upgrade index d485a90..3c4c2b2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -62,8 +62,22 @@ 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="$final_path" + tmpdir="$(mktemp -d)" + + # Backup the config file in the temp dir + cp -a "$final_path/data" "$tmpdir/data" + + # Remove the app directory securely + ynh_secure_remove --file="$final_path" + + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$final_path" + + # Copy the admin saved settings from tmp directory to final path + cp -a "$tmpdir/data" "$final_path/config/data" + + # Remove the tmp directory securely + ynh_secure_remove --file="$tmpdir" fi #================================================= From c899441995ade218d8833d94765d7a6ffbb09c4e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 26 Dec 2020 19:06:59 +0100 Subject: [PATCH 08/29] Update manifest.json --- manifest.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifest.json b/manifest.json index 9675e40..44e66c0 100644 --- a/manifest.json +++ b/manifest.json @@ -58,6 +58,10 @@ "en": "Is it a public site?", "fr": "Est-ce un site public ?" }, + "help": { + "en": "If enabled, Grocy will be accessible by people who do not have an account. This can be changed later via the webadmin.", + "fr": "Si cette case est cochée, Grocy sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." + }, "default": true } ] From ea59adff9ff9cd86651a6ae9861a642c8f702759 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 26 Dec 2020 19:12:19 +0100 Subject: [PATCH 09/29] Update upgrade --- scripts/upgrade | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 3c4c2b2..8d7e7b6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -62,6 +62,15 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=5 + if [[ ! -f "$final_path/data" ]]; then + # config.ini.php is only created during the post-install process... + # it is therefore not present when the CI tests are carried out... + # This condition is only for CI test to go through the upgrade process + ynh_secure_remove --file="$final_path" + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$final_path" + else + tmpdir="$(mktemp -d)" # Backup the config file in the temp dir @@ -110,14 +119,7 @@ ynh_add_fpm_config --package="$extra_php_dependencies" # Set permissions to app files chown -R $app: $final_path - -#================================================= -# MODIFY A CONFIG FILE -#================================================= - -cp -a ../conf/config-dist.php "$final_path/config-dist.php" - -ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/data/config.php" +chmod -R 755 $final_path/data #================================================= # INTEGRATE SERVICE IN YUNOHOST From 7691d27aa39cd01ba342b8cb065e4454ec98d927 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 26 Dec 2020 19:18:26 +0100 Subject: [PATCH 10/29] Update upgrade --- scripts/upgrade | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 8d7e7b6..748ec26 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -62,31 +62,11 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=5 - if [[ ! -f "$final_path/data" ]]; then - # config.ini.php is only created during the post-install process... - # it is therefore not present when the CI tests are carried out... - # This condition is only for CI test to go through the upgrade process - ynh_secure_remove --file="$final_path" - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" - else - - tmpdir="$(mktemp -d)" - - # Backup the config file in the temp dir - cp -a "$final_path/data" "$tmpdir/data" - # Remove the app directory securely ynh_secure_remove --file="$final_path" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" - - # Copy the admin saved settings from tmp directory to final path - cp -a "$tmpdir/data" "$final_path/config/data" - - # Remove the tmp directory securely - ynh_secure_remove --file="$tmpdir" fi #================================================= @@ -113,6 +93,15 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 # Create a dedicated php-fpm config ynh_add_fpm_config --package="$extra_php_dependencies" +#================================================= +# MODIFY A CONFIG FILE +#================================================= + +cp -a ../conf/config-dist.php "$final_path/data/config.php" + +ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/data/config.php" + + #================================================= # SECURE FILES AND DIRECTORIES #================================================= From b3e8ff96a3ae05b3ba4f2ff325ca6b06428f1574 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 26 Dec 2020 19:29:43 +0100 Subject: [PATCH 11/29] Remove service --- scripts/install | 7 ------- scripts/remove | 13 ------------- scripts/restore | 7 ------- scripts/upgrade | 7 ------- 4 files changed, 34 deletions(-) diff --git a/scripts/install b/scripts/install index 845e4c1..f5646f2 100644 --- a/scripts/install +++ b/scripts/install @@ -106,13 +106,6 @@ ynh_store_file_checksum --file="$final_path/data/config.php" chown -R $app: $final_path chmod -R 755 $final_path/data -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Self-hosted groceries & household management" --log="/var/log/$app/$app.log" - #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/remove b/scripts/remove index 10b1f03..7ee6368 100644 --- a/scripts/remove +++ b/scripts/remove @@ -19,19 +19,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -#================================================= -# STANDARD REMOVE -#================================================= -# STOP AND REMOVE SERVICE -#================================================= - -# Remove the service from the list of services known by Yunohost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status $app >/dev/null -then - ynh_script_progression --message="Removing $app service integration..." --weight=1 - yunohost service remove $app -fi - #================================================= # REMOVE APP MAIN DIR #================================================= diff --git a/scripts/restore b/scripts/restore index ae4d2e8..afccc7e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -79,13 +79,6 @@ ynh_add_fpm_config --package="$extra_php_dependencies" chown -R $app: $final_path chmod -R 755 $final_path/data -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Self-hosted groceries & household management" --log="/var/log/$app/$app.log" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 748ec26..210ff0d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -110,13 +110,6 @@ ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" -- chown -R $app: $final_path chmod -R 755 $final_path/data -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Self-hosted groceries & household management" --log="/var/log/$app/$app.log" - #================================================= # RELOAD NGINX #================================================= From 27891e4e8be3e42ca80950eb61298ebf013357ac Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 26 Dec 2020 19:38:35 +0100 Subject: [PATCH 12/29] Update upgrade --- scripts/upgrade | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 210ff0d..ad4ccf2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -62,11 +62,23 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=5 + # Create a temporary directory + tmpdir="$(mktemp -d)" + + # Backup the config file in the temp dir + cp -R "$final_path/data" "$tmpdir/data" + # Remove the app directory securely ynh_secure_remove --file="$final_path" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" + + # Copy the admin saved settings from tmp directory to final path + cp -RT "$tmpdir/data" "$final_path/data" + + # Remove the tmp directory securely + ynh_secure_remove --file="$tmpdir" fi #================================================= From c3fe4f367cac9da6882b4097e4c18e26160ee09c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 26 Dec 2020 20:02:52 +0100 Subject: [PATCH 13/29] Update config-dist.php --- conf/config-dist.php | 191 ++++++++++++++++++++++++------------------- 1 file changed, 109 insertions(+), 82 deletions(-) diff --git a/conf/config-dist.php b/conf/config-dist.php index abc0b00..143cea9 100644 --- a/conf/config-dist.php +++ b/conf/config-dist.php @@ -1,140 +1,169 @@ BASE_PATH = /grocy +// When running grocy in a subdirectory, this should be set to the relative path, otherwise empty +// It needs to be set to the part (of the URL) after the document root, +// if URL rewriting is disabled, including index.php +// Example with URL Rewriting support: +// Root URL = https://example.com/grocy +// => BASE_PATH = /grocy +// Example without URL Rewriting support: +// Root URL = https://example.com/grocy/public/index.php/ +// => BASE_PATH = /grocy/public/index.php Setting('BASE_PATH', ''); -# The base url of your installation, -# should be just "/" when running directly under the root of a (sub)domain -# or for example "https://example.com/grocy" when using a subdirectory +// The base URL of your installation, +// should be just "/" when running directly under the root of a (sub)domain +// or for example "https://example.com/grocy" when using a subdirectory Setting('BASE_URL', '/'); -# The plugin to use for external barcode lookups, -# must be the filename without .php extension and must be located in /data/plugins, -# see /data/plugins/DemoBarcodeLookupPlugin.php for an example implementation +// The plugin to use for external barcode lookups, +// must be the filename without .php extension and must be located in /data/plugins, +// see /data/plugins/DemoBarcodeLookupPlugin.php for an example implementation Setting('STOCK_BARCODE_LOOKUP_PLUGIN', 'DemoBarcodeLookupPlugin'); -# If, however, your webserver does not support URL rewriting, set this to true +// If, however, your webserver does not support URL rewriting, set this to true Setting('DISABLE_URL_REWRITING', false); -# Specify an custom homepage if desired - by default the homepage will be set to the stock overview, -# this needs to be one of the following values: -# stock, shoppinglist, recipes, chores, tasks, batteries, equipment, calendar, mealplan +// Specify an custom homepage if desired - by default the homepage will be set to the stock overview page, +// this needs to be one of the following values: +// stock, shoppinglist, recipes, chores, tasks, batteries, equipment, calendar, mealplan Setting('ENTRY_PAGE', 'stock'); -# Set this to true if you want to disable authentication / the login screen, -# places where user context is needed will then use the default (first existing) user +// Set this to true if you want to disable authentication / the login screen, +// places where user context is needed will then use the default (first existing) user Setting('DISABLE_AUTH', false); -# Set this to true if you want to disable the ability to scan a barcode via the device camera (Browser API) +// Either "Grocy\Middleware\DefaultAuthMiddleware", "Grocy\Middleware\ReverseProxyAuthMiddleware" +// or any class that implements Grocy\Middleware\AuthMiddleware +Setting('AUTH_CLASS', 'Grocy\Middleware\DefaultAuthMiddleware'); + +// When using ReverseProxyAuthMiddleware, +// the name of the HTTP header which your reverse proxy uses to pass the username (on successful authentication) +Setting('REVERSE_PROXY_AUTH_HEADER', 'REMOTE_USER'); + +// When using LdapAuthMiddleware +Setting('LDAP_DOMAIN', 'local'); // Example value "local" +Setting('LDAP_ADDRESS', 'ldap://127.0.0.1:389'); // Example value "ldap://vm-dc2019.local.berrnd.net" +Setting('LDAP_BASE_DN', 'ou=users,dc=yunohost,dc=org'); // Example value "OU=OU_Users,DC=local,DC=berrnd,DC=net" + +// Set this to true if you want to disable the ability to scan a barcode via the device camera (Browser API) Setting('DISABLE_BROWSER_BARCODE_CAMERA_SCANNING', false); -# Set this if you want to have a different start day for the weekly meal plan view, -# leave empty to use CALENDAR_FIRST_DAY_OF_WEEK (see above) -# Needs to be a number where Sunday = 0, Monday = 1 and so forth +// Set this if you want to have a different start day for the weekly meal plan view, +// leave empty to use CALENDAR_FIRST_DAY_OF_WEEK (see above) +// Needs to be a number where Sunday = 0, Monday = 1 and so forth Setting('MEAL_PLAN_FIRST_DAY_OF_WEEK', ''); +// Default permissions for new users +// the array needs to contain the technical/constant names +// see the file controllers/Users/User.php for possible values +Setting('DEFAULT_PERMISSIONS', ['ADMIN']); -# Default user settings -# These settings can be changed per user, here the defaults -# are defined which are used when the user has not changed the setting so far +// Default user settings +// These settings can be changed per user, here the defaults +// are defined which are used when the user has not changed the setting so far -# Night mode related +// Night mode related DefaultUserSetting('night_mode_enabled', false); // If night mode is enabled always DefaultUserSetting('auto_night_mode_enabled', false); // If night mode is enabled automatically when inside a given time range (see the two settings below) -DefaultUserSetting('auto_night_mode_time_range_from', "20:00"); // Format HH:mm -DefaultUserSetting('auto_night_mode_time_range_to', "07:00"); // Format HH:mm +DefaultUserSetting('auto_night_mode_time_range_from', '20:00'); // Format HH:mm +DefaultUserSetting('auto_night_mode_time_range_to', '07:00'); // Format HH:mm DefaultUserSetting('auto_night_mode_time_range_goes_over_midnight', true); // If the time range above goes over midnight DefaultUserSetting('currently_inside_night_mode_range', false); // If we're currently inside of night mode time range (this is not user configurable, but stored as a user setting because it's evaluated client side to be able to use the client time instead of the maybe different server time) -# Keep screen on settings +// Keep screen on settings DefaultUserSetting('keep_screen_on', false); // Keep the screen always on DefaultUserSetting('keep_screen_on_when_fullscreen_card', false); // Keep the screen on when a "fullscreen-card" is displayed -# Stock settings +// Stock settings DefaultUserSetting('product_presets_location_id', -1); // Default location id for new products (-1 means no location is preset) DefaultUserSetting('product_presets_product_group_id', -1); // Default product group id for new products (-1 means no product group is preset) DefaultUserSetting('product_presets_qu_id', -1); // Default quantity unit id for new products (-1 means no quantity unit is preset) -DefaultUserSetting('stock_expring_soon_days', 5); +DefaultUserSetting('stock_decimal_places_amounts', 4); // Default decimal places allowed for amounts +DefaultUserSetting('stock_decimal_places_prices', 2); // Default decimal places allowed for prices +DefaultUserSetting('stock_due_soon_days', 5); DefaultUserSetting('stock_default_purchase_amount', 0); DefaultUserSetting('stock_default_consume_amount', 1); +DefaultUserSetting('stock_default_consume_amount_use_quick_consume_amount', false); DefaultUserSetting('scan_mode_consume_enabled', false); DefaultUserSetting('scan_mode_purchase_enabled', false); DefaultUserSetting('show_icon_on_stock_overview_page_when_product_is_on_shopping_list', true); +DefaultUserSetting('show_purchased_date_on_purchase', false); // Wheter the purchased date should be editable on purchase (defaults to today otherwise) +DefaultUserSetting('show_warning_on_purchase_when_due_date_is_earlier_than_next', true); // Show a warning on purchase when the due date of the purchased product is earlier than the next due date in stock -# Shopping list settings -DefaultUserSetting('shopping_list_to_stock_workflow_auto_submit_when_prefilled', false); // Automatically do the booking using the last price and the amount of the shopping list item, if the product has "Default best before days" set +// Shopping list settings +DefaultUserSetting('shopping_list_to_stock_workflow_auto_submit_when_prefilled', false); // Automatically do the booking using the last price and the amount of the shopping list item, if the product has "Default due days" set DefaultUserSetting('shopping_list_show_calendar', false); -DefaultUserSetting('shopping_list_disable_auto_compact_view_on_mobile', false); -# Recipe settings +// Recipe settings DefaultUserSetting('recipe_ingredients_group_by_product_group', false); // Group recipe ingredients by their product group -# Chores settings +// Chores settings DefaultUserSetting('chores_due_soon_days', 5); -# Batteries settings +// Batteries settings DefaultUserSetting('batteries_due_soon_days', 5); -# Tasks settings +// Tasks settings DefaultUserSetting('tasks_due_soon_days', 5); -# If the page should be automatically reloaded when there was -# an external change +// If the page should be automatically reloaded when there was +// an external change DefaultUserSetting('auto_reload_on_db_change', true); -# Show a clock in the header next to the logo or not +// Show a clock in the header next to the logo or not DefaultUserSetting('show_clock_in_header', false); -# Component configuration +// Component configuration for Quagga2 - read https://github.com/ericblade/quagga2#configobject for details +// Below is a generic good configuration, +// for an iPhone 7 Plus, halfsample = true, patchsize = small, frequency = 5 yields very good results DefaultUserSetting('quagga2_numofworkers', 4); +DefaultUserSetting('quagga2_halfsample', false); +DefaultUserSetting('quagga2_patchsize', 'medium'); +DefaultUserSetting('quagga2_frequency', 10); +DefaultUserSetting('quagga2_debug', true); - -# Feature flags -# grocy was initially about "stock management for your household", many other things -# came and still come by, because they are useful - here you can disable the parts -# which you don't need to have a less cluttered UI -# (set the setting to "false" to disable the corresponding part, which should be self explanatory) +// Feature flags +// grocy was initially about "stock management for your household", many other things +// came and still come by, because they are useful - here you can disable the parts +// which you don't need to have a less cluttered UI +// (set the setting to "false" to disable the corresponding part, which should be self explanatory) Setting('FEATURE_FLAG_STOCK', true); Setting('FEATURE_FLAG_SHOPPINGLIST', true); Setting('FEATURE_FLAG_RECIPES', true); @@ -144,18 +173,16 @@ Setting('FEATURE_FLAG_BATTERIES', true); Setting('FEATURE_FLAG_EQUIPMENT', true); Setting('FEATURE_FLAG_CALENDAR', true); - -# Sub feature flags +// Sub feature flags Setting('FEATURE_FLAG_STOCK_PRICE_TRACKING', true); Setting('FEATURE_FLAG_STOCK_LOCATION_TRACKING', true); Setting('FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING', true); Setting('FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING', true); Setting('FEATURE_FLAG_STOCK_PRODUCT_FREEZING', true); -Setting('FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_FIELD_NUMBER_PAD', true); // Activate the number pad in best-before-date fields on (supported) mobile browsers +Setting('FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_FIELD_NUMBER_PAD', true); // Activate the number pad in due date fields on (supported) mobile browsers Setting('FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS', true); Setting('FEATURE_FLAG_CHORES_ASSIGNMENTS', true); - -# Feature settings -Setting('FEATURE_SETTING_STOCK_COUNT_OPENED_PRODUCTS_AGAINST_MINIMUM_STOCK_AMOUNT', true); // When set to false, opened products will not be considered for minimum stock amounts -Setting('FEATURE_FLAG_AUTO_TORCH_ON_WITH_CAMERA', true); // Enables the torch automaticaly in every camera barcode scanner. +// Feature settings +Setting('FEATURE_SETTING_STOCK_COUNT_OPENED_PRODUCTS_AGAINST_MINIMUM_STOCK_AMOUNT', true); // When set to true, opened items will be counted as missing for calculating if a product is below its minimum stock amount +Setting('FEATURE_FLAG_AUTO_TORCH_ON_WITH_CAMERA', true); // Enables the torch automaticaly (if the device has one) From fcc1beffbfa2dbfbd189a8013f7dc8321e950d82 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 22 Jan 2021 09:23:21 +0100 Subject: [PATCH 14/29] Remove path --- README.md | 2 +- README_fr.md | 6 +----- manifest.json | 12 +----------- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index b7a1033..7c4a257 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Grocy is a web-based self-hosted groceries & household management solution for y ## Limitations -* Any known limitations. +:warning: For now, Grocy must be installed in a root domain or subdirectory. ## Additional information diff --git a/README_fr.md b/README_fr.md index 3287b27..46f67ce 100644 --- a/README_fr.md +++ b/README_fr.md @@ -23,10 +23,6 @@ Grocy is a web-based self-hosted groceries & household management solution for y ## Configuration - Default login - user: **admin** - password: **admin** - ## Documentation * Documentation officielle : Lien vers la documentation officielle de cette application. @@ -46,7 +42,7 @@ Grocy is a web-based self-hosted groceries & household management solution for y ## Limitations -* Limitations connues. +:warning: Pour l'instant, Grocy doit être installé dans un domaine racine ou un sous-dpmaine. ## Informations additionnelles diff --git a/manifest.json b/manifest.json index 44e66c0..84584d6 100644 --- a/manifest.json +++ b/manifest.json @@ -29,17 +29,7 @@ "en": "Choose a domain name for Grocy", "fr": "Choisissez un nom de domaine pour Grocy" }, - "example": "example.com" - }, - { - "name": "path", - "type": "path", - "ask": { - "en": "Choose a path for Grocy", - "fr": "Choisissez un chemin pour Grocy" - }, - "example": "/", - "default": "/" + "example": "grocy.example.com" }, { "name": "language", From a277da304caca13607dfa2292e16afd5f1722d14 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 22 Jan 2021 09:28:25 +0100 Subject: [PATCH 15/29] Update README_fr.md --- README_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index 9205740..93ee4a0 100644 --- a/README_fr.md +++ b/README_fr.md @@ -42,7 +42,7 @@ Grocy is a web-based self-hosted groceries & household management solution for y ## Limitations -:warning: Pour l'instant, Grocy doit être installé dans un domaine racine ou un sous-dpmaine. +:warning: Pour l'instant, Grocy doit être installé dans un domaine racine ou un sous-domaine. ## Informations additionnelles From b36b834ec75e2aefcb401c16eb2ca179a75fa851 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 22 Jan 2021 10:17:48 +0100 Subject: [PATCH 16/29] Update README_fr.md --- README_fr.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README_fr.md b/README_fr.md index 93ee4a0..84993ce 100644 --- a/README_fr.md +++ b/README_fr.md @@ -23,6 +23,10 @@ Grocy is a web-based self-hosted groceries & household management solution for y ## Configuration +Connexion par défaut + utilisateur : **admin** + mot de passe : **admin** + ## Documentation * Documentation officielle : Lien vers la documentation officielle de cette application. From 31f43b6f507179ebb88b720ad42e67a6c568db95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 22 Jan 2021 10:32:28 +0100 Subject: [PATCH 17/29] Upgrade to 3.0.1 (#4) * Upgrade to 3.0.1 --- README.md | 4 ++-- README_fr.md | 2 +- conf/app.src | 4 ++-- manifest.json | 6 +++--- scripts/_common.sh | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7c4a257..2230b78 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview Grocy is a web-based self-hosted groceries & household management solution for your home. -**Shipped version:** 3.0.0 +**Shipped version:** 3.0.1 ## Screenshots @@ -24,7 +24,7 @@ Grocy is a web-based self-hosted groceries & household management solution for y ## Configuration Default login - user: **admin** + user: **admin** password: **admin** ## Documentation diff --git a/README_fr.md b/README_fr.md index 84993ce..3bdc065 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install ## Vue d'ensemble Grocy is a web-based self-hosted groceries & household management solution for your home. -**Version incluse :** 3.0.0 +**Version incluse :** 3.0.1 ## Captures d'écran diff --git a/conf/app.src b/conf/app.src index 0174290..2afc137 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/grocy/grocy/releases/download/v3.0.0/grocy_3.0.0.zip -SOURCE_SUM=3bb0e4b1f03de481ef2c9c91ad61bc88409c5140ec3adcad77bf24a0d65d4331 +SOURCE_URL=https://github.com/grocy/grocy/releases/download/v3.0.1/grocy_3.0.1.zip +SOURCE_SUM=623c6fd0b70b36da58b389ed05a9e8f4d531c1d5a01797ad03f33a85457339af SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=false diff --git a/manifest.json b/manifest.json index 5b039e2..918e96a 100644 --- a/manifest.json +++ b/manifest.json @@ -3,10 +3,10 @@ "id": "grocy", "packaging_format": 1, "description": { - "en": "Web-based self-hosted groceries & household management solution for your home", - "fr": "Solution Web auto-hébergée de gestion d'épicerie et de gestion de la maison" + "en": "Web-based groceries & household management solution for your home", + "fr": "Solution Web de gestion d'épicerie et de gestion de la maison" }, - "version": "3.0.0~ynh2", + "version": "3.0.1~ynh1", "url": "https://github.com/grocy/grocy", "license": "MIT", "maintainer": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 66e31fe..58131e6 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="7.3" +YNH_PHP_VERSION="7.4" extra_php_dependencies="php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-sqlite3 php${YNH_PHP_VERSION}-gd" From 889d399e985f4292021e6d1cedd6dae48f9472c6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 25 Jan 2021 10:18:00 +0100 Subject: [PATCH 19/29] Update manifest.json --- manifest.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 918e96a..a658f0d 100644 --- a/manifest.json +++ b/manifest.json @@ -19,7 +19,7 @@ "multi_instance": true, "services": [ "nginx", - "php7.0-fpm" + "php7.3-fpm" ], "arguments": { "install": [{ @@ -29,6 +29,10 @@ "en": "Choose a domain name for Grocy", "fr": "Choisissez un nom de domaine pour Grocy" }, + "help": { + "en": "Grocy needs to be installed in its own root domain or subdomain.", + "fr": "Grocy doit être installé dans son propre domaine racine ou sous-domaine." + }, "example": "grocy.example.com" }, { From ebcc8c105166b6c9864b42cd124379f20a81347e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 20 Feb 2021 00:06:43 +0100 Subject: [PATCH 20/29] add pull request --- pull_request_template.md | 16 ++++++++++++++++ scripts/install | 4 ++-- scripts/upgrade | 7 +++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 pull_request_template.md diff --git a/pull_request_template.md b/pull_request_template.md new file mode 100644 index 0000000..6c28fc5 --- /dev/null +++ b/pull_request_template.md @@ -0,0 +1,16 @@ +## Problem +- *Description of why you made this PR* + +## Solution +- *And how do you fix that problem* + +## PR Status +- [ ] Code finished. +- [ ] Tested with Package_check. +- [ ] Fix or enhancement tested. +- [ ] Upgrade from last version tested. +- [ ] Can be reviewed and tested. + +## Package_check results +--- +* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/install b/scripts/install index f5646f2..adbe298 100644 --- a/scripts/install +++ b/scripts/install @@ -109,12 +109,12 @@ chmod -R 755 $final_path/data #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=1 +ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary or protect it if [ $is_public -eq 1 ] then - ynh_permission_update --permission "main" --add "visitors" + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ad4ccf2..4ab54e8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -40,6 +40,13 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= From 499d0a759dfd8b0722e0500a1fd5a580c301d763 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 14 Mar 2021 23:56:45 +0100 Subject: [PATCH 21/29] Cleaning up --- scripts/install | 1 - scripts/upgrade | 1 - 2 files changed, 2 deletions(-) diff --git a/scripts/install b/scripts/install index adbe298..c0f0fb2 100644 --- a/scripts/install +++ b/scripts/install @@ -45,7 +45,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 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=is_public --value=$is_public ynh_app_setting_set --app=$app --key=language --value=$language #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4ab54e8..b233f3b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,7 +18,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) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) language=$(ynh_app_setting_get --app=$app --key=language) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) From f6e24cd9530c87321212040c6bafde48b385058b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 15 Mar 2021 08:51:30 +0100 Subject: [PATCH 22/29] Update manifest.json --- manifest.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/manifest.json b/manifest.json index a658f0d..25f3e77 100644 --- a/manifest.json +++ b/manifest.json @@ -25,10 +25,6 @@ "install": [{ "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for Grocy", - "fr": "Choisissez un nom de domaine pour Grocy" - }, "help": { "en": "Grocy needs to be installed in its own root domain or subdomain.", "fr": "Grocy doit être installé dans son propre domaine racine ou sous-domaine." @@ -48,10 +44,6 @@ { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public site?", - "fr": "Est-ce un site public ?" - }, "help": { "en": "If enabled, Grocy will be accessible by people who do not have an account. This can be changed later via the webadmin.", "fr": "Si cette case est cochée, Grocy sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." From a5b51aeabdfe8ec5b345825920ae409467e70900 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 19 Mar 2021 18:23:36 +0100 Subject: [PATCH 23/29] Cleaning up --- README.md | 4 ++-- README_fr.md | 4 ++-- manifest.json | 10 +--------- scripts/install | 4 +--- scripts/upgrade | 5 +---- 5 files changed, 7 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 2230b78..210e8df 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ Grocy is a web-based self-hosted groceries & household management solution for y ## Configuration Default login - user: **admin** - password: **admin** + * user: **admin** + * password: **admin** ## Documentation diff --git a/README_fr.md b/README_fr.md index 3bdc065..08f09ca 100644 --- a/README_fr.md +++ b/README_fr.md @@ -24,8 +24,8 @@ Grocy is a web-based self-hosted groceries & household management solution for y ## Configuration Connexion par défaut - utilisateur : **admin** - mot de passe : **admin** + * utilisateur : **admin** + * mot de passe : **admin** ## Documentation diff --git a/manifest.json b/manifest.json index 25f3e77..72be1a0 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "" }, "requirements": { - "yunohost": ">= 4.0.0" + "yunohost": ">= 4.1.7" }, "multi_instance": true, "services": [ @@ -25,10 +25,6 @@ "install": [{ "name": "domain", "type": "domain", - "help": { - "en": "Grocy needs to be installed in its own root domain or subdomain.", - "fr": "Grocy doit être installé dans son propre domaine racine ou sous-domaine." - }, "example": "grocy.example.com" }, { @@ -44,10 +40,6 @@ { "name": "is_public", "type": "boolean", - "help": { - "en": "If enabled, Grocy will be accessible by people who do not have an account. This can be changed later via the webadmin.", - "fr": "Si cette case est cochée, Grocy sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." - }, "default": true } ] diff --git a/scripts/install b/scripts/install index c0f0fb2..0e41654 100644 --- a/scripts/install +++ b/scripts/install @@ -85,9 +85,7 @@ phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion) # MODIFY A CONFIG FILE #================================================= -cp -a ../conf/config-dist.php "$final_path/data/config.php" - -ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/data/config.php" +ynh_add_config --template="../conf/config-dist.php" --destination="$final_path/data/config.php" #================================================= # STORE THE CONFIG FILE CHECKSUM diff --git a/scripts/upgrade b/scripts/upgrade index b233f3b..b67a01c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -115,10 +115,7 @@ ynh_add_fpm_config --package="$extra_php_dependencies" # MODIFY A CONFIG FILE #================================================= -cp -a ../conf/config-dist.php "$final_path/data/config.php" - -ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/data/config.php" - +ynh_add_config --template="../conf/config-dist.php" --destination="$final_path/data/config.php" #================================================= # SECURE FILES AND DIRECTORIES From 179d8ea133fcbf3c57a284be03ea347360c70d05 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 25 Mar 2021 08:38:52 +0100 Subject: [PATCH 24/29] Fix --- scripts/install | 1 + scripts/restore | 1 + scripts/upgrade | 1 + 3 files changed, 3 insertions(+) diff --git a/scripts/install b/scripts/install index 0e41654..4ef8537 100644 --- a/scripts/install +++ b/scripts/install @@ -101,6 +101,7 @@ ynh_store_file_checksum --file="$final_path/data/config.php" # Set permissions to app files chown -R $app: $final_path +chmod o-rwx $final_path chmod -R 755 $final_path/data #================================================= diff --git a/scripts/restore b/scripts/restore index afccc7e..425d5f4 100644 --- a/scripts/restore +++ b/scripts/restore @@ -77,6 +77,7 @@ ynh_add_fpm_config --package="$extra_php_dependencies" # Restore permissions on app files chown -R $app: $final_path +chmod o-rwx $final_path chmod -R 755 $final_path/data #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b67a01c..d2dc13c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -123,6 +123,7 @@ ynh_add_config --template="../conf/config-dist.php" --destination="$final_path/d # Set permissions to app files chown -R $app: $final_path +chmod o-rwx $final_path chmod -R 755 $final_path/data #================================================= From fcf960949b572a96564c543752fb4840ecca3c7f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 10 Apr 2021 23:09:52 +0200 Subject: [PATCH 25/29] Fix path --- README.md | 4 ++-- README_fr.md | 4 ++-- scripts/change_url | 2 +- scripts/install | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 210e8df..7f5ed00 100644 --- a/README.md +++ b/README.md @@ -41,8 +41,8 @@ Grocy is a web-based self-hosted groceries & household management solution for y #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/grocy%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/grocy/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/grocy%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/grocy/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/grocy.svg)](https://ci-apps.yunohost.org/ci/apps/grocy/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/grocy.svg)](https://ci-apps-arm.yunohost.org/ci/apps/grocy/) ## Limitations diff --git a/README_fr.md b/README_fr.md index 08f09ca..d9adaab 100644 --- a/README_fr.md +++ b/README_fr.md @@ -41,8 +41,8 @@ Connexion par défaut #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/grocy%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/grocy/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/grocy%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/grocy/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/grocy.svg)](https://ci-apps.yunohost.org/ci/apps/grocy/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/grocy.svg)](https://ci-apps-arm.yunohost.org/ci/apps/grocy/) ## Limitations diff --git a/scripts/change_url b/scripts/change_url index b5d9d89..945088b 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -17,7 +17,7 @@ old_domain=$YNH_APP_OLD_DOMAIN old_path=$YNH_APP_OLD_PATH new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH +new_path="/" app=$YNH_APP_INSTANCE_NAME diff --git a/scripts/install b/scripts/install index 4ef8537..367a871 100644 --- a/scripts/install +++ b/scripts/install @@ -21,7 +21,7 @@ ynh_abort_if_errors # Retrieve arguments domain=$YNH_APP_ARG_DOMAIN -path_url=$"/" +path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE From af9aa984945cf24be8ffd54cf955ab5eb19492dc Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 11 Apr 2021 11:43:31 +0200 Subject: [PATCH 26/29] Fix --- check_process | 6 +++--- manifest.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/check_process b/check_process index f22c51d..f176d51 100644 --- a/check_process +++ b/check_process @@ -18,14 +18,14 @@ setup_private=1 setup_public=1 upgrade=1 + upgrade=1 from_commit=cbbb845cc8d7324b6e23ab6d7739233523283542 backup_restore=1 multi_instance=1 - port_already_use=0 change_url=1 ;;; Options Email= Notification=none ;;; Upgrade options - ; commit=CommitHash - name=Name and date of the commit. + ; commit=cbbb845cc8d7324b6e23ab6d7739233523283542 + name=Testing (#8) manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& diff --git a/manifest.json b/manifest.json index 72be1a0..f5745fc 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Web-based groceries & household management solution for your home", "fr": "Solution Web de gestion d'épicerie et de gestion de la maison" }, - "version": "3.0.1~ynh1", + "version": "3.0.1~ynh2", "url": "https://github.com/grocy/grocy", "license": "MIT", "maintainer": { From 3a64725c8f3ddf66660f757a0a9fc567081c2415 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 18 Apr 2021 16:35:43 +0200 Subject: [PATCH 27/29] Fix permissions --- scripts/install | 1 - scripts/restore | 1 - scripts/upgrade | 1 - 3 files changed, 3 deletions(-) diff --git a/scripts/install b/scripts/install index 367a871..f85ae99 100644 --- a/scripts/install +++ b/scripts/install @@ -101,7 +101,6 @@ ynh_store_file_checksum --file="$final_path/data/config.php" # Set permissions to app files chown -R $app: $final_path -chmod o-rwx $final_path chmod -R 755 $final_path/data #================================================= diff --git a/scripts/restore b/scripts/restore index 425d5f4..afccc7e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -77,7 +77,6 @@ ynh_add_fpm_config --package="$extra_php_dependencies" # Restore permissions on app files chown -R $app: $final_path -chmod o-rwx $final_path chmod -R 755 $final_path/data #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index d2dc13c..b67a01c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -123,7 +123,6 @@ ynh_add_config --template="../conf/config-dist.php" --destination="$final_path/d # Set permissions to app files chown -R $app: $final_path -chmod o-rwx $final_path chmod -R 755 $final_path/data #================================================= From 5f612cef23cc39e3a6ac13fcf9d3273141a537c7 Mon Sep 17 00:00:00 2001 From: YunoHost Bot Date: Tue, 11 May 2021 07:27:11 +0200 Subject: [PATCH 28/29] [autopatch] Update issue and PR templates (#11) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Testing (#9) * Cleaning up * [autopatch] Update issue and PR templates Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: Yunohost-Bot <> --- scripts/install | 1 + scripts/restore | 1 + scripts/upgrade | 1 + 3 files changed, 3 insertions(+) diff --git a/scripts/install b/scripts/install index f85ae99..367a871 100644 --- a/scripts/install +++ b/scripts/install @@ -101,6 +101,7 @@ ynh_store_file_checksum --file="$final_path/data/config.php" # Set permissions to app files chown -R $app: $final_path +chmod o-rwx $final_path chmod -R 755 $final_path/data #================================================= diff --git a/scripts/restore b/scripts/restore index afccc7e..425d5f4 100644 --- a/scripts/restore +++ b/scripts/restore @@ -77,6 +77,7 @@ ynh_add_fpm_config --package="$extra_php_dependencies" # Restore permissions on app files chown -R $app: $final_path +chmod o-rwx $final_path chmod -R 755 $final_path/data #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b67a01c..d2dc13c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -123,6 +123,7 @@ ynh_add_config --template="../conf/config-dist.php" --destination="$final_path/d # Set permissions to app files chown -R $app: $final_path +chmod o-rwx $final_path chmod -R 755 $final_path/data #================================================= From 610dbf7ac34adf34b6996ccfa91e3301c4d0d3e3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 11 May 2021 16:21:18 +0200 Subject: [PATCH 29/29] Fix --- .github/ISSUE_TEMPLATE.md | 55 ++++++++++++++++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 16 ++++++++++ README.md | 2 +- README_fr.md | 2 +- manifest.json | 2 +- pull_request_template.md | 16 ---------- scripts/upgrade | 12 +++---- 7 files changed, 80 insertions(+), 25 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 pull_request_template.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..2729a6b --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,55 @@ +--- +name: Bug report +about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently. + +--- + +**How to post a meaningful bug report** +1. *Read this whole template first.* +2. *Determine if you are on the right place:* + - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* + - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* + - *When in doubt, post here and we will figure it out together.* +3. *Delete the italic comments as you write over them below, and remove this guide.* +--- + +### Describe the bug + +*A clear and concise description of what the bug is.* + +### Context + +- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* +- YunoHost version: x.x.x +- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* +- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* + - If yes, please explain: +- Using, or trying to install package version/branch: +- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* + +### Steps to reproduce + +- *If you performed a command from the CLI, the command itself is enough. For example:* + ```sh + sudo yunohost app install the_app + ``` +- *If you used the webadmin, please perform the equivalent command from the CLI first.* +- *If the error occurs in your browser, explain what you did:* + 1. *Go to '...'* + 2. *Click on '...'* + 3. *Scroll down to '...'* + 4. *See error* + +### Expected behavior + +*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.* + +### Logs + +*When an operation fails, YunoHost provides a simple way to share the logs.* +- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.* +- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.* + +*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)* + +*If applicable and useful, add screenshots to help explain your problem.* diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..ef70e18 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Problem + +- *Description of why you made this PR* + +## Solution + +- *And how do you fix that problem* + +## PR Status + +- [ ] Code finished and ready to be reviewed/tested +- [ ] The fix/enhancement were manually tested (if applicable) + +## Automatic tests + +Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization) diff --git a/README.md b/README.md index 7f5ed00..435221c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ *[Lire ce readme en français.](./README_fr.md)* > *This package allows you to install Grocy quickly and simply on a YunoHost server. -If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* +If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.* ## Overview Grocy is a web-based self-hosted groceries & household management solution for your home. diff --git a/README_fr.md b/README_fr.md index d9adaab..bb1701b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -6,7 +6,7 @@ *[Read this readme in english.](./README.md)* > *Ce package vous permet d'installer Grocy rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.* +Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/install) pour apprendre comment l'installer.* ## Vue d'ensemble Grocy is a web-based self-hosted groceries & household management solution for your home. diff --git a/manifest.json b/manifest.json index f5745fc..61f50af 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "" }, "requirements": { - "yunohost": ">= 4.1.7" + "yunohost": ">= 4.2.4" }, "multi_instance": true, "services": [ diff --git a/pull_request_template.md b/pull_request_template.md deleted file mode 100644 index 6c28fc5..0000000 --- a/pull_request_template.md +++ /dev/null @@ -1,16 +0,0 @@ -## Problem -- *Description of why you made this PR* - -## Solution -- *And how do you fix that problem* - -## PR Status -- [ ] Code finished. -- [ ] Tested with Package_check. -- [ ] Fix or enhancement tested. -- [ ] Upgrade from last version tested. -- [ ] Can be reviewed and tested. - -## Package_check results ---- -* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/upgrade b/scripts/upgrade index d2dc13c..b802671 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -69,22 +69,22 @@ then ynh_script_progression --message="Upgrading source files..." --weight=5 # Create a temporary directory - tmpdir="$(mktemp -d)" + #tmpdir="$(mktemp -d)" # Backup the config file in the temp dir - cp -R "$final_path/data" "$tmpdir/data" + #cp -R "$final_path/data" "$tmpdir/data" # Remove the app directory securely - ynh_secure_remove --file="$final_path" + #ynh_secure_remove --file="$final_path" # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$final_path" --keep="$final_path/data" # Copy the admin saved settings from tmp directory to final path - cp -RT "$tmpdir/data" "$final_path/data" + #cp -RT "$tmpdir/data" "$final_path/data" # Remove the tmp directory securely - ynh_secure_remove --file="$tmpdir" + #ynh_secure_remove --file="$tmpdir" fi #=================================================