diff --git a/README.md b/README.md index 2230b78..7f5ed00 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 @@ -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 3bdc065..d9adaab 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 @@ -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/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 a658f0d..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": { @@ -14,7 +14,7 @@ "email": "" }, "requirements": { - "yunohost": ">= 4.0.0" + "yunohost": ">= 4.1.7" }, "multi_instance": true, "services": [ @@ -25,14 +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." - }, "example": "grocy.example.com" }, { @@ -48,14 +40,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." - }, "default": true } ] 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/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 f5646f2..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 @@ -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 #================================================= @@ -86,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 @@ -104,17 +101,18 @@ 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 #================================================= # 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/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 ad4ccf2..d2dc13c 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) @@ -40,6 +39,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 #================================================= @@ -109,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 @@ -120,6 +123,7 @@ ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" -- # Set permissions to app files chown -R $app: $final_path +chmod o-rwx $final_path chmod -R 755 $final_path/data #=================================================